Closed 0xBigBoss closed 1 year ago
Thank you @0xBigBoss for this first contribution!
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information
AI-Generated Pull Request Summary: This pull request contains 2 commits that introduce the use of block height in the query account transactions command. It adds functionality to search for account transactions with a specific height, useful for filtering transactions. Additionally, this PR includes some context to clarify the behavior of the height parameter when equal to 0.
AI-Generated Pull Request Summary: This pull request contains a series of 3 patches:
The first patch modifies the QueryAccountTxs function to include the block height as an optional parameter in CLI and RPC queries. It also adds tests to ensure proper functionality when querying account transactions by height.
The second patch adds a comment in the app/cmd/cli/query.go
file to provide context for the height parameter's default value of 0. This value is ignored during the query and implies the latest height available.
The third patch clarifies the casting of block heights as integers when querying using the tx height index due to the lexicographic encoder library used in the types/indexer.go
file. This is safe because v0 block height should never exceed 2^63-1 on 64-bit systems or 2^31-1 on 32-bit systems.
Overall, these patches improve the functionality and maintainability of the codebase.
This PR Adds a new query parameter to the accounttxs endpoint to allow querying for account (send/received) txs starting at a certain height.
This is not a breaking change, as the new parameter is optional. If it is not provided, the endpoint will behave as it did before.
It is a performance improvement, as it allows the client to specify a height to start querying from, instead of having to query all txs and then filter them out.
You can try and verify by running the following commands:
CURRENT_POKT_RPC_URL= # replace with current rpc url POKT_RPC_WITH_HEIGHT_INDEX_URL= # replace with new rpc url built from this branch
Tested using the SendNodes POPs address.
pull hash and height of first and last tx
query new version with last height
double check old version still matches