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
## 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" ```
- Loading branch information