From 2cddd9d8d403e41541a451940ac9f14458b2dba2 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Sat, 12 Oct 2024 00:58:45 +0100 Subject: [PATCH] graphql: Remove TransactionBlockFilter.recvAddress and AddressTransactionBlockRelation.RECV (#19805) ## Description These fields were flagged for deprecation in 1.34 and have been replaced in 1.35 by - `TransactionBlockFilter.affectedAddress` and - `AddressTransactionBlockRelation.AFFECTED` Which offer a similar (but not exactly the same) semantics, but without confusion around the sender address which was often also an implicit recipient of a transaction. ## Test plan ``` sui$ cargo nextest run -p sui-graphql-rpc sui$ cargo nextest run -p sui-graphql-rpc --features staging sui$ cargo nextest run -p sui-graphql-e2e-tests ``` ## Stack - #19708 - #19802 - #19803 - #19804 --- ## 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): - [ ] Indexer: - [ ] JSON-RPC: - [x] GraphQL: `TransactionBlockFilter.recvAddress` and `AddressTransactionBlockRelation.RECV` have been replace by `TransactionBlockFilter.affectedAddress` and `AddressTransactionBlockRelation.AFFECTED` which offer similar semantics, but without confusion around the sender address which was also often (but not always) an implicit recipient. Now we don't distinguish between senders and recipients -- we only have senders and "affected" addresses which were touched by the transaction in some way. - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- .changeset/pretty-hounds-breathe.md | 5 + .../transactions/filters/affected_address.exp | 142 +----------------- .../filters/affected_address.move | 5 - .../transactions/filters/transaction_ids.move | 4 +- .../transactions/scan_limit/alternating.move | 14 +- .../transactions/scan_limit/both_cursors.move | 6 +- .../transactions/scan_limit/equal/first.move | 16 +- .../transactions/scan_limit/equal/last.move | 14 +- .../scan_limit/ge_page/first.move | 14 +- .../transactions/scan_limit/ge_page/last.move | 14 +- .../scan_limit/invalid_limits.move | 8 +- .../scan_limit/le_page/first.move | 12 +- .../transactions/scan_limit/le_page/last.move | 12 +- .../transactions/scan_limit/require.move | 20 +-- ...r.graphql => affected_addr_filter.graphql} | 2 +- crates/sui-graphql-rpc/schema.graphql | 17 --- crates/sui-graphql-rpc/src/types/address.rs | 11 -- crates/sui-graphql-rpc/src/types/object.rs | 3 - .../src/types/transaction_block/filter.rs | 12 -- .../src/types/transaction_block/mod.rs | 4 +- .../src/types/transaction_block/tx_lookups.rs | 11 -- crates/sui-graphql-rpc/staging.graphql | 17 --- .../snapshot_tests__schema.graphql.snap | 17 --- .../snapshot_tests__staging.graphql.snap | 17 --- .../src/generated/queries.ts | 29 ++-- sdk/graphql-transport/src/methods.ts | 2 +- 26 files changed, 91 insertions(+), 337 deletions(-) create mode 100644 .changeset/pretty-hounds-breathe.md rename crates/sui-graphql-rpc/examples/transaction_block_connection/{recv_addr_filter.graphql => affected_addr_filter.graphql} (89%) diff --git a/.changeset/pretty-hounds-breathe.md b/.changeset/pretty-hounds-breathe.md new file mode 100644 index 0000000000000..87fa1562ec7bb --- /dev/null +++ b/.changeset/pretty-hounds-breathe.md @@ -0,0 +1,5 @@ +--- +'@mysten/graphql-transport': patch +--- + +Update the GraphQL transport to account for the removal of recvAddress and the introduction of affectedAddress. diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.exp b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.exp index bd348488c7358..afa4dc65590a9 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.exp +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.exp @@ -51,7 +51,7 @@ task 7, line 48: //# create-checkpoint Checkpoint created: 1 -task 8, lines 50-97: +task 8, lines 50-92: //# run-graphql Response: { "data": { @@ -563,146 +563,6 @@ Response: { } ] }, - "receivedByA": { - "nodes": [ - { - "effects": { - "objectChanges": { - "nodes": [ - { - "inputState": null, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "1000000" - } - } - } - }, - { - "inputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "300000000000000" - } - } - }, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999996024000" - } - } - } - } - ] - } - } - }, - { - "effects": { - "objectChanges": { - "nodes": [ - { - "inputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999996024000" - } - } - }, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999992026120" - } - } - } - }, - { - "inputState": null, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "2000000" - } - } - } - } - ] - } - } - }, - { - "effects": { - "objectChanges": { - "nodes": [ - { - "inputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999992026120" - } - } - }, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999987028240" - } - } - } - }, - { - "inputState": null, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "3000000" - } - } - } - } - ] - } - } - }, - { - "effects": { - "objectChanges": { - "nodes": [ - { - "inputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999987028240" - } - } - }, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "299999981030360" - } - } - } - }, - { - "inputState": null, - "outputState": { - "asMoveObject": { - "asCoin": { - "coinBalance": "4000000" - } - } - } - } - ] - } - } - } - ] - }, "affectsB": { "nodes": [ { diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.move index 6ea97e1dfc69e..22b386346369d 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/affected_address.move @@ -65,11 +65,6 @@ nodes { ...CoinBalances } } - # ...and the transactions that A was a recipient for - receivedByA: transactionBlocks(filter: { kind: PROGRAMMABLE_TX, recvAddress: "@{A}" }, scanLimit: 1000) { - nodes { ...CoinBalances } - } - # B was not affected by all the transactions affectsB: transactionBlocks(filter: { kind: PROGRAMMABLE_TX, affectedAddress: "@{B}" }, scanLimit: 1000) { nodes { ...CoinBalances } diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/transaction_ids.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/transaction_ids.move index 49637fb4cfee3..690fdb2503705 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/transaction_ids.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/transaction_ids.move @@ -66,7 +66,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(filter: {recvAddress: "@{A}" transactionIds: []}) { + transactionBlocks(filter: {affectedAddress: "@{A}" transactionIds: []}) { pageInfo { hasNextPage hasPreviousPage @@ -86,7 +86,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(scanLimit: 10 filter: {recvAddress: "@{A}" transactionIds: []}) { + transactionBlocks(scanLimit: 10 filter: {affectedAddress: "@{A}" transactionIds: []}) { pageInfo { hasNextPage hasPreviousPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/alternating.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/alternating.move index 8aaaba3b27c08..2c1232e6157b8 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/alternating.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/alternating.move @@ -56,7 +56,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(first: 2 scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -82,7 +82,7 @@ module Test::M1 { # so tx 4 and 6. the boundary cursors should wrap the response set, # and both should have isScanLimited set to false { - transactionBlocks(first: 2 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -107,7 +107,7 @@ module Test::M1 { # Meanwhile, because of the scanLimit of 2, the boundary cursors are # startCursor: 4, endCursor: 5, and both are scan limited { - transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -133,7 +133,7 @@ module Test::M1 { # startCursor: 7, endCursor: 8, both scan limited # response set consists of single tx 8 { - transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -162,7 +162,7 @@ module Test::M1 { # consequently, the endCursor wraps the result set # startCursor: 6, endCursor: 8, endCursor is not scan limited { - transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 6 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 6 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -187,7 +187,7 @@ module Test::M1 { # fetch the last tx without scan limit # startCursor = endCursor = 10, wrapping the response set { - transactionBlocks(first: 2 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -213,7 +213,7 @@ module Test::M1 { # unlike the not-scan-limited query, the start and end cursors # are expanded out to the scanned window, instead of wrapping the response set { - transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 6 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 after: "@{cursor_0}" scanLimit: 6 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/both_cursors.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/both_cursors.move index ab23179dbfa3e..68c126e25e24a 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/both_cursors.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/both_cursors.move @@ -59,7 +59,7 @@ module Test::M1 { # startCursor is at 3 + scanLimited, endCursor at 4 + not scanLimited # this is because between (2, 7), txs 4 and 6 match, and thus endCursor snaps to last of result { - transactionBlocks(first: 1 scanLimit: 4 after: "@{cursor_0}" before: "@{cursor_1}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 1 scanLimit: 4 after: "@{cursor_0}" before: "@{cursor_1}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -86,7 +86,7 @@ module Test::M1 { # and scan-limit logic will override this as there are still more txs to scan # note that we're scanning txs [3, 6] { - transactionBlocks(first: 3 scanLimit: 4 after: "@{cursor_0}" before: "@{cursor_1}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 3 scanLimit: 4 after: "@{cursor_0}" before: "@{cursor_1}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -111,7 +111,7 @@ module Test::M1 { # txs 5 and 7 match, but due to page size of `first: 1`, we only return tx 5 # startCursor is 5 + scan limited, endCursor is also 5 + scan limited { - transactionBlocks(first: 1 scanLimit: 3 after: "@{cursor_0}" before: "@{cursor_1}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 1 scanLimit: 3 after: "@{cursor_0}" before: "@{cursor_1}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/first.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/first.move index 997ebb0bb953f..0d6eeea40a29d 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/first.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/first.move @@ -60,7 +60,7 @@ module Test::M1 { # [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] <- tx_sequence_number # [B, A, B, A, B, A, A, A, B, B] { - transactionBlocks(first: 50 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 50 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -89,7 +89,7 @@ module Test::M1 { # The cursor for the node will have `is_scan_limited` flag set to false, because we know for sure there is # a corresponding element for the cursor in the result set. { - transactionBlocks(first: 2 scanLimit: 2 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 scanLimit: 2 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -115,7 +115,7 @@ module Test::M1 { # Still paginating with `scanLimit`, both the start and end cursors should have `is_scan_limited` flag to true # because of the scanLimit of 4, startCursor = endCursor = 4 { - transactionBlocks(first: 1 scanLimit: 1 after: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 1 scanLimit: 1 after: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -143,7 +143,7 @@ module Test::M1 { # instead of wrapping around the result set, the boundary cursors are pushed out # to the first and last transaction scanned in this query { - transactionBlocks(first: 3 scanLimit: 3 after: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 3 scanLimit: 3 after: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -171,7 +171,7 @@ module Test::M1 { # instead of returninng None, we set the boundary cursors # to the first and last transaction scanned in this query { - transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -198,7 +198,7 @@ module Test::M1 { # startCursor at 10, endCursor at 11 # correctly detects we've reached the end of the upper bound { - transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -230,7 +230,7 @@ module Test::M1 { # regardless of the specified scanLimit # correctly detects we've reached the end of the upper bound { - transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 5}) { + transactionBlocks(first: 2 scanLimit: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 5}) { pageInfo { hasPreviousPage hasNextPage @@ -259,7 +259,7 @@ module Test::M1 { # there is a next page, which is the 12th tx, which should yield an empty set # per the filtering criteria { - transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 5}) { + transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 5}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/last.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/last.move index a37c7976d1fc1..d917b925e27dc 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/last.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/equal/last.move @@ -57,7 +57,7 @@ module Test::M1 { //# run-graphql # Expect ten results { - transactionBlocks(last: 50 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 50 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -84,7 +84,7 @@ module Test::M1 { # startCursor: 10, endCursor: 11 # result is single element with cursor: 11 { - transactionBlocks(last: 2 scanLimit: 2 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 2 scanLimit: 2 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -110,7 +110,7 @@ module Test::M1 { # startCursor: 9, endCursor: 9 # result is single element with cursor: 9 { - transactionBlocks(last: 1 scanLimit: 1 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 1 scanLimit: 1 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -136,7 +136,7 @@ module Test::M1 { # startCursor: 6, endCursor: 8 # result is single element with cursor: 7 { - transactionBlocks(last: 3 scanLimit: 3 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 scanLimit: 3 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -162,7 +162,7 @@ module Test::M1 { # startCursor: 4, endCursor: 5 # expect empty set { - transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -187,7 +187,7 @@ module Test::M1 { # Returns the first two matching transactions, boundary cursors both have `is_scan_limited: true` # startCursor: 2, endCursor: 3 { - transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -213,7 +213,7 @@ module Test::M1 { # Since we know from the previous query that there is not a previous page at this cursor, # Expect false for page flags and null for cursors { - transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 2 scanLimit: 2 before: "@{cursor_0}" filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/first.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/first.move index caac3936e49f2..a6113ca543cce 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/first.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/first.move @@ -78,7 +78,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -107,7 +107,7 @@ module Test::M1 { # this is so we don't end up skipping any other matches in the scan range # but beyond the scope of the `limit` { - transactionBlocks(first: 1 scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -133,7 +133,7 @@ module Test::M1 { # endCursor ends at 7, not 3, because we've exhausted all the matches # within the window of scanning range, and will overwrite the endCursor to 7. { - transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -158,7 +158,7 @@ module Test::M1 { # startCursor: 8, endCursor: 12, both are scan-limited # expect an empty set { - transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -183,7 +183,7 @@ module Test::M1 { # startCursor: 13, endCursor: 17, both are scan-limited # single element returned, coincidentally also the last scanned transaction { - transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -210,7 +210,7 @@ module Test::M1 { # but due to the `first` limit, we return a subset. # we don't want to skip over other matches, so we don't push the endCursor out { - transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -236,7 +236,7 @@ module Test::M1 { # single element returned, coincidentally also the last scanned transaction # note that the startCursor is 19, not 18 or 21, since we can use the scan-limited behavior { - transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(first: 1 after: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/last.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/last.move index ddbce16557c6a..c6211042f38e3 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/last.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/ge_page/last.move @@ -78,7 +78,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -103,7 +103,7 @@ module Test::M1 { //# run-graphql # startCursor 21 not scan limited, endCursor 21 is scan limited { - transactionBlocks(last: 1 scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -130,7 +130,7 @@ module Test::M1 { # `scanLimit` is 5 - if we set the `startCursor` to 17, then we will never yield tx 17 # when paginating the other way, since the cursors are exclusive. { - transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -155,7 +155,7 @@ module Test::M1 { # continuing paginating backwards with scan limit # startCursor 11, endCursor 15, both scan limited { - transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -179,7 +179,7 @@ module Test::M1 { //# run-graphql --cursors {"c":7,"t":11,"i":true} # startCursor is 7, endCursor is 10, both scan limited { - transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -205,7 +205,7 @@ module Test::M1 { # this is because we found a matching element at tx 3, but within # the scanned window there is another tx that we need to return for { - transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage @@ -229,7 +229,7 @@ module Test::M1 { //# run-graphql --cursors {"c":7,"t":3,"i":false} # Reached the end { - transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { + transactionBlocks(last: 1 before: "@{cursor_0}" scanLimit: 5 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 6}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/invalid_limits.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/invalid_limits.move index bd8e0515508a5..4be8a80e255e8 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/invalid_limits.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/invalid_limits.move @@ -44,7 +44,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(first: 0 scanLimit: 2 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 0 scanLimit: 2 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -67,7 +67,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(first: 2 scanLimit: 0 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 2 scanLimit: 0 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -90,7 +90,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(first: 0 scanLimit: 0 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 0 scanLimit: 0 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -113,7 +113,7 @@ module Test::M1 { //# run-graphql { - transactionBlocks(first: 0 filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 0 filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/first.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/first.move index c08e311648fc6..18f82f6a0d83e 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/first.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/first.move @@ -84,7 +84,7 @@ module Test::M1 { //# run-graphql # startCursor 2, endCursor 3, both scan limited { - transactionBlocks(first: 3 scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 3 scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -108,7 +108,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":3,"i":true} # startCursor: 4, endCursor 5, both scan limited { - transactionBlocks(first: 3 scanLimit: 2 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 3 scanLimit: 2 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -136,7 +136,7 @@ module Test::M1 { # we set the endCursor to the final tx scanned, rather than snapping # to the last matched tx { - transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -160,7 +160,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":8,"i":true} # startCursor: 9, endCursor: 11 both scanLimited { - transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -185,7 +185,7 @@ module Test::M1 { # using the last element's cursor from the previous query # will yield an empty set, fixed on the last scannable tx { - transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -210,7 +210,7 @@ module Test::M1 { # trying to paginate on the `endCursor` even though hasNextPage is false # cursors are null, both page flags are false { - transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(first: 4 scanLimit: 3 after: "@{cursor_0}" filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/last.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/last.move index d6ee06795a67c..c78b67522f4bd 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/last.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/le_page/last.move @@ -83,7 +83,7 @@ module Test::M1 { //# run-graphql # startCursor: 10, endCursor: 11, both scan limited { - transactionBlocks(last: 3 scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -107,7 +107,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":10,"i":true} # startCursor: 8, endCursor: 9, both scan limited { - transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -132,7 +132,7 @@ module Test::M1 { # use result's cursor instead of boundary cursor # startCursor: 6, endCursor: 7, both scan limited { - transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -156,7 +156,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":6,"i":true} # startCursor: 4, endCursor: 5, both scan limited { - transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -180,7 +180,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":4,"i":false} # reached the end with this query { - transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage @@ -205,7 +205,7 @@ module Test::M1 { //# run-graphql --cursors {"c":4,"t":2,"i":true} # cursors are null, and page flags are both false { - transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {recvAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(last: 3 before: "@{cursor_0}" scanLimit: 2 filter: {affectedAddress: "@{A}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/require.move b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/require.move index 25b59d24aaff2..c7de79724e4a1 100644 --- a/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/require.move +++ b/crates/sui-graphql-e2e-tests/tests/stable/transactions/scan_limit/require.move @@ -55,7 +55,7 @@ module Test::M1 { //# run-graphql # Expect ten results { - transactionBlocks(filter: {recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(filter: {affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasNextPage hasPreviousPage @@ -76,7 +76,7 @@ module Test::M1 { //# run-graphql # Don't need scanLimit with sender { - transactionBlocks(filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { + transactionBlocks(filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4}) { pageInfo { hasNextPage hasPreviousPage @@ -97,7 +97,7 @@ module Test::M1 { //# run-graphql # scanLimit required { - transactionBlocks(filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 function: "@{Test}::M1::create"}) { + transactionBlocks(filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 function: "@{Test}::M1::create"}) { pageInfo { hasNextPage hasPreviousPage @@ -118,7 +118,7 @@ module Test::M1 { //# run-graphql # valid { - transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 function: "@{Test}::M1::create"}) { + transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 function: "@{Test}::M1::create"}) { pageInfo { hasNextPage hasPreviousPage @@ -139,7 +139,7 @@ module Test::M1 { //# run-graphql # scanLimit required { - transactionBlocks(filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 kind: PROGRAMMABLE_TX}) { + transactionBlocks(filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 kind: PROGRAMMABLE_TX}) { pageInfo { hasNextPage hasPreviousPage @@ -160,7 +160,7 @@ module Test::M1 { //# run-graphql # valid { - transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 kind: PROGRAMMABLE_TX}) { + transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 kind: PROGRAMMABLE_TX}) { pageInfo { hasNextPage hasPreviousPage @@ -181,7 +181,7 @@ module Test::M1 { //# run-graphql # scanLimit required { - transactionBlocks(filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 inputObject: "@{obj_3_0}"}) { + transactionBlocks(filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 inputObject: "@{obj_3_0}"}) { pageInfo { hasNextPage hasPreviousPage @@ -202,7 +202,7 @@ module Test::M1 { //# run-graphql # valid { - transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 inputObject: "@{obj_3_0}"}) { + transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 inputObject: "@{obj_3_0}"}) { pageInfo { hasNextPage hasPreviousPage @@ -224,7 +224,7 @@ module Test::M1 { //# run-graphql # scanLimit required { - transactionBlocks(filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 changedObject: "@{obj_3_0}"}) { + transactionBlocks(filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 changedObject: "@{obj_3_0}"}) { pageInfo { hasNextPage hasPreviousPage @@ -247,7 +247,7 @@ module Test::M1 { # Because scanLimit is specified, the boundary cursors should be at 2 and 11, # and both will indicate is_scan_limited { - transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" recvAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 changedObject: "@{obj_3_0}"}) { + transactionBlocks(scanLimit: 50 filter: {sentAddress: "@{A}" affectedAddress: "@{B}" afterCheckpoint: 1 beforeCheckpoint: 4 changedObject: "@{obj_3_0}"}) { pageInfo { hasPreviousPage hasNextPage diff --git a/crates/sui-graphql-rpc/examples/transaction_block_connection/recv_addr_filter.graphql b/crates/sui-graphql-rpc/examples/transaction_block_connection/affected_addr_filter.graphql similarity index 89% rename from crates/sui-graphql-rpc/examples/transaction_block_connection/recv_addr_filter.graphql rename to crates/sui-graphql-rpc/examples/transaction_block_connection/affected_addr_filter.graphql index 97c690e22651f..61e6de3dfc36b 100644 --- a/crates/sui-graphql-rpc/examples/transaction_block_connection/recv_addr_filter.graphql +++ b/crates/sui-graphql-rpc/examples/transaction_block_connection/affected_addr_filter.graphql @@ -1,4 +1,4 @@ -# Filter on recvAddress +# Filter on affected address { transactionBlocks( filter: { diff --git a/crates/sui-graphql-rpc/schema.graphql b/crates/sui-graphql-rpc/schema.graphql index 504e41f9bebd2..92330bc77ffa1 100644 --- a/crates/sui-graphql-rpc/schema.graphql +++ b/crates/sui-graphql-rpc/schema.graphql @@ -168,14 +168,6 @@ enum AddressTransactionBlockRelationship { """ SENT """ - Transactions that sent objects to this address. NOTE: this input filter has been deprecated - in favor of `AFFECTED`, which offers an easier to understand behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `AFFECTED` is introduced, whichever is later. - """ - RECV - """ Transactions that this address was involved in, either as the sender, sponsor, or as the owner of some object that was created, modified or transfered. """ @@ -4350,15 +4342,6 @@ input TransactionBlockFilter { """ sentAddress: SuiAddress """ - Limit to transactions that sent an object to the given address. NOTE: this input filter has - been deprecated in favor of `affectedAddress` which offers an easier to understand - behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `affectedAddress` is introduced, whichever is later. - """ - recvAddress: SuiAddress - """ Limit to transactions that accepted the given object as an input. NOTE: this input filter has been deprecated in favor of `affectedObject` which offers an easier to under behavior. diff --git a/crates/sui-graphql-rpc/src/types/address.rs b/crates/sui-graphql-rpc/src/types/address.rs index 817ad3ae34dcb..323a9138a2057 100644 --- a/crates/sui-graphql-rpc/src/types/address.rs +++ b/crates/sui-graphql-rpc/src/types/address.rs @@ -30,12 +30,6 @@ pub(crate) struct Address { pub(crate) enum AddressTransactionBlockRelationship { /// Transactions this address has sent. Sent, - /// Transactions that sent objects to this address. NOTE: this input filter has been deprecated - /// in favor of `AFFECTED`, which offers an easier to understand behavior. - /// - /// This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - /// `AFFECTED` is introduced, whichever is later. - Recv, /// Transactions that this address was involved in, either as the sender, sponsor, or as the /// owner of some object that was created, modified or transfered. Affected, @@ -184,11 +178,6 @@ impl Address { ..Default::default() }, - Some(R::Recv) => TransactionBlockFilter { - recv_address: Some(self.address), - ..Default::default() - }, - Some(R::Affected) => TransactionBlockFilter { affected_address: Some(self.address), ..Default::default() diff --git a/crates/sui-graphql-rpc/src/types/object.rs b/crates/sui-graphql-rpc/src/types/object.rs index 8a29e81b645dc..b7e538fc185a5 100644 --- a/crates/sui-graphql-rpc/src/types/object.rs +++ b/crates/sui-graphql-rpc/src/types/object.rs @@ -656,9 +656,6 @@ impl ObjectImpl<'_> { let Some(filter) = filter .unwrap_or_default() .intersect(TransactionBlockFilter { - #[cfg(not(feature = "staging"))] - recv_address: Some(self.0.address), - #[cfg(feature = "staging")] affected_address: Some(self.0.address), ..Default::default() }) diff --git a/crates/sui-graphql-rpc/src/types/transaction_block/filter.rs b/crates/sui-graphql-rpc/src/types/transaction_block/filter.rs index c1673b409e9f7..7af2c700a56d6 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block/filter.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block/filter.rs @@ -40,14 +40,6 @@ pub(crate) struct TransactionBlockFilter { /// Limit to transactions that were sent by the given address. pub sent_address: Option, - /// Limit to transactions that sent an object to the given address. NOTE: this input filter has - /// been deprecated in favor of `affectedAddress` which offers an easier to understand - /// behavior. - /// - /// This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - /// `affectedAddress` is introduced, whichever is later. - pub recv_address: Option, - /// Limit to transactions that accepted the given object as an input. NOTE: this input filter /// has been deprecated in favor of `affectedObject` which offers an easier to under behavior. /// @@ -90,7 +82,6 @@ impl TransactionBlockFilter { #[cfg(feature = "staging")] affected_object: intersect!(affected_object, intersect::by_eq)?, sent_address: intersect!(sent_address, intersect::by_eq)?, - recv_address: intersect!(recv_address, intersect::by_eq)?, input_object: intersect!(input_object, intersect::by_eq)?, changed_object: intersect!(changed_object, intersect::by_eq)?, @@ -112,7 +103,6 @@ impl TransactionBlockFilter { self.affected_address.is_some(), #[cfg(feature = "staging")] self.affected_object.is_some(), - self.recv_address.is_some(), self.input_object.is_some(), self.changed_object.is_some(), self.transaction_ids.is_some(), @@ -130,7 +120,6 @@ impl TransactionBlockFilter { let missing_implicit_sender = self.function.is_none() && self.kind.is_none() && self.affected_address.is_none() - && self.recv_address.is_none() && self.input_object.is_none() && self.changed_object.is_none(); @@ -148,7 +137,6 @@ impl TransactionBlockFilter { let has_filters = self.function.is_some() || self.kind.is_some() || self.sent_address.is_some() - || self.recv_address.is_some() || self.affected_address.is_some() || self.input_object.is_some() || self.changed_object.is_some() diff --git a/crates/sui-graphql-rpc/src/types/transaction_block/mod.rs b/crates/sui-graphql-rpc/src/types/transaction_block/mod.rs index b4cc44c2d20fa..7bef4cf389438 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block/mod.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block/mod.rs @@ -338,8 +338,8 @@ impl TransactionBlock { /// If the `Page` is set, then this function will defer to the `checkpoint_viewed_at` in /// the cursor if they are consistent. /// - /// Filters that involve a combination of `recvAddress`, `inputObject`, `changedObject`, and - /// `function` should provide a value for `scan_limit`. This modifies querying behavior by + /// Filters that involve a combination of `affectedAddress`, `inputObject`, `changedObject`, + /// and `function` should provide a value for `scan_limit`. This modifies querying behavior by /// limiting how many transactions to scan through before applying filters, and also affects /// pagination behavior. pub(crate) async fn paginate( diff --git a/crates/sui-graphql-rpc/src/types/transaction_block/tx_lookups.rs b/crates/sui-graphql-rpc/src/types/transaction_block/tx_lookups.rs index 2820dca115ca8..46941617a56bd 100644 --- a/crates/sui-graphql-rpc/src/types/transaction_block/tx_lookups.rs +++ b/crates/sui-graphql-rpc/src/types/transaction_block/tx_lookups.rs @@ -343,10 +343,6 @@ pub(crate) fn subqueries(filter: &TransactionBlockFilter, tx_bounds: TxBounds) - )); } - if let Some(recv) = &filter.recv_address { - subqueries.push(("tx_recipients", select_recipient(recv, sender, tx_bounds))); - } - if let Some(input) = &filter.input_object { subqueries.push(("tx_input_objects", select_input(input, sender, tx_bounds))); } @@ -490,13 +486,6 @@ fn select_affected_object( ) } -fn select_recipient(recv: &SuiAddress, sender: Option, bound: TxBounds) -> RawQuery { - filter!( - select_tx(sender, bound, "tx_recipients"), - format!("recipient = {}", bytea_literal(recv.as_slice())) - ) -} - fn select_input(input: &SuiAddress, sender: Option, bound: TxBounds) -> RawQuery { filter!( select_tx(sender, bound, "tx_input_objects"), diff --git a/crates/sui-graphql-rpc/staging.graphql b/crates/sui-graphql-rpc/staging.graphql index f293d31e3433c..d37152f34e1bb 100644 --- a/crates/sui-graphql-rpc/staging.graphql +++ b/crates/sui-graphql-rpc/staging.graphql @@ -168,14 +168,6 @@ enum AddressTransactionBlockRelationship { """ SENT """ - Transactions that sent objects to this address. NOTE: this input filter has been deprecated - in favor of `AFFECTED`, which offers an easier to understand behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `AFFECTED` is introduced, whichever is later. - """ - RECV - """ Transactions that this address was involved in, either as the sender, sponsor, or as the owner of some object that was created, modified or transfered. """ @@ -4357,15 +4349,6 @@ input TransactionBlockFilter { """ sentAddress: SuiAddress """ - Limit to transactions that sent an object to the given address. NOTE: this input filter has - been deprecated in favor of `affectedAddress` which offers an easier to understand - behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `affectedAddress` is introduced, whichever is later. - """ - recvAddress: SuiAddress - """ Limit to transactions that accepted the given object as an input. NOTE: this input filter has been deprecated in favor of `affectedObject` which offers an easier to under behavior. diff --git a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema.graphql.snap b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema.graphql.snap index babda5f3d986a..70071a6173061 100644 --- a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema.graphql.snap +++ b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__schema.graphql.snap @@ -172,14 +172,6 @@ enum AddressTransactionBlockRelationship { """ SENT """ - Transactions that sent objects to this address. NOTE: this input filter has been deprecated - in favor of `AFFECTED`, which offers an easier to understand behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `AFFECTED` is introduced, whichever is later. - """ - RECV - """ Transactions that this address was involved in, either as the sender, sponsor, or as the owner of some object that was created, modified or transfered. """ @@ -4354,15 +4346,6 @@ input TransactionBlockFilter { """ sentAddress: SuiAddress """ - Limit to transactions that sent an object to the given address. NOTE: this input filter has - been deprecated in favor of `affectedAddress` which offers an easier to understand - behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `affectedAddress` is introduced, whichever is later. - """ - recvAddress: SuiAddress - """ Limit to transactions that accepted the given object as an input. NOTE: this input filter has been deprecated in favor of `affectedObject` which offers an easier to under behavior. diff --git a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__staging.graphql.snap b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__staging.graphql.snap index 84c7e722592f5..498feb7c2fafb 100644 --- a/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__staging.graphql.snap +++ b/crates/sui-graphql-rpc/tests/snapshots/snapshot_tests__staging.graphql.snap @@ -172,14 +172,6 @@ enum AddressTransactionBlockRelationship { """ SENT """ - Transactions that sent objects to this address. NOTE: this input filter has been deprecated - in favor of `AFFECTED`, which offers an easier to understand behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `AFFECTED` is introduced, whichever is later. - """ - RECV - """ Transactions that this address was involved in, either as the sender, sponsor, or as the owner of some object that was created, modified or transfered. """ @@ -4361,15 +4353,6 @@ input TransactionBlockFilter { """ sentAddress: SuiAddress """ - Limit to transactions that sent an object to the given address. NOTE: this input filter has - been deprecated in favor of `affectedAddress` which offers an easier to understand - behavior. - - This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - `affectedAddress` is introduced, whichever is later. - """ - recvAddress: SuiAddress - """ Limit to transactions that accepted the given object as an input. NOTE: this input filter has been deprecated in favor of `affectedObject` which offers an easier to under behavior. diff --git a/sdk/graphql-transport/src/generated/queries.ts b/sdk/graphql-transport/src/generated/queries.ts index da8cbc18f890b..dc0be45904337 100644 --- a/sdk/graphql-transport/src/generated/queries.ts +++ b/sdk/graphql-transport/src/generated/queries.ts @@ -313,13 +313,10 @@ export type AddressOwner = { /** The possible relationship types for a transaction block: sent, or received. */ export enum AddressTransactionBlockRelationship { /** - * Transactions that sent objects to this address. NOTE: this input filter has been deprecated - * in favor of `AFFECTED`, which offers an easier to understand behavior. - * - * This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - * `AFFECTED` is introduced, whichever is later. + * Transactions that this address was involved in, either as the sender, sponsor, or as the + * owner of some object that was created, modified or transfered. */ - Recv = 'RECV', + Affected = 'AFFECTED', /** Transactions this address has sent. */ Sent = 'SENT' } @@ -1423,6 +1420,12 @@ export type Event = { sendingModule?: Maybe; /** UTC timestamp in milliseconds since epoch (1/1/1970) */ timestamp?: Maybe; + /** + * The transaction block that emitted this event. This information is only available for + * events from indexed transactions, and not from transactions that have just been executed or + * dry-run. + */ + transactionBlock?: Maybe; }; export type EventConnection = { @@ -4947,6 +4950,11 @@ export type TransactionBlockEffectsUnchangedSharedObjectsArgs = { }; export type TransactionBlockFilter = { + /** + * Limit to transactions that interacted with the given address. The address could be a + * sender, sponsor, or recipient of the transaction. + */ + affectedAddress?: InputMaybe; /** Limit to transactions that occured strictly after the given checkpoint. */ afterCheckpoint?: InputMaybe; /** Limit to transactions in the given checkpoint. */ @@ -4976,15 +4984,6 @@ export type TransactionBlockFilter = { inputObject?: InputMaybe; /** An input filter selecting for either system or programmable transactions. */ kind?: InputMaybe; - /** - * Limit to transactions that sent an object to the given address. NOTE: this input filter has - * been deprecated in favor of `affectedAddress` which offers an easier to understand - * behavior. - * - * This filter will be removed with 1.36.0 (2024-10-14), or at least one release after - * `affectedAddress` is introduced, whichever is later. - */ - recvAddress?: InputMaybe; /** Limit to transactions that were sent by the given address. */ sentAddress?: InputMaybe; /** Select transactions by their digest. */ diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index 0e74fe968260a..982940aeaefe5 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -623,7 +623,7 @@ export const RPC_METHODS: { inputObject: 'InputObject' in filter ? filter.InputObject : undefined, changedObject: 'ChangedObject' in filter ? filter.ChangedObject : undefined, sentAddress: 'FromAddress' in filter ? filter.FromAddress : undefined, - recvAddress: 'ToAddress' in filter ? filter.ToAddress : undefined, + affectedAddress: 'ToAddress' in filter ? filter.ToAddress : undefined, kind: 'TransactionKind' in filter ? filter.TransactionKind === 'ProgrammableTransaction'