Skip to content

Commit

Permalink
Revert "Remove pagingToken from getEvents (#297)"
Browse files Browse the repository at this point in the history
This reverts commit 44db01f.
  • Loading branch information
Shaptic committed Oct 24, 2024
1 parent e04483a commit 4b948c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/soroban-rpc/internal/methods/get_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ type EventInfo struct {
ContractID string `json:"contractId"`
ID string `json:"id"`

// Deprecated: PagingToken field is deprecated, please use Cursor at top level for pagination
PagingToken string `json:"pagingToken"`
InSuccessfulContractCall bool `json:"inSuccessfulContractCall"`
TransactionHash string `json:"txHash"`

Expand Down Expand Up @@ -554,6 +556,7 @@ func eventInfoForEvent(
Ledger: int32(cursor.Ledger),
LedgerClosedAt: ledgerClosedAt,
ID: cursor.String(),
PagingToken: cursor.String(),
InSuccessfulContractCall: event.InSuccessfulContractCall,
TransactionHash: txHash,
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/soroban-rpc/internal/methods/get_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4",
ID: id,
PagingToken: id,
TopicXDR: []string{value},
ValueXDR: value,
InSuccessfulContractCall: true,
Expand Down Expand Up @@ -795,6 +796,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4",
ID: id,
PagingToken: id,
TopicXDR: []string{counterXdr, value},
ValueXDR: value,
InSuccessfulContractCall: true,
Expand Down Expand Up @@ -941,6 +943,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]),
ID: id,
PagingToken: id,
TopicXDR: []string{counterXdr, value},
ValueXDR: value,
InSuccessfulContractCall: true,
Expand Down Expand Up @@ -1017,6 +1020,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]),
ID: id,
PagingToken: id,
TopicXDR: []string{counterXdr},
ValueXDR: counterXdr,
InSuccessfulContractCall: true,
Expand Down Expand Up @@ -1089,6 +1093,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4",
ID: id,
PagingToken: id,
TopicXDR: []string{value},
ValueXDR: value,
InSuccessfulContractCall: true,
Expand Down Expand Up @@ -1190,6 +1195,7 @@ func TestGetEvents(t *testing.T) {
LedgerClosedAt: now.Format(time.RFC3339),
ContractID: strkey.MustEncode(strkey.VersionByteContract, contractID[:]),
ID: id,
PagingToken: id,
TopicXDR: []string{counterXdr},
ValueXDR: expectedXdr,
InSuccessfulContractCall: true,
Expand Down

0 comments on commit 4b948c3

Please sign in to comment.