Tests are failing after a successfull build:
`~/pancake-swap-sdk # yarn test
yarn run v1.22.5
$ tsdx test
FAIL test/constants.test.ts
● constants › INIT_CODE_HASH › matches computed bytecode hash
expect(received).toEqual(expected) // deep equality
Expected: "0x00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5"
Received: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
11 | describe('INIT_CODE_HASH', () => {
12 | it('matches computed bytecode hash', () => {
> 13 | expect(COMPUTED_INIT_CODE_HASH).toEqual(INIT_CODE_HASH)
| ^
14 | })
15 | })
16 | })
at Object.<anonymous> (test/constants.test.ts:13:39)
PASS test/route.test.ts
PASS test/router.test.ts
PASS test/token.test.ts
PASS test/fraction.test.ts
PASS test/miscellaneous.test.ts
PASS test/trade.test.ts
FAIL test/pair.test.ts
● Pair › #getAddress › returns the correct address
expect(received).toEqual(expected) // deep equality
Expected: "0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5"
Received: "0xEeC9cA661B7876d4e223C95D6f3b856238dCCDCb"
15 | describe('#getAddress', () => {
16 | it('returns the correct address', () => {
> 17 | expect(Pair.getAddress(USDC, DAI)).toEqual('0xAE461cA67B15dc8dc81CE7615e0320dA1A9aB8D5')
| ^
18 | })
19 | })
20 |
at Object.<anonymous> (test/pair.test.ts:17:42)
FAIL test/entities.test.ts
● entities › decimals permutation: 0,0,0 › Trade › TradeType.EXACT_INPUT
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
@@ -9,12 +9,12 @@
"denominator": JSBI [
-1486618624,
232830643,
],
"numerator": JSBI [
- -996157254,
- 387080459,
+ 134165932,
+ 387242296,
],
"token": Token {
"address": "0xaE8E19eFB41e7b96815649A6a60785e1fbA84C1e",
"chainId": 97,
"decimals": 18,
116 | expect(trade.tradeType).toEqual(TradeType.EXACT_INPUT)
117 | expect(trade.inputAmount).toEqual(inputAmount)
> 118 | expect(trade.outputAmount).toEqual(expectedOutputAmount)
| ^
119 |
120 | expect(trade.executionPrice.toSignificant(18)).toEqual('1.66249791562447891')
121 | expect(trade.executionPrice.invert().toSignificant(18)).toEqual('0.601504513540621866')
at Object.<anonymous> (test/entities.test.ts:118:38)
● entities › decimals permutation: 0,9,18 › Trade › TradeType.EXACT_INPUT
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
@@ -9,12 +9,12 @@
"denominator": JSBI [
-1486618624,
232830643,
],
"numerator": JSBI [
- -996157254,
- 387080459,
+ 134165932,
+ 387242296,
],
"token": Token {
"address": "0xaE8E19eFB41e7b96815649A6a60785e1fbA84C1e",
"chainId": 97,
"decimals": 18,
116 | expect(trade.tradeType).toEqual(TradeType.EXACT_INPUT)
117 | expect(trade.inputAmount).toEqual(inputAmount)
> 118 | expect(trade.outputAmount).toEqual(expectedOutputAmount)
| ^
119 |
120 | expect(trade.executionPrice.toSignificant(18)).toEqual('1.66249791562447891')
121 | expect(trade.executionPrice.invert().toSignificant(18)).toEqual('0.601504513540621866')
at Object.<anonymous> (test/entities.test.ts:118:38)
● entities › decimals permutation: 0,9,18 › Trade › TradeType.EXACT_OUTPUT
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
@@ -8,11 +8,11 @@
},
"denominator": JSBI [
1000000000,
],
"numerator": JSBI [
- 1000000000,
+ 999498747,
],
"token": Token {
"address": "0x0000000000000000000000000000000000000002",
"chainId": 97,
"decimals": 9,
136 | expect(trade.tradeType).toEqual(TradeType.EXACT_OUTPUT)
137 | expect(trade.outputAmount).toEqual(outputAmount)
> 138 | expect(trade.inputAmount).toEqual(expectedInputAmount)
| ^
139 |
140 | expect(trade.executionPrice.toSignificant(18)).toEqual('1.66249791562447891')
141 | expect(trade.executionPrice.invert().toSignificant(18)).toEqual('0.601504513540621866')
at Object.<anonymous> (test/entities.test.ts:138:37)
● entities › decimals permutation: 0,9,18 › Trade › minimum TradeType.EXACT_INPUT
expect(received).toEqual(expected) // deep equality
Expected: "0.300000099400899902"
Received: "0.2500001008007499"
167 | const trade = new Trade(route, outputAmount, TradeType.EXACT_INPUT)
168 |
> 169 | expect(trade.priceImpact.toSignificant(18)).toEqual(
| ^
170 | tokens[1].decimals === 9 ? '0.300000099400899902' : '0.3000000000000001'
171 | )
172 | }
at Object.<anonymous> (test/entities.test.ts:169:57)
● entities › decimals permutation: 18,18,18 › Trade › TradeType.EXACT_INPUT
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
@@ -9,12 +9,12 @@
"denominator": JSBI [
-1486618624,
232830643,
],
"numerator": JSBI [
- -996157254,
- 387080459,
+ 134165932,
+ 387242296,
],
"token": Token {
"address": "0xaE8E19eFB41e7b96815649A6a60785e1fbA84C1e",
"chainId": 97,
"decimals": 18,
116 | expect(trade.tradeType).toEqual(TradeType.EXACT_INPUT)
117 | expect(trade.inputAmount).toEqual(inputAmount)
> 118 | expect(trade.outputAmount).toEqual(expectedOutputAmount)
| ^
119 |
120 | expect(trade.executionPrice.toSignificant(18)).toEqual('1.66249791562447891')
121 | expect(trade.executionPrice.invert().toSignificant(18)).toEqual('0.601504513540621866')
at Object.<anonymous> (test/entities.test.ts:118:38)
● entities › decimals permutation: 18,18,18 › Trade › TradeType.EXACT_OUTPUT
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
@@ -9,12 +9,12 @@
"denominator": JSBI [
-1486618624,
232830643,
],
"numerator": JSBI [
- -1486618624,
- 232830643,
+ -1871236432,
+ 232713936,
],
"token": Token {
"address": "0x0000000000000000000000000000000000000002",
"chainId": 97,
"decimals": 18,
136 | expect(trade.tradeType).toEqual(TradeType.EXACT_OUTPUT)
137 | expect(trade.outputAmount).toEqual(outputAmount)
> 138 | expect(trade.inputAmount).toEqual(expectedInputAmount)
| ^
139 |
140 | expect(trade.executionPrice.toSignificant(18)).toEqual('1.66249791562447891')
141 | expect(trade.executionPrice.invert().toSignificant(18)).toEqual('0.601504513540621866')
at Object.<anonymous> (test/entities.test.ts:138:37)
Test Suites: 3 failed, 1 skipped, 6 passed, 9 of 10 total
Tests: 8 failed, 3 skipped, 117 passed, 128 total
Snapshots: 0 total
Time: 1.878s, estimated 13s
Ran all test suites.
error Command failed with exit code 1`