-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql)!: deprecate tx signer filters (#19430)
## Description `TransactionBlockFilter.signAddress` and `AddressTransactionBlockFilter.SIGN` both claim to support filtering by sender and sponsor, but this is not true, they only support sender, and they should not be adapted to also filter by sponsor because we rely on the there being only one sender per transaction to ensure filters that combine sender with something else remain both space and time efficient. ## Test plan Existing tests and CI, plus some new tests to make sure the new filter options work, and interactions between the old and new filters work. ``` sui$ cargo nextest run -p sui-graphql-rpc sui$ cargo nextest run -p sui-graphql-e2e-tests ``` --- ## 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: Deprecates `TransactionBlockFilter.signAddress`, replacing it with `TransactionBlockFilter.sentAddress` which behaves identically. Similarly `AddressTransactionBlockRelationship.SIGN` is deprecated and replaced by `AddressTransactionBlockRelationship.SENT`. - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
Showing
11 changed files
with
545 additions
and
28 deletions.
There are no files selected for viewing
345 changes: 345 additions & 0 deletions
345
crates/sui-graphql-e2e-tests/tests/stable/transactions/filters/sent.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,345 @@ | ||
processed 5 tasks | ||
|
||
init: | ||
A: object(0,0), B: object(0,1) | ||
|
||
task 1, lines 9-11: | ||
//# programmable --sender A --inputs 1000000 @B | ||
//> SplitCoins(Gas, [Input(0)]); | ||
//> TransferObjects([Result(0)], Input(1)) | ||
created: object(1,0) | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2, lines 13-15: | ||
//# programmable --sender B --inputs 2000000 @A | ||
//> SplitCoins(Gas, [Input(0)]); | ||
//> TransferObjects([Result(0)], Input(1)) | ||
created: object(2,0) | ||
mutated: object(0,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 3, line 17: | ||
//# create-checkpoint | ||
Checkpoint created: 1 | ||
|
||
task 4, lines 19-87: | ||
//# run-graphql | ||
Response: { | ||
"data": { | ||
"bySentAddress": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"bySignAddress": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"bothAddresses": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"differentAddresses": { | ||
"nodes": [] | ||
}, | ||
"compoundBySentAddress": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"compoundBySignAddress": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"compoundBothAddresses": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"compoundDifferentAddresses": { | ||
"nodes": [] | ||
}, | ||
"sentViaAddress": { | ||
"transactionBlocks": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"signViaAddress": { | ||
"transactionBlocks": { | ||
"nodes": [ | ||
{ | ||
"effects": { | ||
"objectChanges": { | ||
"nodes": [ | ||
{ | ||
"inputState": null, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "1000000" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"inputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "300000000000000" | ||
} | ||
} | ||
}, | ||
"outputState": { | ||
"asMoveObject": { | ||
"asCoin": { | ||
"coinBalance": "299999996024000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.