From e40b6b894f95ecfc0c78947ee7dafed1b7ed6dd7 Mon Sep 17 00:00:00 2001 From: afsardo Date: Fri, 19 May 2023 23:22:13 +0100 Subject: [PATCH] ci: fix tests --- .github/workflows/publish.yml | 2 +- test/index.ts | 10 ++++++++-- test/package-lock.json | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ec794d4..0693782 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: - name: Build package run: make build - - name: Setup Node + - name: Setup node uses: actions/setup-node@v3 with: node-version: 16.x diff --git a/test/index.ts b/test/index.ts index 0375d01..d8857b5 100644 --- a/test/index.ts +++ b/test/index.ts @@ -177,8 +177,14 @@ async function stable_swap_test(client: CosmWasmClient) { ) ); assert( - stable_result.return_amount === simulation.return_amount && - stable_result.spread_amount === simulation.spread_amount && + BigNumber(stable_result.return_amount) + .minus(simulation.return_amount) + .abs() + .toNumber() <= 1 && + BigNumber(stable_result.commission_amount) + .minus(simulation.commission_amount) + .abs() + .toNumber() <= 1 && stable_result.commission_amount === simulation.commission_amount ); } diff --git a/test/package-lock.json b/test/package-lock.json index 35e6804..b974f69 100644 --- a/test/package-lock.json +++ b/test/package-lock.json @@ -1,11 +1,11 @@ { - "name": "test", + "name": "@astroport/math-test", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "test", + "name": "@astroport/math-test", "version": "1.0.0", "license": "ISC", "dependencies": {