Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexer: deprecate TransactionFilter::ToAddress (#19616)
## Description Remove support for filtering by `ToAddress` in PG-backed JSON-RPC. At the same time, change implementations for `FromAndToAddress` and `FromOrToAddress` to use the new `tx_affected_addresses` table, which should be more efficient. ## Test plan Manually tested: ``` sui$ cargo run --bin sui -- --force-regenesis \ --with-faucet --with-indexer ``` ``` sui$ $SUI client faucet sui$ $SUI client ptb --transfer-objects [gas] @0x42 sui$ curl -LX POST "http://localhost:9124" \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "id": 1, "method": "suix_queryTransactionBlocks", "params": [ { "filter": { "FromOrToAddress": { "addr": "'($SUI client active-address)'" } } }, null, 50, true ] }' | jq .result.data.[].digest "4NDjddQA8Q158EuskHm73AVoo4Gmr6SknuTv1nzghVd1" "5EECPcG6ZbUaH6nXCZWazpg6vcsC33nfnEw6qVkAnN9W" sui$ curl -LX POST "http://localhost:9124" \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "id": 1, "method": "suix_queryTransactionBlocks", "params": [ { "filter": { "FromOrToAddress": { "addr": "0x0000000000000000000000000000000000000000000000000000000000000042" } } }, null, 50, true ] }' | jq .result.data.[].digest "4NDjddQA8Q158EuskHm73AVoo4Gmr6SknuTv1nzghVd1" sui$ curl -LX POST "http://localhost:9124" \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "id": 1, "method": "suix_queryTransactionBlocks", "params": [ { "filter": { "FromAndToAddress": { "from": "'($SUI client active-address)'", "to": "0x0000000000000000000000000000000000000000000000000000000000000042" } } }, null, 50, true ] }' | jq .result.data.[].digest "4NDjddQA8Q158EuskHm73AVoo4Gmr6SknuTv1nzghVd1" ``` ## Stack - #19474 - #19614 - #19615 --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [x] Indexer: Remove support for filtering transactions by `ToAddress`, (instead of `FromOrToAddress`). - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information