Skip to content

Commit 55efa40

Browse files
authored
fix: capital cost config validation (#1020)
1 parent 72dfbbb commit 55efa40

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@across-protocol/sdk",
33
"author": "UMA Team",
4-
"version": "4.1.58",
4+
"version": "4.1.59",
55
"license": "AGPL-3.0",
66
"homepage": "https://docs.across.to/reference/sdk",
77
"files": [

src/relayFeeCalculator/relayFeeCalculator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class RelayFeeCalculator {
204204
* @param capitalCosts CapitalCostConfig
205205
*/
206206
static validateCapitalCostsConfig(capitalCosts: CapitalCostConfig): void {
207-
assert(toBN(capitalCosts.upperBound).lt(toBNWei("0.01")), "upper bound must be < 1%");
207+
assert(toBN(capitalCosts.upperBound).lt(toBNWei("1")), "upper bound must be < 100%");
208208
assert(capitalCosts.decimals > 0 && capitalCosts.decimals <= 18, "invalid decimals");
209209
}
210210

test/relayFeeCalculator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe("RelayFeeCalculator", () => {
184184
new RelayFeeCalculator({
185185
queries,
186186
capitalCostsConfig: {
187-
WBTC: { ...testCapitalCostsConfig["WBTC"], upperBound: toBNWei("0.01").toString() },
187+
WBTC: { ...testCapitalCostsConfig["WBTC"], upperBound: toBNWei("1.01").toString() },
188188
},
189189
}),
190190
/upper bound must be </
@@ -193,7 +193,7 @@ describe("RelayFeeCalculator", () => {
193193
() =>
194194
RelayFeeCalculator.validateCapitalCostsConfig({
195195
...testCapitalCostsConfig["WBTC"],
196-
upperBound: toBNWei("0.01").toString(),
196+
upperBound: toBNWei("1.01").toString(),
197197
}),
198198
/upper bound must be </
199199
);

0 commit comments

Comments
 (0)