From bd1b3b13667e239cc4de063575444789c2dc5411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20B=C3=B6hringer?= Date: Thu, 12 Oct 2023 14:00:10 +0200 Subject: [PATCH] Payable protocolCmd --- contracts/callpaths/LiquidityMiningPath.sol | 2 +- test_other/test_canto/TestLiquidityMining.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/callpaths/LiquidityMiningPath.sol b/contracts/callpaths/LiquidityMiningPath.sol index e6c63f73..ddd739a1 100644 --- a/contracts/callpaths/LiquidityMiningPath.sol +++ b/contracts/callpaths/LiquidityMiningPath.sol @@ -23,7 +23,7 @@ import "../libraries/ProtocolCmd.sol"; contract LiquidityMiningPath is LiquidityMining { /* @notice Consolidated method for protocol control related commands. * Used to set reward rates */ - function protocolCmd(bytes calldata cmd) public virtual { + function protocolCmd(bytes calldata cmd) public virtual payable { (uint8 code, bytes32 poolHash, uint32 weekFrom, uint32 weekTo, uint64 weeklyReward) = abi.decode(cmd, (uint8, bytes32, uint32, uint32, uint64)); diff --git a/test_other/test_canto/TestLiquidityMining.js b/test_other/test_canto/TestLiquidityMining.js index bd21a32c..e2d6f877 100644 --- a/test_other/test_canto/TestLiquidityMining.js +++ b/test_other/test_canto/TestLiquidityMining.js @@ -218,7 +218,6 @@ describe("Liquidity Mining Tests", function () { ); tx = await dex.userCmd(2, mintConcentratedLiqCmd, { gasLimit: 6000000, - value: ethers.utils.parseUnits("10", "ether"), }); await tx.wait(); @@ -267,7 +266,9 @@ describe("Liquidity Mining Tests", function () { BigNumber.from("1000000000000000000"), // 1 CANTO per week distributed ] ); - tx = await dex.protocolCmd(8, setRewards, true); + tx = await dex.protocolCmd(8, setRewards, true, { + value: ethers.utils.parseUnits("10", "ether"), + }); await tx.wait(); await time.increase(604800 * 5); // fast forward 1000 seconds so that rewards accrue