From 9d6b18593c3f89a4219df89c3e4d24fec4c4e658 Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 16 Aug 2024 10:16:49 -0400 Subject: [PATCH 1/4] chore: remove rails around inverting capital cost config Signed-off-by: james-a-morris --- src/relayFeeCalculator/relayFeeCalculator.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/relayFeeCalculator/relayFeeCalculator.ts b/src/relayFeeCalculator/relayFeeCalculator.ts index fbce8d0d5..beb727912 100644 --- a/src/relayFeeCalculator/relayFeeCalculator.ts +++ b/src/relayFeeCalculator/relayFeeCalculator.ts @@ -196,7 +196,6 @@ export class RelayFeeCalculator { */ static validateCapitalCostsConfig(capitalCosts: CapitalCostConfig): void { assert(toBN(capitalCosts.upperBound).lt(toBNWei("0.01")), "upper bound must be < 1%"); - assert(toBN(capitalCosts.lowerBound).lte(capitalCosts.upperBound), "lower bound must be <= upper bound"); assert(capitalCosts.decimals > 0 && capitalCosts.decimals <= 18, "invalid decimals"); } From 491e83577f521d70283f1d527c531d2f088891ac Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 16 Aug 2024 10:18:34 -0400 Subject: [PATCH 2/4] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0c14032a..06c58d9de 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@across-protocol/sdk", "author": "UMA Team", - "version": "3.1.24", + "version": "3.1.25", "license": "AGPL-3.0", "homepage": "https://docs.across.to/reference/sdk", "files": [ From 0c616460ace95406834b194bbefcaf3c63f3e6ea Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 16 Aug 2024 10:27:12 -0400 Subject: [PATCH 3/4] fix: remove tests to limit rails Signed-off-by: james-a-morris --- test/relayFeeCalculator.test.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/test/relayFeeCalculator.test.ts b/test/relayFeeCalculator.test.ts index 3cfd49a57..940b61002 100644 --- a/test/relayFeeCalculator.test.ts +++ b/test/relayFeeCalculator.test.ts @@ -194,29 +194,6 @@ describe("RelayFeeCalculator", () => { }), /upper bound must be - new RelayFeeCalculator({ - queries, - capitalCostsConfig: { - WBTC: { - ...testCapitalCostsConfig["WBTC"], - upperBound: toBNWei("0.001").toString(), - lowerBound: toBNWei("0.002").toString(), - }, - }, - }), - /lower bound must be <= upper bound/ - ); - assert.throws( - () => - RelayFeeCalculator.validateCapitalCostsConfig({ - ...testCapitalCostsConfig["WBTC"], - upperBound: toBNWei("0.001").toString(), - lowerBound: toBNWei("0.002").toString(), - }), - /lower bound must be <= upper bound/ - ); assert.throws( () => new RelayFeeCalculator({ From ff56dc5ab064a870cdff7e20b7f48b974bc67fab Mon Sep 17 00:00:00 2001 From: james-a-morris Date: Fri, 16 Aug 2024 10:42:08 -0400 Subject: [PATCH 4/4] improve: test cases Signed-off-by: james-a-morris --- test/relayFeeCalculator.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/relayFeeCalculator.test.ts b/test/relayFeeCalculator.test.ts index 940b61002..e72e9b89d 100644 --- a/test/relayFeeCalculator.test.ts +++ b/test/relayFeeCalculator.test.ts @@ -7,7 +7,6 @@ import { toGWei, TransactionCostEstimate, bnOne, - bnZero, getCurrentTime, spreadEvent, isMessageEmpty, @@ -336,11 +335,11 @@ describe("RelayFeeCalculator: Composable Bridging", function () { originChainId: 10, destinationChainId: 1, message: message || EMPTY_MESSAGE, - relayerFeePct: bnZero, - realizedLpFeePct: bnZero, exclusiveRelayer: ZERO_ADDRESS, fillDeadline: getCurrentTime() + 60000, exclusivityDeadline: 0, + fromLiteChain: false, + toLiteChain: false, }, 1, false, @@ -425,7 +424,7 @@ describe("RelayFeeCalculator: Composable Bridging", function () { originChainId: 1, message: "0xabcdef", exclusiveRelayer: ZERO_ADDRESS, - fillDeadline: getCurrentTime() + 60, + fillDeadline: getCurrentTime() + 600, exclusivityDeadline: 0, }, 10