-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bridge-ui): fix svelte-check failures
- Loading branch information
Showing
4 changed files
with
632 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { BigNumber } from "ethers"; | ||
|
||
import { toBigNumber } from "./toBigNumber"; | ||
import { toBigNumber } from './toBigNumber'; | ||
|
||
describe('toBigNumber', () => { | ||
it('should handle different notation for big ints', () => { | ||
expect(toBigNumber('1000000000000000000000').toString()).toEqual('1000000000000000000000'); | ||
expect(toBigNumber(2e+21).toString()).toEqual('2000000000000000000000'); | ||
expect(toBigNumber('1000000000000000000000').toString()).toEqual( | ||
'1000000000000000000000', | ||
); | ||
expect(toBigNumber(2e21).toString()).toEqual('2000000000000000000000'); | ||
expect(toBigNumber(3e21).toString()).toEqual('3000000000000000000000'); | ||
expect(toBigNumber(1000).toString()).toEqual('1000'); | ||
|
||
// Number.MAX_SAFE_INTEGER = 9007199254740991. Maximum safe integer (2^53 – 1) | ||
expect(toBigNumber(BigInt(Number.MAX_SAFE_INTEGER) * 3n).toString()).toEqual('27021597764222973'); | ||
expect( | ||
toBigNumber(BigInt(Number.MAX_SAFE_INTEGER) * 3n).toString(), | ||
).toEqual('27021597764222973'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.