diff --git a/package-lock.json b/package-lock.json index 3d2f6af7..647d49be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "cover-router", - "version": "2.3.6", + "version": "2.3.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cover-router", - "version": "2.3.6", + "version": "2.3.7", "license": "ISC", "dependencies": { - "@nexusmutual/deployments": "^2.9.0", + "@nexusmutual/deployments": "^2.10.0", "convict": "^6.2.4", "dotenv": "^16.0.3", "ethers": "^5.7.2", @@ -1964,9 +1964,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@nexusmutual/deployments": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@nexusmutual/deployments/-/deployments-2.9.0.tgz", - "integrity": "sha512-/tLmfh1QoezvladXXFMeHI3KBUIf04zVCBv5DAcLlKYFFtqs4oKb8MesLbNRTohmXrtQuTqRrzVojXB/2DpltQ==" + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@nexusmutual/deployments/-/deployments-2.10.0.tgz", + "integrity": "sha512-sI61ZRLhC4i7Ibt0DX9WNIpgtt+bhPAaHuMGCGdtw7uK58SCUlFqMCSfwOF/Onx28RmEPJry0Cf9KQCKOLuhXA==" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -9404,9 +9404,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "@nexusmutual/deployments": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@nexusmutual/deployments/-/deployments-2.9.0.tgz", - "integrity": "sha512-/tLmfh1QoezvladXXFMeHI3KBUIf04zVCBv5DAcLlKYFFtqs4oKb8MesLbNRTohmXrtQuTqRrzVojXB/2DpltQ==" + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@nexusmutual/deployments/-/deployments-2.10.0.tgz", + "integrity": "sha512-sI61ZRLhC4i7Ibt0DX9WNIpgtt+bhPAaHuMGCGdtw7uK58SCUlFqMCSfwOF/Onx28RmEPJry0Cf9KQCKOLuhXA==" }, "@nodelib/fs.scandir": { "version": "2.1.5", diff --git a/package.json b/package.json index d03985d3..5ba31631 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cover-router", - "version": "2.3.6", + "version": "2.3.7", "description": "Cover Router", "main": "src/index.js", "engines": { @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/NexusMutual/cover-router#readme", "dependencies": { - "@nexusmutual/deployments": "^2.9.0", + "@nexusmutual/deployments": "^2.10.0", "convict": "^6.2.4", "dotenv": "^16.0.3", "ethers": "^5.7.2", diff --git a/src/store/reducer.js b/src/store/reducer.js index 36429831..0f885405 100644 --- a/src/store/reducer.js +++ b/src/store/reducer.js @@ -14,6 +14,7 @@ const initialState = { 0: { id: 0, symbol: 'ETH', decimals: 18 }, 1: { id: 1, symbol: 'DAI', decimals: 18 }, 6: { id: 6, symbol: 'USDC', decimals: 6 }, + 7: { id: 7, symbol: 'cbBTC', decimals: 8 }, 255: { id: 255, symbol: 'NXM', decimals: 18 }, }, globalCapacityRatio: 0, diff --git a/test/mocks/store.js b/test/mocks/store.js index a4fcca0c..25fa4da5 100644 --- a/test/mocks/store.js +++ b/test/mocks/store.js @@ -14,12 +14,14 @@ const store = { 0: BigNumber.from(10280040304526400n), 1: BigNumber.from(28724439013819923654n), 6: BigNumber.from(28724439n), + 7: BigNumber.from(82274n), 255: BigNumber.from(1000000000000000000n), }, assets: { 0: { id: 0, symbol: 'ETH', decimals: 18 }, 1: { id: 1, symbol: 'DAI', decimals: 18 }, 6: { id: 6, symbol: 'USDC', decimals: 6 }, + 7: { id: 7, symbol: 'cbBTC', decimals: 8 }, 255: { id: 255, symbol: 'NXM', decimals: 18 }, }, productPriorityPoolsFixedPrice: { @@ -249,13 +251,13 @@ const store = { ], trancheCapacities: [ BigNumber.from(0), - BigNumber.from(1642753), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), + BigNumber.from(1642753), ], lastEffectiveWeight: BigNumber.from(50), targetWeight: BigNumber.from(50), @@ -277,14 +279,14 @@ const store = { BigNumber.from(0), ], trancheCapacities: [ - BigNumber.from(4566), - BigNumber.from(182069), - BigNumber.from(1948), - BigNumber.from(849), BigNumber.from(0), - BigNumber.from(1173144), - BigNumber.from(4925), BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(1367501), ], lastEffectiveWeight: BigNumber.from(7), targetWeight: BigNumber.from(7), @@ -306,14 +308,14 @@ const store = { BigNumber.from(0), ], trancheCapacities: [ - BigNumber.from(226500), - BigNumber.from(49999), BigNumber.from(0), - BigNumber.from(1557499), BigNumber.from(0), BigNumber.from(0), - BigNumber.from(1200499), - BigNumber.from(2850000), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(0), + BigNumber.from(5884497), ], lastEffectiveWeight: BigNumber.from(25), targetWeight: BigNumber.from(25), @@ -336,13 +338,13 @@ const store = { ], trancheCapacities: [ BigNumber.from(0), - BigNumber.from(509999), - BigNumber.from(200000), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), + BigNumber.from(509999), + BigNumber.from(200000), ], lastEffectiveWeight: BigNumber.from(50), targetWeight: BigNumber.from(50), diff --git a/test/unit/responses.js b/test/unit/responses.js index f9cec877..66c9dfe9 100644 --- a/test/unit/responses.js +++ b/test/unit/responses.js @@ -3,6 +3,7 @@ const assets = { 0: { id: 0, symbol: 'ETH', decimals: 18 }, 1: { id: 1, symbol: 'DAI', decimals: 18 }, 6: { id: 6, symbol: 'USDC', decimals: 6 }, + 7: { id: 7, symbol: 'cbBTC', decimals: 8 }, 255: { id: 255, symbol: 'NXM', decimals: 18 }, }; @@ -28,6 +29,11 @@ const capacities = [ amount: '13305160144', asset: assets[6], }, + { + assetId: 7, + amount: '38109316', + asset: assets[7], + }, { assetId: 255, amount: '463200000000000000000', @@ -56,6 +62,11 @@ const capacities = [ amount: '14718402543', asset: assets[6], }, + { + assetId: 7, + amount: '42157197', + asset: assets[7], + }, { assetId: 255, amount: '512400000000000000000', @@ -84,6 +95,11 @@ const capacities = [ amount: '13305160144', asset: assets[6], }, + { + assetId: 7, + amount: '38109316', + asset: assets[7], + }, { assetId: 255, amount: '463200000000000000000', @@ -96,22 +112,27 @@ const capacities = [ availableCapacity: [ { assetId: 0, - amount: '627202118245255087296', + amount: '650955796175312058720', asset: assets[0], }, { assetId: 1, - amount: '1752525132313136206805332', + amount: '1818897544564809351595684', asset: assets[1], }, { assetId: 6, - amount: '1752525131469', + amount: '1818897543689', asset: assets[6], }, + { + assetId: 7, + amount: '5209778910', + asset: assets[7], + }, { assetId: 255, - amount: '61011640000000000000000', + amount: '63322300000000000000000', asset: assets[255], }, ], @@ -137,6 +158,11 @@ const capacities = [ amount: '104020098195', asset: assets[6], }, + { + assetId: 7, + amount: '297939658', + asset: assets[7], + }, { assetId: 255, amount: '3621310000000000000000', @@ -221,6 +247,11 @@ const getQuote = assetId => ({ amount: '2826484797', asset: assets[6], }, + { + assetId: '7', + amount: '8095761', + asset: assets[7], + }, { assetId: '255', amount: '98400000000000000000',