mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
added addGaugeMappings into curveGaugeMapping to add multiple mappings;
added test for that;
This commit is contained in:
parent
8a9ce14a9d
commit
73a5eee1fd
|
@ -68,6 +68,17 @@ contract Helpers is BytesHelper {
|
|||
_;
|
||||
}
|
||||
|
||||
function addGaugeMappings(
|
||||
string[] memory gaugeNames,
|
||||
address[] memory gaugeAddresses,
|
||||
bool[] memory rewardTokens
|
||||
) public isChief {
|
||||
require(gaugeNames.length == gaugeAddresses.length && gaugeAddresses.length == rewardTokens.length, "length-not-match");
|
||||
for (uint32 i; i < gaugeNames.length; i++) {
|
||||
addGaugeMapping(gaugeNames[i], gaugeAddresses[i], rewardTokens[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function addGaugeMapping(
|
||||
string memory gaugeName,
|
||||
address gaugeAddress,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
pragma solidity ^0.6.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import { CurveGaugeMapping } from "../mapping/curve_gauge_mapping.sol";
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ contract("ConnectCurveGauge", async accounts => {
|
|||
let rewarded_token = await curveGauge.methods.rewarded_token().encodeABI();
|
||||
await mock.givenMethodReturnAddress(rewarded_token, mock.address);
|
||||
|
||||
mockCurveGaugeMapping.addGaugeMapping('compound', mock.address, false);
|
||||
mockCurveGaugeMapping.addGaugeMapping('susd', mock.address, true);
|
||||
await mockCurveGaugeMapping.addGaugeMapping('compound', mock.address, false);
|
||||
await mockCurveGaugeMapping.addGaugeMapping('susd', mock.address, true);
|
||||
})
|
||||
|
||||
it('can deposit into compound gauge', async function() {
|
||||
|
@ -146,4 +146,9 @@ contract("ConnectCurveGauge", async accounts => {
|
|||
)
|
||||
await expectRevert(tx, "wrong-gauge-pool-name")
|
||||
});
|
||||
|
||||
it('can add multiple gauge mappings', async function() {
|
||||
const tx = await mockCurveGaugeMapping.addGaugeMappings(['sbtc'], [mock.address], [true]);
|
||||
expectEvent(tx, "LogAddGaugeMapping");
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user