trustwallet-assets/test/numbers.test.ts
Viktor Radchenko 9b41a52182
Add token list support for pairs on binance chain (#4428)
* Add token list support for pairs on binance chain

* Update tokenlists.ts

* Update tokenlists.ts

* Update tokenlists.ts

* Fix asset for bnb pair

* Update package-lock.json

* Add models for token list

* Add BinanceMarket
2020-10-13 18:20:42 -07:00

18 lines
699 B
TypeScript

import {
toSatoshis,
fromSatoshis
} from "../script/generic/numbers";
describe("Test eth-address helpers", () => {
test(`Test to satoshis`, () => {
expect(toSatoshis('43523.423423432112321234', 18)).toEqual('43523423423432112321234');
expect(toSatoshis('0.123', 3)).toEqual('123');
expect(toSatoshis('0.00000001', 8)).toEqual('1');
});
test(`Test from Satoshis`, () => {
expect(fromSatoshis('123', 3)).toEqual('0.123');
expect(fromSatoshis('1234', 3)).toEqual('1.234');
expect(fromSatoshis('43523423423432112321234', 18)).toEqual('43523.423423432112321234');
expect(fromSatoshis('1', 8)).toEqual('0.00000001');
});
});