From 2269f19471b7c4cbcbb4e46e71d6dca14c841668 Mon Sep 17 00:00:00 2001 From: Sandipan Dey Date: Thu, 16 Nov 2023 12:55:15 +0530 Subject: [PATCH] fix: pending incoming stuff --- bats/core/api/onchain-receive.bats | 26 +++++++++---------- ...ding-incoming-transactions-by-address.gql} | 4 +-- ....gql => pending-incoming-transactions.gql} | 4 +-- 3 files changed, 17 insertions(+), 17 deletions(-) rename bats/gql/{pending-transactions-by-address.gql => pending-incoming-transactions-by-address.gql} (89%) rename bats/gql/{pending-transactions.gql => pending-incoming-transactions.gql} (93%) diff --git a/bats/core/api/onchain-receive.bats b/bats/core/api/onchain-receive.bats index 42d6fd9b827..633ae81eb64 100644 --- a/bats/core/api/onchain-receive.bats +++ b/bats/core/api/onchain-receive.bats @@ -83,12 +83,12 @@ setup_file() { --arg address "$on_chain_address_created_1" \ '{"address": $address}' ) - exec_graphql 'alice' 'pending-transactions-by-address' "$address_1_pending_txns_variables" + exec_graphql 'alice' 'pending-incoming-transactions-by-address' "$address_1_pending_txns_variables" pending_txns_for_address_1=$( graphql_output ' .data.me.defaultAccount.wallets[] | select(.__typename == "BTCWallet") - .pendingTransactionsByAddress' + .pendingIncomingTransactionsByAddress' ) pending_txns_for_address_1_length="$(echo $pending_txns_for_address_1 | jq -r 'length')" [[ "$pending_txns_for_address_1_length" == "1" ]] || exit 1 @@ -101,12 +101,12 @@ setup_file() { --arg address "$on_chain_address_created_2" \ '{"address": $address}' ) - exec_graphql 'alice' 'pending-transactions-by-address' "$address_2_pending_txns_variables" + exec_graphql 'alice' 'pending-incoming-transactions-by-address' "$address_2_pending_txns_variables" pending_txns_for_address_2=$( graphql_output ' .data.me.defaultAccount.wallets[] | select(.__typename == "BTCWallet") - .pendingTransactionsByAddress' + .pendingIncomingTransactionsByAddress' ) pending_txns_for_address_2_length="$(echo $pending_txns_for_address_2 | jq -r 'length')" [[ "$pending_txns_for_address_2_length" == "1" ]] || exit 1 @@ -114,10 +114,10 @@ setup_file() { [[ "$address_2_from_pending_txns" == "$on_chain_address_created_2" ]] # Check pending transactions for account - exec_graphql 'alice' 'pending-transactions' + exec_graphql 'alice' 'pending-incoming-transactions' pending_txns_for_account=$( graphql_output ' - .data.me.defaultAccount.pendingTransactions' + .data.me.defaultAccount.pendingIncomingTransactions' ) pending_txns_for_account_length="$(echo $pending_txns_for_account | jq -r 'length')" [[ "$pending_txns_for_account_length" == "2" ]] || exit 1 @@ -169,7 +169,7 @@ setup_file() { exec_graphql 'alice' 'pending-transactions' pending_txns_for_account=$( graphql_output ' - .data.me.defaultAccount.pendingTransactions' + .data.me.defaultAccount.pendingIncomingTransactions' ) pending_txns_for_account_length="$(echo $pending_txns_for_account | jq -r 'length')" [[ "$pending_txns_for_account_length" == "0" ]] || exit 1 @@ -232,12 +232,12 @@ setup_file() { --arg address "$on_chain_address_created" \ '{"address": $address}' ) - exec_graphql 'alice' 'pending-transactions-by-address' "$address_pending_txns_variables" + exec_graphql 'alice' 'pending-incoming-transactions-by-address' "$address_pending_txns_variables" pending_txns_for_address=$( graphql_output ' .data.me.defaultAccount.wallets[] | select(.__typename == "UsdWallet") - .pendingTransactionsByAddress' + .pendingIncomingTransactionsByAddress' ) pending_txns_for_address_length="$(echo $pending_txns_for_address | jq -r 'length')" [[ "$pending_txns_for_address_length" == "1" ]] || exit 1 @@ -245,10 +245,10 @@ setup_file() { [[ "$address_from_pending_txns" == "$on_chain_address_created" ]] # Check pending transactions for account - exec_graphql 'alice' 'pending-transactions' + exec_graphql 'alice' 'pending-incoming-transactions' pending_txns_for_account=$( graphql_output ' - .data.me.defaultAccount.pendingTransactions' + .data.me.defaultAccount.pendingIncomingTransactions' ) pending_txns_for_account_length="$(echo $pending_txns_for_account | jq -r 'length')" [[ "$pending_txns_for_account_length" == "1" ]] || exit 1 @@ -257,10 +257,10 @@ setup_file() { retry 15 1 check_for_onchain_initiated_settled 'alice' "$on_chain_address_created" 1 # Ensure no pending transactions for account - exec_graphql 'alice' 'pending-transactions' + exec_graphql 'alice' 'pending-incoming-transactions' pending_txns_for_account=$( graphql_output ' - .data.me.defaultAccount.pendingTransactions' + .data.me.defaultAccount.pendingIncomingTransactions' ) pending_txns_for_account_length="$(echo $pending_txns_for_account | jq -r 'length')" [[ "$pending_txns_for_account_length" == "0" ]] || exit 1 diff --git a/bats/gql/pending-transactions-by-address.gql b/bats/gql/pending-incoming-transactions-by-address.gql similarity index 89% rename from bats/gql/pending-transactions-by-address.gql rename to bats/gql/pending-incoming-transactions-by-address.gql index a31fa42a2a7..942f9503a4f 100644 --- a/bats/gql/pending-transactions-by-address.gql +++ b/bats/gql/pending-incoming-transactions-by-address.gql @@ -1,4 +1,4 @@ -query pendingTransactionsByAddress($address: OnChainAddress!) { +query pendingIncomingTransactionsByAddress($address: OnChainAddress!) { me { defaultAccount { displayCurrency @@ -6,7 +6,7 @@ query pendingTransactionsByAddress($address: OnChainAddress!) { __typename id walletCurrency - pendingTransactionsByAddress(address: $address) { + pendingIncomingTransactionsByAddress(address: $address) { __typename id status diff --git a/bats/gql/pending-transactions.gql b/bats/gql/pending-incoming-transactions.gql similarity index 93% rename from bats/gql/pending-transactions.gql rename to bats/gql/pending-incoming-transactions.gql index bc26c2985a4..9e7dde50fb1 100644 --- a/bats/gql/pending-transactions.gql +++ b/bats/gql/pending-incoming-transactions.gql @@ -1,8 +1,8 @@ -query pendingTransactions { +query pendingIncomingTransactions { me { defaultAccount { displayCurrency - pendingTransactions { + pendingIncomingTransactions { __typename id status