-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review iota-graphql test coverage (#4135)
* documentation: review iota-graphql test coverage * documentation: reference the transactional test runner * fix: refer tests.rs module * fix: coverage for dynamic queries * fix: coverage for filter options WIP * fix: restructure coverage * docs: Add missing queries * fix: location paths * fix: format * fix: add missing filter options * fix: remove link * fix: graphql highlights
- Loading branch information
1 parent
1dd90ac
commit 64bca64
Showing
24 changed files
with
2,574 additions
and
0 deletions.
There are no files selected for viewing
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
118 changes: 118 additions & 0 deletions
118
crates/iota-graphql-e2e-tests/coverage/mutation/executeTransactionBlock.md
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,118 @@ | ||
Query: `executeTransactionBlock` | ||
|
||
```graphql | ||
mutation { | ||
executeTransactionBlock(txBytes: $tx, signatures: $sigs) { | ||
effects { | ||
transactionBlock { | ||
digest | ||
} | ||
status | ||
lamportVersion | ||
errors | ||
dependencies { | ||
edges { | ||
node { | ||
digest | ||
bcs | ||
} | ||
} | ||
} | ||
gasEffects { | ||
__typename | ||
gasObject { | ||
digest | ||
storageRebate | ||
bcs | ||
} | ||
gasSummary { | ||
computationCost | ||
computationCostBurned | ||
storageCost | ||
storageRebate | ||
nonRefundableStorageFee | ||
} | ||
} | ||
unchangedSharedObjects { | ||
edges { | ||
node { | ||
__typename | ||
} | ||
} | ||
} | ||
objectChanges { | ||
edges { | ||
node { | ||
idCreated | ||
idDeleted | ||
} | ||
} | ||
} | ||
balanceChanges { | ||
edges { | ||
node { | ||
amount | ||
} | ||
} | ||
} | ||
events { | ||
edges { | ||
node { | ||
timestamp | ||
} | ||
} | ||
} | ||
timestamp | ||
epoch { | ||
referenceGasPrice | ||
endTimestamp | ||
totalCheckpoints | ||
totalTransactions | ||
totalGasFees | ||
totalStakeRewards | ||
fundSize | ||
netInflow | ||
fundInflow | ||
fundOutflow | ||
systemStateVersion | ||
iotaTotalSupply | ||
iotaTreasuryCapId | ||
liveObjectSetDigest | ||
} | ||
checkpoint { | ||
previousCheckpointDigest | ||
networkTotalTransactions | ||
} | ||
bcs | ||
} | ||
errors | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-rpc/tests/e2e_tests.rs](../../../iota-graphql-rpc/tests/e2e_tests.rs): | ||
|
||
```graphql | ||
{ | ||
executeTransactionBlock(txBytes: $tx, signatures: $sigs) { | ||
effects { | ||
transactionBlock { | ||
digest | ||
} | ||
} | ||
errors | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-rpc/tests/e2e_tests.rs](../../../iota-graphql-rpc/tests/e2e_tests.rs): | ||
|
||
```graphql | ||
mutation { | ||
executeTransactionBlock(txBytes: "{}", signatures: "{}") { | ||
effects { | ||
status | ||
} | ||
} | ||
} | ||
``` |
191 changes: 191 additions & 0 deletions
191
crates/iota-graphql-e2e-tests/coverage/query/address.md
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,191 @@ | ||
Query: `address` | ||
|
||
```graphql | ||
{ | ||
address(address: "0x1") { | ||
address | ||
objects { | ||
edges { | ||
node { | ||
digest | ||
storageRebate | ||
bcs | ||
} | ||
} | ||
} | ||
balance { | ||
coinObjectCount | ||
totalBalance | ||
} | ||
balances { | ||
edges { | ||
node { | ||
coinObjectCount | ||
totalBalance | ||
} | ||
} | ||
} | ||
coins { | ||
edges { | ||
node { | ||
digest | ||
storageRebate | ||
bcs | ||
coinBalance | ||
} | ||
} | ||
} | ||
stakedIotas { | ||
edges { | ||
node { | ||
digest | ||
storageRebate | ||
bcs | ||
poolId | ||
principal | ||
estimatedReward | ||
} | ||
} | ||
} | ||
transactionBlocks { | ||
edges { | ||
node { | ||
digest | ||
bcs | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/call/owned_objects.move](../../../iota-graphql-e2e-tests/tests/call/owned_objects.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
address(address: "0x42") { | ||
objects { | ||
edges { | ||
node { | ||
owner { | ||
__typename | ||
... on AddressOwner { | ||
owner { | ||
address | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move](../../../iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
address(address: "@{C}") { | ||
transactionBlocks(last: 1) { | ||
nodes { | ||
effects { | ||
balanceChanges { | ||
pageInfo { | ||
hasPreviousPage | ||
hasNextPage | ||
startCursor | ||
endCursor | ||
} | ||
edges { | ||
node { | ||
amount | ||
} | ||
cursor | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/consistency/coins.move](../../../iota-graphql-e2e-tests/tests/consistency/coins.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
queryCoins: coins(type: "@{P0}::fake::FAKE") { | ||
edges { | ||
cursor | ||
node { | ||
owner { | ||
... on AddressOwner { | ||
owner { | ||
address | ||
coins(type: "@{P0}::fake::FAKE") { | ||
edges { | ||
cursor | ||
node { | ||
contents { | ||
json | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
contents { | ||
json | ||
} | ||
} | ||
} | ||
} | ||
addressCoinsA: address(address: "@{A}") { | ||
coins(type: "@{P0}::fake::FAKE") { | ||
edges { | ||
cursor | ||
node { | ||
contents { | ||
json | ||
} | ||
} | ||
} | ||
} | ||
} | ||
addressCoinsB: address(address: "@{B}") { | ||
coins(type: "@{P0}::fake::FAKE") { | ||
edges { | ||
cursor | ||
node { | ||
contents { | ||
json | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/consistency/staked_iota.move](../../../iota-graphql-e2e-tests/tests/consistency/staked_iota.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
address(address: "@{C}") { | ||
stakedIotas { | ||
edges { | ||
cursor | ||
node { | ||
principal | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` |
43 changes: 43 additions & 0 deletions
43
crates/iota-graphql-e2e-tests/coverage/query/availableRange.md
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,43 @@ | ||
Query: `availableRange` | ||
|
||
```graphql | ||
{ | ||
availableRange { | ||
first { | ||
digest | ||
} | ||
last { | ||
digest | ||
} | ||
} | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/available_range/available_range.move](../../../iota-graphql-e2e-tests/tests/available_range/available_range.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
availableRange { | ||
first { | ||
digest | ||
sequenceNumber | ||
} | ||
last { | ||
digest | ||
sequenceNumber | ||
} | ||
} | ||
|
||
first: checkpoint(id: { sequenceNumber: 0 } ) { | ||
digest | ||
sequenceNumber | ||
} | ||
|
||
last: checkpoint { | ||
digest | ||
sequenceNumber | ||
} | ||
} | ||
``` | ||
|
16 changes: 16 additions & 0 deletions
16
crates/iota-graphql-e2e-tests/coverage/query/chainIdentifier.md
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,16 @@ | ||
Query: `chainIdentifier` | ||
|
||
```graphql | ||
{ | ||
chainIdentifier | ||
} | ||
``` | ||
|
||
tested by [crates/iota-graphql-e2e-tests/tests/epoch/chain_identifier.move](../../../iota-graphql-e2e-tests/tests/epoch/chain_identifier.move): | ||
|
||
```graphql | ||
//# run-graphql | ||
{ | ||
chainIdentifier | ||
} | ||
``` |
Oops, something went wrong.