diff --git a/packages/bridge/src/__tests__/mock-chains.ts b/packages/bridge/src/__tests__/mock-chains.ts index 6738426f25..7603512f50 100644 --- a/packages/bridge/src/__tests__/mock-chains.ts +++ b/packages/bridge/src/__tests__/mock-chains.ts @@ -54,7 +54,7 @@ export const MockChains: Chain[] = [ }, explorers: [ { - tx_page: "https://www.mintscan.io/cosmos/txs/${txHash}", + tx_page: "https://www.mintscan.io/osmosis/txs/{txHash}", }, ], features: [ @@ -115,7 +115,7 @@ export const MockChains: Chain[] = [ }, explorers: [ { - tx_page: "https://www.mintscan.io/osmosis/txs/${txHash}", + tx_page: "https://www.mintscan.io/cosmos/txs/{txHash}", }, ], features: ["ibc-go", "ibc-transfer"], @@ -178,7 +178,7 @@ export const MockChains: Chain[] = [ }, explorers: [ { - tx_page: "https://www.mintscan.io/juno/txs/${txHash}", + tx_page: "https://www.mintscan.io/juno/txs/{txHash}", }, ], features: ["ibc-transfer", "ibc-go", "cosmwasm", "wasmd_0.24+"], @@ -233,7 +233,7 @@ export const MockChains: Chain[] = [ }, explorers: [ { - tx_page: "https://explorer.injective.network/transaction/${txHash}", + tx_page: "https://explorer.injective.network/transaction/{txHash}", }, ], features: ["ibc-transfer", "ibc-go", "eth-address-gen", "eth-key-sign"], @@ -290,7 +290,7 @@ export const MockChains: Chain[] = [ explorers: [ { tx_page: - "https://secretnodes.com/secret/chains/secret-4/transactions/${txHash}", + "https://secretnodes.com/secret/chains/secret-4/transactions/{txHash}", }, ], features: [ @@ -351,7 +351,7 @@ export const MockChains: Chain[] = [ }, explorers: [ { - tx_page: "https://axelarscan.io/tx/${txHash}", + tx_page: "https://axelarscan.io/tx/{txHash}", }, ], features: ["ibc-transfer", "ibc-go", "axelar-evm-bridge"], diff --git a/packages/bridge/src/axelar/__tests__/axelar-transfer-status.spec.ts b/packages/bridge/src/axelar/__tests__/axelar-transfer-status.spec.ts index 23c98370a2..be86ea3f08 100644 --- a/packages/bridge/src/axelar/__tests__/axelar-transfer-status.spec.ts +++ b/packages/bridge/src/axelar/__tests__/axelar-transfer-status.spec.ts @@ -18,6 +18,9 @@ jest.mock("@osmosis-labs/utils", () => ({ }), })); +// silence console errors +jest.spyOn(console, "error").mockImplementation(() => {}); + describe("AxelarTransferStatusProvider", () => { let provider: AxelarTransferStatusProvider; const mockReceiver: TransferStatusReceiver = { diff --git a/packages/bridge/src/ibc/__tests__/ibc-transfer-status.spec.ts b/packages/bridge/src/ibc/__tests__/ibc-transfer-status.spec.ts index 6ffb6345cc..bf751e5508 100644 --- a/packages/bridge/src/ibc/__tests__/ibc-transfer-status.spec.ts +++ b/packages/bridge/src/ibc/__tests__/ibc-transfer-status.spec.ts @@ -352,6 +352,6 @@ describe("IBCTransferStatusProvider", () => { const url = provider.makeExplorerUrl(params); - expect(url).toBe(`https://www.mintscan.io/osmosis-1/txs/ABC123`); + expect(url).toBe(`https://www.mintscan.io/osmosis/txs/ABC123`); }); }); diff --git a/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts b/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts index 462b86868d..6661188e9c 100644 --- a/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts +++ b/packages/bridge/src/skip/__tests__/skip-transfer-status.spec.ts @@ -5,21 +5,21 @@ import { server } from "../../__tests__/msw"; import { BridgeEnvironment, TransferStatusReceiver } from "../../interface"; import { SkipTransferStatusProvider } from "../transfer-status"; -jest.mock("@osmosis-labs/utils", () => { - const originalModule = jest.requireActual("@osmosis-labs/utils"); - return { - ...originalModule, - poll: jest.fn(({ fn, validate }) => { - const pollFn = async () => { - const result = await fn(); - if (validate(result)) { - return result; - } - }; - return pollFn(); - }), - }; -}); +jest.mock("@osmosis-labs/utils", () => ({ + ...jest.requireActual("@osmosis-labs/utils"), + poll: jest.fn(({ fn, validate }) => { + const pollFn = async () => { + const result = await fn(); + if (validate(result)) { + return result; + } + }; + return pollFn(); + }), +})); + +// silence console errors +jest.spyOn(console, "error").mockImplementation(() => {}); describe("SkipTransferStatusProvider", () => { let provider: SkipTransferStatusProvider; @@ -54,12 +54,12 @@ describe("SkipTransferStatusProvider", () => { }) ); - await provider.trackTxStatus( - JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 }) - ); + const params = JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 }); + + await provider.trackTxStatus(params); expect(mockReceiver.receiveNewTxStatus).toHaveBeenCalledWith( - `Skip${JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 })}`, + `Skip${params}`, "success", undefined ); @@ -72,12 +72,12 @@ describe("SkipTransferStatusProvider", () => { }) ); - await provider.trackTxStatus( - JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 }) - ); + const params = JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 }); + + await provider.trackTxStatus(params); expect(mockReceiver.receiveNewTxStatus).toHaveBeenCalledWith( - `Skip${JSON.stringify({ sendTxHash: "testTxHash", fromChainId: 1 })}`, + `Skip${params}`, "failed", undefined ); diff --git a/packages/bridge/src/squid/__tests__/squid-transfer-status.spec.ts b/packages/bridge/src/squid/__tests__/squid-transfer-status.spec.ts index 0052465e3e..aed9e1a43b 100644 --- a/packages/bridge/src/squid/__tests__/squid-transfer-status.spec.ts +++ b/packages/bridge/src/squid/__tests__/squid-transfer-status.spec.ts @@ -21,6 +21,9 @@ jest.mock("@osmosis-labs/utils", () => { }; }); +// silence console errors +jest.spyOn(console, "error").mockImplementation(() => {}); + describe("SquidTransferStatusProvider", () => { let provider: SquidTransferStatusProvider; const mockReceiver: TransferStatusReceiver = {