From 866122d6c127253b62b7e863d5d74921dcdb61f7 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Fri, 16 Feb 2024 17:34:20 +0100 Subject: [PATCH] Make deposit dust threshold configurable in MockBridge Integrators using the MockBridge contract implementation may be interested in configuring the deposit dust threshold, to test their implementation. --- solidity/contracts/test/TestTBTCDepositor.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/solidity/contracts/test/TestTBTCDepositor.sol b/solidity/contracts/test/TestTBTCDepositor.sol index 9eb98fa7c..bf0a2d5ea 100644 --- a/solidity/contracts/test/TestTBTCDepositor.sol +++ b/solidity/contracts/test/TestTBTCDepositor.sol @@ -58,6 +58,7 @@ contract MockBridge is IBridge { mapping(uint256 => IBridgeTypes.DepositRequest) internal _deposits; + uint64 internal _depositDustThreshold = 1000000; // 1000000 satoshi = 0.01 BTC uint64 internal _depositTreasuryFeeDivisor = 50; // 1/50 == 100 bps == 2% == 0.02 uint64 internal _depositTxMaxFee = 1000; // 1000 satoshi = 0.00001 BTC @@ -137,12 +138,16 @@ contract MockBridge is IBridge { uint32 depositRevealAheadPeriod ) { - depositDustThreshold = 0; - depositTreasuryFeeDivisor = 0; + depositDustThreshold = _depositDustThreshold; + depositTreasuryFeeDivisor = _depositTreasuryFeeDivisor; depositTxMaxFee = _depositTxMaxFee; depositRevealAheadPeriod = 0; } + function setDepositDustThreshold(uint64 value) external { + _depositDustThreshold = value; + } + function setDepositTreasuryFeeDivisor(uint64 value) external { _depositTreasuryFeeDivisor = value; }