Skip to content

Commit

Permalink
Support the new failed status
Browse files Browse the repository at this point in the history
  • Loading branch information
skubarenko committed Mar 28, 2024
1 parent 4f36a93 commit 27cc113
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ type BridgeOperationStatus =
| 'FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED'
| 'FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY'
| 'FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS'
| 'FAILED_OUTBOX_EXPIRED';
| 'FAILED_OUTBOX_EXPIRED'
| 'FAILED_INBOX_MATCHING_TIMEOUT';

export interface GraphQLTransfersFilter {
type?: BridgeOperationType[] | null;
Expand Down
3 changes: 2 additions & 1 deletion src/bridgeDataProviders/dipDupBridgeDataProvider/dtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export type BridgeOperationFailedStatus =
| 'FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED'
| 'FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY'
| 'FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS'
| 'FAILED_OUTBOX_EXPIRED';
| 'FAILED_OUTBOX_EXPIRED'
| 'FAILED_INBOX_MATCHING_TIMEOUT';

export type BridgeOperationStatus = BridgeOperationCommonStatus | BridgeOperationFailedStatus;

Expand Down
3 changes: 2 additions & 1 deletion src/bridgeDataProviders/dipDupBridgeDataProvider/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ export const mapBridgeTokenTransferStatusToBridgeOperationDtoStatuses = (status:
'FAILED_INVALID_ROUTING_PROXY_NOT_WHITELISTED',
'FAILED_INVALID_ROUTING_PROXY_EMPTY_PROXY',
'FAILED_INVALID_ROUTING_INVALID_PROXY_ADDRESS',
'FAILED_OUTBOX_EXPIRED'
'FAILED_OUTBOX_EXPIRED',
'FAILED_INBOX_MATCHING_TIMEOUT'
];
default:
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ export const getTokenTransfersQueryByAccountAddressesTestCases: TestCases = [
offset: 0,
limit: 100,
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']
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"] }, _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 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 } } } } }'
}
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export const getTokenTransfersQueryTestCases: TestCases = [
offset: 0,
limit: 100,
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']
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"] } }, 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 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 } } } } }'
}
],
[
Expand Down

0 comments on commit 27cc113

Please sign in to comment.