add atomicUnitsToXmr and xmrToAtomicUnits utils

This commit is contained in:
woodser 2023-05-02 09:12:43 -04:00
parent 31e78ec55e
commit ff810de4b7
2 changed files with 41 additions and 2 deletions

View file

@ -176,8 +176,8 @@ const TestConfig = {
walletSyncPeriodMs: 5000,
maxTimePeerNoticeMs: 5000,
maxConcurrency: 14, // max concurrency
maxConcurrencyCI: 4, // CI test max concurrency
stopOnFailure: false
maxConcurrencyCI: 14, // CI test max concurrency
stopOnFailure: true
}
};
@ -382,6 +382,12 @@ test("Can get the version (CI)", async () => {
expect(version).toEqual(TestConfig.haveno.version);
});
test("Can convert between XMR and atomic units (CI)", async () => {
expect(BigInt(250000000000)).toEqual(HavenoUtils.xmrToAtomicUnits(0.25));
expect(HavenoUtils.atomicUnitsToXmr("250000000000")).toEqual(.25);
expect(HavenoUtils.atomicUnitsToXmr(BigInt("250000000000"))).toEqual(.25);
});
test("Can manage an account (CI)", async () => {
let user3: HavenoClient|undefined;
let err: any;