@uniswap/token-list-bridge-utils 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.test.ts CHANGED
@@ -15,6 +15,8 @@ import {
15
15
  bnbedSampleTokenList,
16
16
  sampleL1TokenList,
17
17
  Tokens,
18
+ sampleL1TokenList_2,
19
+ bnbedSampleTokenList_2,
18
20
  } from './fixtures'
19
21
 
20
22
  jest.setTimeout(15000)
@@ -87,7 +89,6 @@ describe(chainifyTokenList, () => {
87
89
 
88
90
  it('outputs bnb list correctly', async () => {
89
91
  const tokenList = await chainifyTokenList([ChainId.BNB], sampleL1TokenList)
90
- console.log('heeeeeeee', JSON.stringify(tokenList.tokens, null, 2))
91
92
  expect(tokenList).toBeDefined()
92
93
  expect(tokenList?.version).toEqual(bnbedSampleTokenList.version)
93
94
  expect(
@@ -98,6 +99,22 @@ it('outputs bnb list correctly', async () => {
98
99
  )
99
100
  })
100
101
 
102
+ it('outputs bnb list correctly with different decimals', async () => {
103
+ const tokenList = await chainifyTokenList([ChainId.BNB], sampleL1TokenList_2)
104
+ expect(tokenList).toBeDefined()
105
+ expect(tokenList?.version).toEqual(bnbedSampleTokenList_2.version)
106
+ expect(
107
+ tokenList?.tokens.map((t) => [t.address, t.chainId, t.extensions])
108
+ ).toEqual(
109
+ // ignores other metadata
110
+ bnbedSampleTokenList_2.tokens.map((t) => [
111
+ t.address,
112
+ t.chainId,
113
+ t.extensions,
114
+ ])
115
+ )
116
+ })
117
+
101
118
  describe(mergeTokenLists, () => {
102
119
  it('correctly deduplicates', () => {
103
120
  const merged = mergeTokenLists(sampleL1TokenList, sampleL1TokenList)