Skip to content

Commit

Permalink
fix: broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
infiniteflower committed Dec 2, 2024
1 parent 12b61db commit 86e1202
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ exports[`BridgeStatusController constructor rehydrates the tx history state 1`]
"account": "0xaccount1",
"estimatedProcessingTimeInSeconds": 15,
"initialDestAssetBalance": undefined,
"pricingData": undefined,
"pricingData": {
"amountSent": "1.234",
},
"quote": {
"bridgeId": "lifi",
"bridges": [
Expand Down Expand Up @@ -113,7 +115,9 @@ exports[`BridgeStatusController startPollingForBridgeTxStatus sets the inital tx
"account": "0xaccount1",
"estimatedProcessingTimeInSeconds": 15,
"initialDestAssetBalance": undefined,
"pricingData": undefined,
"pricingData": {
"amountSent": "1.234",
},
"quote": {
"bridgeId": "lifi",
"bridges": [
Expand Down
13 changes: 11 additions & 2 deletions app/scripts/controllers/bridge-status/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
StatusResponse,
StatusTypes,
ActionTypes,
StartPollingForBridgeTxStatusArgsSerialized,
} from '../../../../shared/types/bridge-status';

export const MockStatusResponse = {
Expand Down Expand Up @@ -210,7 +211,7 @@ export const getMockStartPollingForBridgeTxStatusArgs = ({
account = '0xaccount1',
srcChainId = 42161,
destChainId = 10,
} = {}) => ({
} = {}): StartPollingForBridgeTxStatusArgsSerialized => ({
bridgeTxMeta: {
id: txMetaId,
} as TransactionMeta,
Expand All @@ -235,10 +236,10 @@ export const getMockStartPollingForBridgeTxStatusArgs = ({
},
approval: null,
estimatedProcessingTimeInSeconds: 15,
sentAmount: { amount: '1.234', fiat: null },
},
startTime: 1729964825189,
slippagePercentage: 0,
pricingData: undefined,
initialDestAssetBalance: undefined,
targetContractAddress: '0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC',
});
Expand All @@ -258,6 +259,8 @@ export const MockTxHistory = {
slippagePercentage: 0,
account,
targetContractAddress: '0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC',
initialDestAssetBalance: undefined,
pricingData: { amountSent: '1.234' },
},
}),
getInit: ({
Expand All @@ -274,6 +277,8 @@ export const MockTxHistory = {
slippagePercentage: 0,
account,
targetContractAddress: '0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC',
initialDestAssetBalance: undefined,
pricingData: { amountSent: '1.234' },
},
}),
getPending: ({
Expand All @@ -295,6 +300,8 @@ export const MockTxHistory = {
srcChainId,
}),
targetContractAddress: '0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC',
initialDestAssetBalance: undefined,
pricingData: { amountSent: '1.234' },
},
}),
getComplete: ({
Expand All @@ -313,6 +320,8 @@ export const MockTxHistory = {
account,
status: MockStatusResponse.getComplete({ srcTxHash }),
targetContractAddress: '0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC',
initialDestAssetBalance: undefined,
pricingData: { amountSent: '1.234' },
},
}),
};
10 changes: 6 additions & 4 deletions shared/types/bridge-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ export type StartPollingForBridgeTxStatusArgs = {
targetContractAddress?: BridgeHistoryItem['targetContractAddress'];
};

export type StartPollingForBridgeTxStatusArgsSerialized =
StartPollingForBridgeTxStatusArgs & {
quoteResponse: QuoteResponse & QuoteMetadataSerialized;
};
export type StartPollingForBridgeTxStatusArgsSerialized = Omit<
StartPollingForBridgeTxStatusArgs,
'quoteResponse'
> & {
quoteResponse: QuoteResponse & QuoteMetadataSerialized;
};

export type SourceChainTxMetaId = string;

Expand Down

0 comments on commit 86e1202

Please sign in to comment.