From dcb5a491aeadd1de4a878bc5cb966c66cfab41ce Mon Sep 17 00:00:00 2001 From: Tim Reznichenko Date: Mon, 20 May 2024 19:00:26 +0300 Subject: [PATCH 1/2] fix: replace ethcall with own fork that includes filecoin check for fromAddress --- package.json | 4 ++-- yarn.lock | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6f6131e..7921c09 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ajna-finance/sdk", "description": "A typescript SDK that can be used to create Dapps in Ajna ecosystem.", - "version": "0.4.2", + "version": "0.4.3", "repository": { "type": "git", "url": "https://github.com/ajna-finance/sdk.git" @@ -41,7 +41,7 @@ "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/providers": "^5.7.2", - "ethcall": "^4.8.13", + "ethcall": "git+https://github.com/imbaniac/ethcall.git#filecoin-multicall", "ethers": "^5.7.2", "expect": "^29.6.1", "mathjs": "^11.8.2", diff --git a/yarn.lock b/yarn.lock index 431efe1..0faaefb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2164,10 +2164,9 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -ethcall@^4.8.13: +"ethcall@git+https://github.com/imbaniac/ethcall.git#filecoin-multicall": version "4.8.13" - resolved "https://registry.yarnpkg.com/ethcall/-/ethcall-4.8.13.tgz#20b45cfbfea721d1ae66d5a53c96a1fe138390a0" - integrity sha512-kpD000saTfBDoQn5g8gqTJhjGinWnAPkAwyYCN8SsGCUgjZxTMtEVwA+soo4ii/uyRYKMDeFFVk866GqU0jerA== + resolved "git+https://github.com/imbaniac/ethcall.git#a5d86156c497358e594c746e3e6e361a82b3fbe4" dependencies: "@ethersproject/abi" "^5.0.0" "@ethersproject/bytes" "^5.0.0" From d6034880c49a6563b0c4c5aeeca4eb0d30e8456b Mon Sep 17 00:00:00 2001 From: Tim Reznichenko Date: Tue, 21 May 2024 12:31:57 +0300 Subject: [PATCH 2/2] feat: update node.js and tests --- .github/workflows/lint.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- README.md | 2 +- package.json | 2 +- src/tests/erc20-pool-contracts.spec.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1667128..d5067c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 registry-url: https://registry.npmjs.org - name: Install dependencies diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 79845f9..44f70c4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup node uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 registry-url: https://registry.npmjs.org - name: Install dependencies diff --git a/README.md b/README.md index 4da955e..07978e7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A typescript SDK that can be used to create Dapps and keepers in the Ajna ecosys ## Setup -- Install/select Node.js 14/16/18 using your preferred package/version manager. Note that CI runs against Node 14, but the linter requires ^16.14 or ^18. +- Install/select Node.js ^18 using your preferred package/version manager. Note that CI runs against Node 18. - `yarn install` installs dependencies. - `yarn build` builds the app at `build`, cleaning the folder first. diff --git a/package.json b/package.json index 7921c09..3f50083 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dist" ], "engines": { - "node": ">=16.14", + "node": ">=18.12", "yarn": "^1.22.0" }, "scripts": { diff --git a/src/tests/erc20-pool-contracts.spec.ts b/src/tests/erc20-pool-contracts.spec.ts index e322103..ddffee8 100644 --- a/src/tests/erc20-pool-contracts.spec.ts +++ b/src/tests/erc20-pool-contracts.spec.ts @@ -185,7 +185,7 @@ describe('ERC20 Pool', () => { expect(prices.hpb).toEqual(indexToPrice(3236)); expect(prices.hpbIndex).toEqual(3236); - expect(prices.htp).toBeBetween(toWad(80), toWad(80.5)); + expect(prices.htp).toBeBetween(toWad(80), toWad(81.5)); expect(prices.htpIndex).toEqual(priceToIndex(prices.htp)); expect(prices.lup).toEqual(indexToPrice(3242)); expect(prices.lupIndex).toEqual(3242); @@ -376,7 +376,7 @@ describe('ERC20 Pool', () => { // estimate change against canned loan let loanEstimate = await poolA.estimateLoan(signerBorrower.address, toWad(5000), toWad(68)); const prices = await poolA.getPrices(); - expect(loanEstimate.collateralization).toBeBetween(toWad(1.2), toWad(1.3)); + expect(loanEstimate.collateralization).toBeBetween(toWad(1.15), toWad(1.3)); expect(loanEstimate.debt).toBeBetween(toWad(15000), toWad(15000).mul(2)); expect(loanEstimate.collateral).toEqual(toWad(130 + 68)); expect(loanEstimate.thresholdPrice).toBeBetween(toWad(78), toWad(78).mul(2));