Skip to content

Commit

Permalink
Revert PaginationOptionschanges - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya1702 committed Oct 2, 2024
1 parent ab8c4e5 commit a8a24e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestGetTransactions(t *testing.T) {
// Get transactions with limit
request = methods.GetTransactionsRequest{
StartLedger: ledgers[0],
Pagination: &methods.TransactionPaginationOptions{
Pagination: &methods.TransactionsPaginationOptions{
Limit: 1,
},
}
Expand All @@ -82,7 +82,7 @@ func TestGetTransactions(t *testing.T) {

// Get transactions using previous result's cursor
request = methods.GetTransactionsRequest{
Pagination: &methods.TransactionPaginationOptions{
Pagination: &methods.TransactionsPaginationOptions{
Cursor: result.Cursor,
Limit: 5,
},
Expand Down
8 changes: 4 additions & 4 deletions cmd/soroban-rpc/internal/methods/get_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ import (
"github.com/stellar/soroban-rpc/cmd/soroban-rpc/internal/ledgerbucketwindow"
)

type TransactionPaginationOptions struct {
type TransactionsPaginationOptions struct {
Cursor string `json:"cursor,omitempty"`
Limit uint `json:"limit,omitempty"`
}

// GetTransactionsRequest represents the request parameters for fetching transactions within a range of ledgers.
type GetTransactionsRequest struct {
StartLedger uint32 `json:"startLedger"`
Pagination *TransactionPaginationOptions `json:"pagination,omitempty"`
Format string `json:"xdrFormat,omitempty"`
StartLedger uint32 `json:"startLedger"`
Pagination *TransactionsPaginationOptions `json:"pagination,omitempty"`
Format string `json:"xdrFormat,omitempty"`
}

// isValid checks the validity of the request parameters.
Expand Down
8 changes: 4 additions & 4 deletions cmd/soroban-rpc/internal/methods/get_transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestGetTransactions_CustomLimit(t *testing.T) {

request := GetTransactionsRequest{
StartLedger: 1,
Pagination: &TransactionPaginationOptions{
Pagination: &TransactionsPaginationOptions{
Limit: 2,
},
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestGetTransactions_CustomLimitAndCursor(t *testing.T) {
}

request := GetTransactionsRequest{
Pagination: &TransactionPaginationOptions{
Pagination: &TransactionsPaginationOptions{
Cursor: toid.New(1, 2, 1).String(),
Limit: 3,
},
Expand Down Expand Up @@ -284,7 +284,7 @@ func TestGetTransactions_LimitGreaterThanMaxLimit(t *testing.T) {

request := GetTransactionsRequest{
StartLedger: 1,
Pagination: &TransactionPaginationOptions{
Pagination: &TransactionsPaginationOptions{
Limit: 200,
},
}
Expand All @@ -311,7 +311,7 @@ func TestGetTransactions_InvalidCursorString(t *testing.T) {
}

request := GetTransactionsRequest{
Pagination: &TransactionPaginationOptions{
Pagination: &TransactionsPaginationOptions{
Cursor: "abc",
},
}
Expand Down

0 comments on commit a8a24e2

Please sign in to comment.