From 0005a6bb011d4ed5fc90f34bf598b5fb98ece5ec Mon Sep 17 00:00:00 2001 From: Tuditi Date: Wed, 18 Oct 2023 11:45:42 +0200 Subject: [PATCH] fix: tests --- .../layer-2/tests/parseLayer2MetadataForTransfer.test.ts | 6 +++--- .../src/lib/core/wallet/tests/getOutputParameters.test.ts | 8 ++++---- packages/shared/test/mocks/api.mock.ts | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/shared/src/lib/core/layer-2/tests/parseLayer2MetadataForTransfer.test.ts b/packages/shared/src/lib/core/layer-2/tests/parseLayer2MetadataForTransfer.test.ts index cd9c4408c9..3457166cad 100644 --- a/packages/shared/src/lib/core/layer-2/tests/parseLayer2MetadataForTransfer.test.ts +++ b/packages/shared/src/lib/core/layer-2/tests/parseLayer2MetadataForTransfer.test.ts @@ -3,7 +3,7 @@ import { parseLayer2MetadataForTransfer } from '../utils/parseLayer2MetadataForT describe('Function: parseLayer2MetadataForTransfer.ts', () => { it('should correctly parse metadata with base token', () => { - const metadata = '0x00000000025e4b3ca1e3f423a0c21e0101611503807d707f59f1345e1063dbb64f2495d1491283a080c0843d' + const metadata = '0x00025e4b3ca1e3f423a0c21e0101611503807d707f59f1345e1063dbb64f2495d1491283a080c0843d' const metadataByteArray = Converter.hexToBytes(metadata) const expected = { senderContract: '0x0', @@ -21,7 +21,7 @@ describe('Function: parseLayer2MetadataForTransfer.ts', () => { it('should correctly parse metadata with native tokens', () => { const metadata = - '0x00000000025e4b3ca1e3f423a0c21e01016115038cc8112290f8c350a60e1afdb8379c686e2a5bb3400108fcccc313acc182fc2c647dc98864062b163a8ee254231d7f029dc6be3a2de52e01000000000132' + '0x00025e4b3ca1e3f423a0c21e01016115038cc8112290f8c350a60e1afdb8379c686e2a5bb3400108fcccc313acc182fc2c647dc98864062b163a8ee254231d7f029dc6be3a2de52e01000000000132' const metadataByteArray = Converter.hexToBytes(metadata) const expected = { senderContract: '0x0', @@ -44,7 +44,7 @@ describe('Function: parseLayer2MetadataForTransfer.ts', () => { it('should correctly parse metadata with nfts', () => { const metadata = - '0x00000000025e4b3ca1e3f423a0c21e0101611503cbcd6d8659ed1998a452335ae53904dc0af1c99b200166b71141974aa368c9152a24d631494b46172ba05dd998eef553e7fa1218b704' + '0x00025e4b3ca1e3f423a0c21e0101611503cbcd6d8659ed1998a452335ae53904dc0af1c99b200166b71141974aa368c9152a24d631494b46172ba05dd998eef553e7fa1218b704' const metadataByteArray = Converter.hexToBytes(metadata) const expected = { senderContract: '0x0', diff --git a/packages/shared/src/lib/core/wallet/tests/getOutputParameters.test.ts b/packages/shared/src/lib/core/wallet/tests/getOutputParameters.test.ts index 1f261a1b85..38e1b6614d 100644 --- a/packages/shared/src/lib/core/wallet/tests/getOutputParameters.test.ts +++ b/packages/shared/src/lib/core/wallet/tests/getOutputParameters.test.ts @@ -1,5 +1,5 @@ import { activeProfileId } from '@core/profile/stores/active-profile-id.store' -import { SupportedNetworkId, ChainId } from '@core/network/enums' +import { SupportedNetworkId } from '@core/network/enums' import { FALLBACK_ESTIMATED_GAS } from '@core/layer-2/constants' import { DEFAULT_CHAIN_CONFIGURATIONS } from '@core/network/constants' import { getOutputParameters } from '../utils' @@ -237,7 +237,7 @@ describe('File: getOutputParameters.ts', () => { amount: '1000000000', features: { metadata: - '0x00000000025e4b3ca1e3f423fccf01010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000808094ebdc03', + '0x00025e4b3ca1e3f423fccf01010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000808094ebdc03', sender: senderAddress, }, unlocks: { expirationUnixTime: 1680163475 }, @@ -277,7 +277,7 @@ describe('File: getOutputParameters.ts', () => { }, features: { metadata: - '0x00000000025e4b3ca1e3f423a1d101010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000400108cd4dcad7ccc383111942671ee8cdc487ddd250398331ca2692b8b1a81551a1c30100000000043b9aca00', + '0x00025e4b3ca1e3f423a1d101010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000400108cd4dcad7ccc383111942671ee8cdc487ddd250398331ca2692b8b1a81551a1c30100000000043b9aca00', sender: senderAddress, }, unlocks: { expirationUnixTime: 1680163475 }, @@ -303,7 +303,7 @@ describe('File: getOutputParameters.ts', () => { }, features: { metadata: - '0x00000000025e4b3ca1e3f423a2d401010161200300010000070c000c30680e00000090000f0ea000060009000d3000000000002001cd9430ff870a22f81f92428e5c06975fa3ec1a993331aa3db9fb2298e931ade1', + '0x00025e4b3ca1e3f423a2d401010161200300010000070c000c30680e00000090000f0ea000060009000d3000000000002001cd9430ff870a22f81f92428e5c06975fa3ec1a993331aa3db9fb2298e931ade1', sender: senderAddress, }, unlocks: {}, diff --git a/packages/shared/test/mocks/api.mock.ts b/packages/shared/test/mocks/api.mock.ts index 8fafef6c5b..884c2865a4 100644 --- a/packages/shared/test/mocks/api.mock.ts +++ b/packages/shared/test/mocks/api.mock.ts @@ -62,6 +62,9 @@ const api: IApi = { resolve() }) }, + bech32ToHex(address: string): string { + return '' + }, } window['__WALLET__API__'] = api