Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
psheth9 committed Feb 12, 2024
1 parent 8efaf52 commit 40b6a1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/transactions/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (m *MemoryStore) GetTransaction(hash xdr.Hash) (Transaction, bool, StoreRan
return Transaction{}, false, storeRange
}

var events = make([][]byte, 0, len(txEvents))
events := make([][]byte, 0, len(txEvents))

for _, e := range txEvents {
diagnosticEventXDR, err := e.MarshalBinary()
Expand Down
13 changes: 13 additions & 0 deletions cmd/soroban-rpc/internal/transactions/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,19 @@ func TestGetTransactionsWithEventData(t *testing.T) {
require.True(t, ok)
require.NotNil(t, tx.Events)
require.Len(t, tx.Events, 1)

var event xdr.DiagnosticEvent
err := event.UnmarshalBinary(tx.Events[0])
require.Nil(t, err)
require.Equal(t, xdr.ContractEventTypeContract, event.Event.Type)
require.Equal(t, int32(0), event.Event.Body.V)

require.NotNil(t, event.Event.Body.V0.Topics)
require.Equal(t, xdr.ScValTypeScvSymbol, event.Event.Body.V0.Topics[0].Type)

require.NotNil(t, event.Event.Body.V0.Data)
require.Equal(t, xdr.ScValTypeScvSymbol, event.Event.Body.V0.Data.Type)

}

func stableHeapInUse() int64 {
Expand Down

0 comments on commit 40b6a1d

Please sign in to comment.