Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuditi committed Oct 18, 2023
1 parent f9e4cb0 commit 0005a6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -237,7 +237,7 @@ describe('File: getOutputParameters.ts', () => {
amount: '1000000000',
features: {
metadata:
'0x00000000025e4b3ca1e3f423fccf01010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000808094ebdc03',
'0x00025e4b3ca1e3f423fccf01010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000808094ebdc03',
sender: senderAddress,
},
unlocks: { expirationUnixTime: 1680163475 },
Expand Down Expand Up @@ -277,7 +277,7 @@ describe('File: getOutputParameters.ts', () => {
},
features: {
metadata:
'0x00000000025e4b3ca1e3f423a1d101010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000400108cd4dcad7ccc383111942671ee8cdc487ddd250398331ca2692b8b1a81551a1c30100000000043b9aca00',
'0x00025e4b3ca1e3f423a1d101010161200300010000070c000c30680e00000090000f0ea000060009000d300000000000400108cd4dcad7ccc383111942671ee8cdc487ddd250398331ca2692b8b1a81551a1c30100000000043b9aca00',
sender: senderAddress,
},
unlocks: { expirationUnixTime: 1680163475 },
Expand All @@ -303,7 +303,7 @@ describe('File: getOutputParameters.ts', () => {
},
features: {
metadata:
'0x00000000025e4b3ca1e3f423a2d401010161200300010000070c000c30680e00000090000f0ea000060009000d3000000000002001cd9430ff870a22f81f92428e5c06975fa3ec1a993331aa3db9fb2298e931ade1',
'0x00025e4b3ca1e3f423a2d401010161200300010000070c000c30680e00000090000f0ea000060009000d3000000000002001cd9430ff870a22f81f92428e5c06975fa3ec1a993331aa3db9fb2298e931ade1',
sender: senderAddress,
},
unlocks: {},
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/test/mocks/api.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ const api: IApi = {
resolve()
})
},
bech32ToHex(address: string): string {
return ''
},
}

window['__WALLET__API__'] = api

0 comments on commit 0005a6b

Please sign in to comment.