Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong parameter types for some RPC methods #209

Closed
janbormet opened this issue Jun 30, 2023 · 0 comments
Closed

Wrong parameter types for some RPC methods #209

janbormet opened this issue Jun 30, 2023 · 0 comments

Comments

@janbormet
Copy link

janbormet commented Jun 30, 2023

Some methods in the Client interface of the indexer package receive a parameter limit uint64:

GetCells(ctx context.Context, searchKey *SearchKey, order SearchOrder, limit uint64, afterCursor string) (*LiveCells, error)

// GetTransactions returns the transactions collection by the lock or type script.
GetTransactions(ctx context.Context, searchKey *SearchKey, order SearchOrder, limit uint64, afterCursor string) (*TxsWithCell, error)

// GetTransactionsGrouped returns the grouped transactions collection by the lock or type script.
GetTransactionsGrouped(ctx context.Context, searchKey *SearchKey, order SearchOrder, limit uint64, afterCursor string) (*TxsWithCells, error)

The RPC Indexer module documentation requires the limit value to be UInt32 though.
If you call e.g. client.GetCells(_, _, _, math.MaxUint64, _), the rpc node will return an error:
Invalid params: Invalid Uint32 0xffffffffffffffff: number too large to fit in target type.

These should be adjusted to receive uint32 and their implementation should properly convert to UInt32
(indexer/indexer.go)

There might also be similar issues with other RPC methods, I did not check exhaustively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants