diff --git a/integration/testConfig.ts b/integration/testConfig.ts index e0ee9fc..b27a214 100644 --- a/integration/testConfig.ts +++ b/integration/testConfig.ts @@ -3,12 +3,12 @@ import type { NativeEtherlinkToken, NativeTezosToken, ERC20EtherlinkToken, FA12T export interface TestTokens { readonly tezos: { tez: NativeTezosToken; - ctez: FA12TezosToken; + tzbtc: FA12TezosToken; usdt: FA2TezosToken; }; readonly etherlink: { tez: NativeEtherlinkToken - ctez: ERC20EtherlinkToken; + tzbtc: ERC20EtherlinkToken; usdt: ERC20EtherlinkToken; }; } @@ -62,27 +62,27 @@ const createTestTokens = (): TestTokens => { tez: { type: 'native' }, - ctez: { + tzbtc: { type: 'fa1.2', - address: 'KT1LpdETWYvPWCQTR2FEW6jE6dVqJqxYjdeW' + address: 'KT1Vq1toL9mQquJhCvVRbbcC8PbZJWM4bPui' }, usdt: { type: 'fa2', - address: 'KT195Eb8T524v5VJ99ZzH2wpnPfQ2wJfMi6h', - tokenId: '42' + address: 'KT1K6uyg7cjNRoPkYw6SfyCm1f2tPLHfVUez', + tokenId: '0' } }, etherlink: { tez: { type: 'native' }, - ctez: { + tzbtc: { type: 'erc20', address: '0x87dcBf128677ba36E79D47dAf4eb4e51610e0150' }, usdt: { type: 'erc20', - address: '0xcB5d40c6B1bdf5Cd51b3801351b0A68D101a561b' + address: '0x8554cD57C0C3E5Ab9d1782c9063279fA9bFA4680' } } }; diff --git a/integration/testHelpers.ts b/integration/testHelpers.ts index b5bfa65..9440a55 100644 --- a/integration/testHelpers.ts +++ b/integration/testHelpers.ts @@ -47,7 +47,7 @@ export const createTestTokenBridge = ({ testConfig, tezosToolkit, etherlinkToolk { tezos: { ...testConfig.tokens.tezos.tez, - ticketHelperContractAddress: 'KT1DWVsu4Jtu2ficZ1qtNheGPunm5YVniegT' + ticketHelperContractAddress: 'KT1MJxf4KVN3sosR99VRG7WBbWTJtAyWUJt9' }, etherlink: { ...testConfig.tokens.etherlink.tez, @@ -55,19 +55,19 @@ export const createTestTokenBridge = ({ testConfig, tezosToolkit, etherlinkToolk }, { tezos: { - ...testConfig.tokens.tezos.ctez, - ticketerContractAddress: 'KT1RvSp4yDKUABqWmv3pKGE9fA6iCGy7bqGh', - ticketHelperContractAddress: 'KT1DHLWJorW9WB6ztkx1XcoaJKWXeTu9yoR1' + ...testConfig.tokens.tezos.tzbtc, + ticketerContractAddress: 'KT1AAi4DCQiTUv5MYoXtdiFwUrPH3t3Yhkjo', + ticketHelperContractAddress: 'KT1FcXb4oFBWtUVbEa96Do4DfQZXn6878yu1' }, etherlink: { - ...testConfig.tokens.etherlink.ctez + ...testConfig.tokens.etherlink.tzbtc } }, { tezos: { ...testConfig.tokens.tezos.usdt, - ticketerContractAddress: 'KT1VybveLaWhpQHKph28WcGwSy1ud22KSEan', - ticketHelperContractAddress: 'KT1DNtHLr9T9zksZjZvQwgtx5XJwrW9wzETB' + ticketerContractAddress: 'KT1JT3T9jodxKchWEcwMtHzKTcM5pKD4phFp', + ticketHelperContractAddress: 'KT1G4athp6hNRmy65MdM1stv3bXXh82NEvCH' }, etherlink: { ...testConfig.tokens.etherlink.usdt @@ -194,7 +194,7 @@ export const expectFinishedDeposit = ( etherlinkOperation: { blockId: expect.any(Number), hash: expect.stringMatching(etherlinkOperationRegex), - logIndex: expect.any(Number), + logIndex: params.etherlinkToken.type === 'native' ? null : expect.any(Number), amount: params.outAmount, token: params.etherlinkToken, timestamp: expect.any(String), diff --git a/integration/tests/balances.test.ts b/integration/tests/balances.test.ts index 8eed43b..034c057 100644 --- a/integration/tests/balances.test.ts +++ b/integration/tests/balances.test.ts @@ -40,10 +40,10 @@ describe('Balances', () => { test.each([ () => [testTezosAccountAddress, tokens.tezos.tez] as const, - () => [testTezosAccountAddress, tokens.tezos.ctez] as const, + () => [testTezosAccountAddress, tokens.tezos.tzbtc] as const, () => [testTezosAccountAddress, tokens.tezos.usdt] as const, () => [testEtherlinkAccountAddress, tokens.etherlink.tez] as const, - () => [testEtherlinkAccountAddress, tokens.etherlink.ctez] as const, + () => [testEtherlinkAccountAddress, tokens.etherlink.tzbtc] as const, () => [testEtherlinkAccountAddress, tokens.etherlink.usdt] as const, ])('Get the balance for a specific address and token: %#', async getTestData => { const [address, token] = getTestData(); @@ -59,30 +59,30 @@ describe('Balances', () => { test.each([ () => [testTezosAccountAddress, [tokens.tezos.tez], [tokens.tezos.tez]] as const, - () => [testTezosAccountAddress, [tokens.tezos.ctez], [tokens.tezos.ctez]] as const, - () => [testTezosAccountAddress, [tokens.tezos.ctez, tokens.tezos.usdt], [tokens.tezos.ctez, tokens.tezos.usdt]] as const, + () => [testTezosAccountAddress, [tokens.tezos.tzbtc], [tokens.tezos.tzbtc]] as const, + () => [testTezosAccountAddress, [tokens.tezos.tzbtc, tokens.tezos.usdt], [tokens.tezos.tzbtc, tokens.tezos.usdt]] as const, () => [ testTezosAccountAddress, - [tokens.tezos.ctez, tokens.tezos.tez, tokens.tezos.usdt], - [tokens.tezos.tez, tokens.tezos.ctez, tokens.tezos.usdt] + [tokens.tezos.tzbtc, tokens.tezos.tez, tokens.tezos.usdt], + [tokens.tezos.tez, tokens.tezos.tzbtc, tokens.tezos.usdt] ] as const, () => [ testTezosAccountAddress, - [tokens.tezos.ctez, tokens.etherlink.ctez, tokens.tezos.tez, tokens.tezos.usdt], - [tokens.tezos.ctez, tokens.tezos.tez, tokens.tezos.usdt] + [tokens.tezos.tzbtc, tokens.etherlink.tzbtc, tokens.tezos.tez, tokens.tezos.usdt], + [tokens.tezos.tzbtc, tokens.tezos.tez, tokens.tezos.usdt] ] as const, () => [ testTezosAccountAddress, - [tokens.tezos.ctez, tokens.etherlink.ctez, tokens.tezos.tez, tokens.etherlink.tez, tokens.tezos.usdt], - [tokens.tezos.ctez, tokens.tezos.tez, tokens.tezos.usdt] + [tokens.tezos.tzbtc, tokens.etherlink.tzbtc, tokens.tezos.tez, tokens.etherlink.tez, tokens.tezos.usdt], + [tokens.tezos.tzbtc, tokens.tezos.tez, tokens.tezos.usdt] ] as const, () => [testEtherlinkAccountAddress, [tokens.etherlink.tez], [tokens.etherlink.tez]] as const, - () => [testEtherlinkAccountAddress, [tokens.etherlink.ctez], [tokens.etherlink.ctez],] as const, - () => [testEtherlinkAccountAddress, [tokens.etherlink.ctez, tokens.etherlink.usdt], [tokens.etherlink.ctez, tokens.etherlink.usdt]] as const, + () => [testEtherlinkAccountAddress, [tokens.etherlink.tzbtc], [tokens.etherlink.tzbtc]] as const, + () => [testEtherlinkAccountAddress, [tokens.etherlink.tzbtc, tokens.etherlink.usdt], [tokens.etherlink.tzbtc, tokens.etherlink.usdt]] as const, () => [ testEtherlinkAccountAddress, - [tokens.etherlink.ctez, tokens.tezos.ctez, tokens.tezos.tez, tokens.etherlink.usdt], - [tokens.etherlink.ctez, tokens.etherlink.tez, tokens.etherlink.usdt] + [tokens.etherlink.tzbtc, tokens.tezos.tzbtc, tokens.tezos.tez, tokens.etherlink.usdt], + [tokens.etherlink.tzbtc, tokens.etherlink.tez, tokens.etherlink.usdt] ] as const, ])('Get the balance for a specific address and tokens: %#', async getTestData => { const [address, tokens, expectedTokens] = getTestData(); @@ -113,7 +113,7 @@ describe('Balances', () => { balance: expect.any(BigInt) }, { - token: tokens.tezos.ctez, + token: tokens.tezos.tzbtc, balance: expect.any(BigInt) }, { @@ -137,7 +137,7 @@ describe('Balances', () => { balance: expect.any(BigInt) }, { - token: tokens.etherlink.ctez, + token: tokens.etherlink.tzbtc, balance: expect.any(BigInt) }, { diff --git a/integration/tests/deposit.test.ts b/integration/tests/deposit.test.ts index 4c34008..e092978 100644 --- a/integration/tests/deposit.test.ts +++ b/integration/tests/deposit.test.ts @@ -75,8 +75,8 @@ describe('Deposit', () => { }); test('Deposit FA1.2 token', async () => { - const amount = 7n; - const [tezosToken, etherlinkToken] = [tokens.tezos.ctez, tokens.etherlink.ctez]; + const amount = 7_000_000n; + const [tezosToken, etherlinkToken] = [tokens.tezos.tzbtc, tokens.etherlink.tzbtc]; const depositResult = await tokenBridge.deposit(amount, tezosToken); expectPendingDeposit(depositResult.tokenTransfer, { @@ -102,7 +102,7 @@ describe('Deposit', () => { }); test('Deposit FA2 token', async () => { - const amount = 20n; + const amount = 20_000_000n; const [tezosToken, etherlinkToken] = [tokens.tezos.usdt, tokens.etherlink.usdt]; const depositResult = await tokenBridge.deposit(amount, tezosToken); @@ -129,8 +129,8 @@ describe('Deposit', () => { }); test('Deposit FA1.2 token, check the transfer status using events (subscribeToTokenTransfer)', done => { - const amount = 5n; - const [tezosToken, etherlinkToken] = [tokens.tezos.ctez, tokens.etherlink.ctez]; + const amount = 5_000_000n; + const [tezosToken, etherlinkToken] = [tokens.tezos.tzbtc, tokens.etherlink.tzbtc]; let readyForDone = false; tokenBridge.addEventListener('tokenTransferCreated', tokenTransfer => { @@ -174,8 +174,8 @@ describe('Deposit', () => { }); test('Deposit FA1.2 token, check the transfer status using events (subscribeToAccountTransfers)', done => { - const amount = 5n; - const [tezosToken, etherlinkToken] = [tokens.tezos.ctez, tokens.etherlink.ctez]; + const amount = 5_000_000n; + const [tezosToken, etherlinkToken] = [tokens.tezos.tzbtc, tokens.etherlink.tzbtc]; let readyForDone = false; let tokenTransferOperationHash: string | undefined; diff --git a/integration/tests/withdrawal.test.ts b/integration/tests/withdrawal.test.ts index 357682a..003135f 100644 --- a/integration/tests/withdrawal.test.ts +++ b/integration/tests/withdrawal.test.ts @@ -47,8 +47,8 @@ describe('Withdrawal', () => { }); test('Withdraw FA1.2 token', async () => { - const amount = 17n; - const [tezosToken, etherlinkToken] = [tokens.tezos.ctez, tokens.etherlink.ctez]; + const amount = 1_700_000n; + const [tezosToken, etherlinkToken] = [tokens.tezos.tzbtc, tokens.etherlink.tzbtc]; const startWithdrawResult = await tokenBridge.startWithdraw(amount, etherlinkToken); expectPendingWithdrawal(startWithdrawResult.tokenTransfer, { @@ -96,7 +96,7 @@ describe('Withdrawal', () => { }, withdrawalTimeout); test('Withdraw FA2 token', async () => { - const amount = 20n; + const amount = 20_000_000n; const [tezosToken, etherlinkToken] = [tokens.tezos.usdt, tokens.etherlink.usdt]; const startWithdrawResult = await tokenBridge.startWithdraw(amount, etherlinkToken); @@ -144,9 +144,9 @@ describe('Withdrawal', () => { }); }, withdrawalTimeout); - test('Withdraw FA1.2 token, check the transfer status using events (subscribeToTokenTransfer)', done => { - const amount = 3n; - const [tezosToken, etherlinkToken] = [tokens.tezos.ctez, tokens.etherlink.ctez]; + test.skip('Withdraw FA1.2 token, check the transfer status using events (subscribeToTokenTransfer)', done => { + const amount = 3_000_000n; + const [tezosToken, etherlinkToken] = [tokens.tezos.tzbtc, tokens.etherlink.tzbtc]; let readyForDone = false; tokenBridge.addEventListener('tokenTransferCreated', tokenTransfer => { diff --git a/src/bridgeBlockchainService/etherlinkBridgeBlockchainService/defaultAddresses.ts b/src/bridgeBlockchainService/etherlinkBridgeBlockchainService/defaultAddresses.ts index 014c0da..a5a5073 100644 --- a/src/bridgeBlockchainService/etherlinkBridgeBlockchainService/defaultAddresses.ts +++ b/src/bridgeBlockchainService/etherlinkBridgeBlockchainService/defaultAddresses.ts @@ -1,5 +1,5 @@ export const defaultAddresses = { etherlinkKernelAddress: '0x0000000000000000000000000000000000000000', - withdrawNativeTokenPrecompileAddress: '0x0000000000000000000000000000000000000020', - withdrawNonNativeTokenPrecompileAddress: '0x0000000000000000000000000000000000000040' + withdrawNativeTokenPrecompileAddress: '0xff00000000000000000000000000000000000001', + withdrawNonNativeTokenPrecompileAddress: '0xff00000000000000000000000000000000000002' } as const; diff --git a/src/bridgeBlockchainService/web3EtherlinkBridgeBlockchainService/web3EtherlinkBridgeBlockchainService.ts b/src/bridgeBlockchainService/web3EtherlinkBridgeBlockchainService/web3EtherlinkBridgeBlockchainService.ts index 6d9af93..72c92d7 100644 --- a/src/bridgeBlockchainService/web3EtherlinkBridgeBlockchainService/web3EtherlinkBridgeBlockchainService.ts +++ b/src/bridgeBlockchainService/web3EtherlinkBridgeBlockchainService/web3EtherlinkBridgeBlockchainService.ts @@ -28,7 +28,7 @@ export class Web3EtherlinkBridgeBlockchainService implements EtherlinkBridgeBloc { receipt: TransactionReceipt }, NonPayableMethodObject, NonPayableMethodObject -> { +> { protected readonly web3: Web3; protected readonly withdrawNativeTokenPrecompiledAddress: string; protected readonly withdrawNonNativeTokenPrecompiledAddress: string; @@ -67,11 +67,16 @@ export class Web3EtherlinkBridgeBlockchainService implements EtherlinkBridgeBloc this.getSignerAddress() ]); const data = nonNativeTokenOperation.encodeABI(); - // TODO: need to calculate the value or hardcode it in config + + const estimatedGas = await this.web3.eth.estimateGas({ + from: signerAddress, + to: this.withdrawNonNativeTokenPrecompiledAddress, + data, + }); const receipt = await this.web3.eth.sendTransaction({ from: signerAddress, to: this.withdrawNonNativeTokenPrecompiledAddress, - gas: 30000n, + gas: estimatedGas + (estimatedGas * 5n / 100n), gasPrice, data, }); diff --git a/src/bridgeCore/bridgeOperations.ts b/src/bridgeCore/bridgeOperations.ts index ff8ccba..d453bf4 100644 --- a/src/bridgeCore/bridgeOperations.ts +++ b/src/bridgeCore/bridgeOperations.ts @@ -23,6 +23,7 @@ export interface InitialRollupData { readonly outboxMessageLevel: number; readonly outboxMessageIndex: number; readonly estimatedOutboxMessageExecutionTimestamp?: string; + readonly estimatedOutboxMessageExecutionLevel?: number; } export interface CementedRollupData { diff --git a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeDepositFields.ts b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeDepositFields.ts index 7339e37..9648d09 100644 --- a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeDepositFields.ts +++ b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeDepositFields.ts @@ -15,11 +15,6 @@ l1_transaction { l1_account l2_account timestamp - inbox_message { - type - level - index - } } l2_transaction { level @@ -30,4 +25,9 @@ l2_transaction { id } timestamp +} +inbox_message { + type + level + index }`; diff --git a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeWithdrawalFields.ts b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeWithdrawalFields.ts index 3948388..260fb0c 100644 --- a/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeWithdrawalFields.ts +++ b/src/bridgeDataProviders/dipDupBridgeDataProvider/dipDupGraphQLQueryBuilder/queryParts/bridgeWithdrawalFields.ts @@ -24,13 +24,14 @@ l2_transaction { l1_account l2_account timestamp - outbox_message { - level - index - commitment { - hash - } - proof - cemented_at +} +outbox_message { + level + index + commitment { + hash } + proof + cemented_at + cemented_level }`; diff --git a/src/bridgeDataProviders/dipDupBridgeDataProvider/dtos.ts b/src/bridgeDataProviders/dipDupBridgeDataProvider/dtos.ts index fcb0433..80795e6 100644 --- a/src/bridgeDataProviders/dipDupBridgeDataProvider/dtos.ts +++ b/src/bridgeDataProviders/dipDupBridgeDataProvider/dtos.ts @@ -26,6 +26,15 @@ interface InboxMessageDto { index: number; } +interface OutboxMessageDto { + level: number; + index: number; + commitment: { hash: string; } | null; + proof: string | null; + cemented_at: string; + cemented_level: number; +} + interface TezosTicketDto { token: TezosTokenDto; } @@ -40,7 +49,6 @@ interface DepositL1TransactionDto { l1_account: string; l2_account: string; timestamp: string; - inbox_message: InboxMessageDto; } interface DepositL2TransactionDto { @@ -57,6 +65,7 @@ interface DepositL2TransactionDto { export interface BridgeDepositDto { l1_transaction: DepositL1TransactionDto; l2_transaction: DepositL2TransactionDto | null; + inbox_message: InboxMessageDto | null; } interface WithdrawalL1TransactionDto { @@ -65,6 +74,7 @@ interface WithdrawalL1TransactionDto { counter: number; nonce: number | null; timestamp: string; + outbox_message: OutboxMessageDto; } interface WithdrawalL2TransactionDto { @@ -79,18 +89,12 @@ interface WithdrawalL2TransactionDto { l1_account: string; l2_account: string; timestamp: string; - outbox_message: { - level: number; - index: number; - commitment: { hash: string; } | null; - proof: string | null; - cemented_at: string | null; - } } export interface BridgeWithdrawalDto { l1_transaction: WithdrawalL1TransactionDto | null; l2_transaction: WithdrawalL2TransactionDto; + outbox_message: OutboxMessageDto | null; } export interface BridgeOperationDto { diff --git a/src/bridgeDataProviders/dipDupBridgeDataProvider/mappers.ts b/src/bridgeDataProviders/dipDupBridgeDataProvider/mappers.ts index 92f4842..9cc8e84 100644 --- a/src/bridgeDataProviders/dipDupBridgeDataProvider/mappers.ts +++ b/src/bridgeDataProviders/dipDupBridgeDataProvider/mappers.ts @@ -129,12 +129,19 @@ export const mapBridgeWithdrawalDtoToWithdrawalBridgeTokenTransfer = (dto: Bridg timestamp: dto.l1_transaction.timestamp } : undefined; - const rollupData = { - outboxMessageLevel: dto.l2_transaction.outbox_message.level, - outboxMessageIndex: dto.l2_transaction.outbox_message.index, - commitment: dto.l2_transaction.outbox_message.commitment?.hash || '', - proof: dto.l2_transaction.outbox_message.proof || '' - }; + const rollupData = dto.outbox_message + ? { + outboxMessageLevel: dto.outbox_message.level, + outboxMessageIndex: dto.outbox_message.index, + commitment: dto.outbox_message.commitment?.hash || '', + proof: dto.outbox_message.proof || '' + } + : { + outboxMessageLevel: 0, + outboxMessageIndex: 0, + commitment: '', + proof: '' + }; const id = bridgeUtils.convertOperationDataToTokenTransferId(etherlinkOperation.hash, etherlinkOperation.logIndex); return isFailed @@ -178,9 +185,10 @@ export const mapBridgeWithdrawalDtoToWithdrawalBridgeTokenTransfer = (dto: Bridg receiver, etherlinkOperation, rollupData: { - outboxMessageLevel: dto.l2_transaction.outbox_message.level, - outboxMessageIndex: dto.l2_transaction.outbox_message.index, - estimatedOutboxMessageExecutionTimestamp: dto.l2_transaction.outbox_message.cemented_at || undefined + outboxMessageLevel: rollupData.outboxMessageLevel, + outboxMessageIndex: rollupData.outboxMessageIndex, + estimatedOutboxMessageExecutionTimestamp: dto.outbox_message?.cemented_at || undefined, + estimatedOutboxMessageExecutionLevel: dto.outbox_message?.cemented_level || undefined, } }; } diff --git a/tests/dipDupGraphQLQueryBuilder/dipDupGraphQLQueryBuilder.test.ts b/tests/dipDupGraphQLQueryBuilder/dipDupGraphQLQueryBuilder.test.ts index ff24203..505545e 100644 --- a/tests/dipDupGraphQLQueryBuilder/dipDupGraphQLQueryBuilder.test.ts +++ b/tests/dipDupGraphQLQueryBuilder/dipDupGraphQLQueryBuilder.test.ts @@ -31,7 +31,7 @@ describe('DipDup GraphQL Query Builder', () => { test.each(getOperationTokenTransfersQueryTestCases)( 'Build the getOperationTokenTransfers query %s', (_, testData) => { - const query = queryBuilder.getTokenTransferQuery(testData.operationHash); + const query = queryBuilder.getOperationTokenTransfersQuery(testData.operationHash); const preparedQuery = prepareQueryFormatting(query); expect(preparedQuery).toBe(testData.expectedQuery); diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersQueryTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersQueryTestCases.ts index 98fa5db..ba23d53 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersQueryTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersQueryTestCases.ts @@ -11,14 +11,14 @@ export const getOperationTokenTransfersQueryTestCases: TestCases = [ 'by Tezos operation hash', { operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', - expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ 'by Etherlink operation hash', { operationHash: '0x407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1', - expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ] ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersSubscriptionTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersSubscriptionTestCases.ts index 6ca91b4..76e84c7 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersSubscriptionTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getOperationTokenTransfersSubscriptionTestCases.ts @@ -11,14 +11,14 @@ export const getOperationTokenTransfersSubscriptionTestCases: TestCases = [ 'by Tezos operation hash', { operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', - expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ 'by Etherlink operation hash', { operationHash: '0x407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1', - expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ] ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferQueryTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferQueryTestCases.ts index 83f37ca..ae6106b 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferQueryTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferQueryTestCases.ts @@ -17,7 +17,7 @@ export const getTokenTransferQueryTestCases: TestCases = [ { operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', counter: 57383, - expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -26,7 +26,7 @@ export const getTokenTransferQueryTestCases: TestCases = [ operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', counter: 73027, nonce: 15, - expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -34,7 +34,7 @@ export const getTokenTransferQueryTestCases: TestCases = [ { operationHash: '0x407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1', logIndex: 10, - expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ] ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferSubscriptionTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferSubscriptionTestCases.ts index 970ad42..42ff415 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferSubscriptionTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransferSubscriptionTestCases.ts @@ -17,7 +17,7 @@ export const getTokenTransferSubscriptionTestCases: TestCases = [ { operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', counter: 57383, - expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 57383 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -26,7 +26,7 @@ export const getTokenTransferSubscriptionTestCases: TestCases = [ operationHash: 'oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z', counter: 73027, nonce: 15, - expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { deposit: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } { withdrawal: { l1_transaction: { operation_hash: { _eq: "oocHgjpnSz9A8LRPekG4Fxspc2FW7wiBj7i3nMLpTaj4KQrSH2z" } counter: { _eq: 73027 } nonce: { _eq: 15 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -34,7 +34,7 @@ export const getTokenTransferSubscriptionTestCases: TestCases = [ { operationHash: '0x407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1', logIndex: 10, - expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfer { bridge_operation(where: { _or : [ { withdrawal: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } { deposit: { l2_transaction: { transaction_hash: { _eq: "407671cc863e14b40c404ee9bd8f7281516f44d9b4785f006dc43b4f4ef8d2f1" } log_index: { _eq: 10 } } } } ] }) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ] ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryByAccountAddressesTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryByAccountAddressesTestCases.ts index 32cb2cd..826758b 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryByAccountAddressesTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryByAccountAddressesTestCases.ts @@ -17,7 +17,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: 'tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -26,7 +26,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -35,7 +35,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: '0x4A1819c83A78C948db50f80fED82721Dd0401c9b', offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -44,7 +44,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -54,7 +54,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', 'tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -63,7 +63,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b', '0xBefD2C6fFC36249ebEbd21d6DF6376ecF3BAc448'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -72,7 +72,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', 'tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo', 'tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -81,7 +81,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b', '0xBefD2C6fFC36249ebEbd21d6DF6376ecF3BAc448', '0xce912ad4F73dBC149110091044a8f58Fd17B2b53'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -91,7 +91,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', '0x4A1819c83A78C948db50f80fED82721Dd0401c9b'], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -105,7 +105,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ ], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -121,7 +121,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ ], offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -134,7 +134,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { type: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -146,7 +146,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -159,7 +159,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ type: [], status: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, status: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, status: { _in: [] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -172,7 +172,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { type: ['deposit'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -184,7 +184,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { type: ['withdrawal'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -196,7 +196,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { type: ['deposit', 'withdrawal'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -209,7 +209,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['CREATED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "CREATED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "CREATED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -221,7 +221,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['SEALED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "SEALED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "SEALED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -233,7 +233,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FINISHED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FINISHED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -245,7 +245,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['FAILED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FAILED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FAILED" }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -257,7 +257,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['FAILED', 'FAILED_INVALID_ROUTING_INFO_REVERTABLE', 'FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED', 'FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY', 'FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS', 'FAILED_OUTBOX_EXPIRED', 'FAILED_INBOX_MATCHING_TIMEOUT'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["FAILED","FAILED_INVALID_ROUTING_INFO_REVERTABLE","FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED","FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY","FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS","FAILED_OUTBOX_EXPIRED","FAILED_INBOX_MATCHING_TIMEOUT"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["FAILED","FAILED_INVALID_ROUTING_INFO_REVERTABLE","FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED","FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY","FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS","FAILED_OUTBOX_EXPIRED","FAILED_INBOX_MATCHING_TIMEOUT"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -269,7 +269,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -281,7 +281,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ filter: { status: ['CREATED', 'SEALED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","SEALED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","SEALED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -295,7 +295,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ type: ['deposit'], status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -308,7 +308,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ type: ['withdrawal'], status: ['CREATED', 'SEALED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, status: { _in: ["CREATED","SEALED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, status: { _in: ["CREATED","SEALED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -321,7 +321,7 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [ type: ['deposit', 'withdrawal'], status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, status: { _in: ["CREATED","FINISHED"] }, _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryTestCases.ts index 30731b1..849a206 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersQueryTestCases.ts @@ -15,7 +15,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ { offset: 0, limit: 100, - expectedQuery: 'query TokenTransfers { bridge_operation( order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -23,7 +23,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ { offset: 300, limit: 10, - expectedQuery: 'query TokenTransfers { bridge_operation( order_by: { created_at: desc }, offset: 300, limit: 10 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( order_by: { created_at: desc }, offset: 300, limit: 10 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -35,7 +35,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { type: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -46,7 +46,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -58,7 +58,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ type: [], status: [] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, status: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: [] }, status: { _in: [] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -70,7 +70,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { type: ['deposit'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -81,7 +81,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { type: ['withdrawal'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -92,7 +92,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { type: ['deposit', 'withdrawal'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -104,7 +104,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['CREATED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "CREATED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "CREATED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -115,7 +115,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['SEALED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "SEALED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "SEALED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -126,7 +126,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FINISHED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FINISHED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -137,7 +137,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['FAILED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FAILED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _eq: "FAILED" } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -148,7 +148,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['FAILED', 'FAILED_INVALID_ROUTING_INFO_REVERTABLE', 'FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED', 'FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY', 'FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS', 'FAILED_OUTBOX_EXPIRED', 'FAILED_INBOX_MATCHING_TIMEOUT'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["FAILED","FAILED_INVALID_ROUTING_INFO_REVERTABLE","FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED","FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY","FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS","FAILED_OUTBOX_EXPIRED","FAILED_INBOX_MATCHING_TIMEOUT"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["FAILED","FAILED_INVALID_ROUTING_INFO_REVERTABLE","FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED","FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY","FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS","FAILED_OUTBOX_EXPIRED","FAILED_INBOX_MATCHING_TIMEOUT"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -159,7 +159,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -170,7 +170,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ filter: { status: ['CREATED', 'SEALED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","SEALED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { status: { _in: ["CREATED","SEALED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -183,7 +183,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ type: ['deposit'], status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "deposit" }, status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -195,7 +195,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ type: ['withdrawal'], status: ['CREATED', 'SEALED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, status: { _in: ["CREATED","SEALED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _eq: "withdrawal" }, status: { _in: ["CREATED","SEALED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -207,7 +207,7 @@ export const getTokenTransfersQueryTestCases: TestCases = [ type: ['deposit', 'withdrawal'], status: ['CREATED', 'FINISHED'] }, - expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'query TokenTransfers { bridge_operation( where: { type: { _in: ["deposit","withdrawal"] }, status: { _in: ["CREATED","FINISHED"] } }, order_by: { created_at: desc }, offset: 0, limit: 100 ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsByAccountAddressesTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsByAccountAddressesTestCases.ts index 65c8d2d..5b99821 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsByAccountAddressesTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsByAccountAddressesTestCases.ts @@ -13,7 +13,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: 'tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -21,7 +21,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } { withdrawal: { l2_transaction: { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -29,7 +29,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: '0x4A1819c83A78C948db50f80fED82721Dd0401c9b', startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -37,7 +37,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } { withdrawal: { l2_transaction: { l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], @@ -46,7 +46,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', 'tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -54,7 +54,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b', '0xBefD2C6fFC36249ebEbd21d6DF6376ecF3BAc448'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -62,7 +62,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', 'tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo', 'tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } { withdrawal: { l2_transaction: { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -70,7 +70,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['0x4A1819c83A78C948db50f80fED82721Dd0401c9b', '0xBefD2C6fFC36249ebEbd21d6DF6376ecF3BAc448', '0xce912ad4F73dBC149110091044a8f58Fd17B2b53'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } { withdrawal: { l2_transaction: { l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -78,7 +78,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase { address: ['tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF', '0x4A1819c83A78C948db50f80fED82721Dd0401c9b'], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _eq: "tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF" } }{ l2_account: { _eq: "4a1819c83a78c948db50f80fed82721dd0401c9b" } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -91,7 +91,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase 'tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo' ], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448"] } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], [ @@ -106,7 +106,7 @@ export const getTokenTransfersSubscriptionsByAccountAddressesTestCases: TestCase '0xce912ad4F73dBC149110091044a8f58Fd17B2b53' ], startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( where: { _or: [ { deposit: { l1_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } { withdrawal: { l2_transaction: { _or: [ { l1_account: { _in: ["tz1M6VFkpALGXYoP5CvobR3z1pYu7KvirpMF","tz1YG6P2GTQKFpd9jeuESam2vg6aA9HHRkKo","tz1N96ka7u5cKVbrLdK6wa6KyLoAgdfDzKns"] } }{ l2_account: { _in: ["4a1819c83a78c948db50f80fed82721dd0401c9b","befd2c6ffc36249ebebd21d6df6376ecf3bac448","ce912ad4f73dbc149110091044a8f58fd17b2b53"] } } ] } } } ] }, batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ] ]; diff --git a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsTestCases.ts b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsTestCases.ts index 2ac6d47..d7fd53f 100644 --- a/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsTestCases.ts +++ b/tests/dipDupGraphQLQueryBuilder/testCases/getTokenTransfersSubscriptionsTestCases.ts @@ -11,7 +11,7 @@ export const getTokenTransfersSubscriptionsTestCases: TestCases = [ 'all', { startUpdatedAt: new Date('2024-03-17T12:13:10.104Z'), - expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp inbox_message { type level index } } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp outbox_message { level index commitment { hash } proof cemented_at } } } } }' + expectedQuery: 'subscription TokenTransfers { bridge_operation_stream( batch_size: 10, cursor: {initial_value: {updated_at: "2024-03-17T12:13:10.104Z"}, ordering: ASC} ) { type status is_completed is_successful created_at updated_at deposit { l1_transaction { level operation_hash counter nonce amount ticket { token { type contract_address token_id } } l1_account l2_account timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id } timestamp } inbox_message { type level index } } withdrawal { l1_transaction { level operation_hash counter nonce timestamp } l2_transaction { level transaction_hash log_index amount l2_token { id ticket { token { type contract_address token_id } } } l1_account l2_account timestamp } outbox_message { level index commitment { hash } proof cemented_at cemented_level } } } }' } ], ];