mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
WIP having InternalCompilerError;
formating synthetic.sol and staking.sol; Adding MockInstaMapping; update test;
This commit is contained in:
parent
819fead058
commit
df61aebc58
|
|
@ -34,7 +34,7 @@ contract SynthetixStakingHelper is DSMath, Stores {
|
|||
/**
|
||||
* @dev Return Synthetix Token address.
|
||||
*/
|
||||
function getSnxAddr() internal pure returns (address) {
|
||||
function getSnxAddr() virtual internal view returns (address) {
|
||||
return 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F;
|
||||
}
|
||||
|
||||
|
|
@ -53,6 +53,7 @@ contract SynthetixStakingHelper is DSMath, Stores {
|
|||
* @dev Get staking data
|
||||
*/
|
||||
function getStakingData(string memory stakingName)
|
||||
virtual
|
||||
internal
|
||||
view
|
||||
returns (
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ contract Helpers is BytesHelper {
|
|||
event LogAddStakingMapping(string stakingName, bytes32 stakingType, address stakingAddress, address stakingToken);
|
||||
event LogRemoveStakingMapping(string stakingName, bytes32 stakingType, address stakingAddress, address stakingToken);
|
||||
|
||||
modifier isChief {
|
||||
modifier isChief virtual {
|
||||
require(
|
||||
ConnectorsInterface(connectors).chief(msg.sender) ||
|
||||
IndexInterface(instaIndex).master() == msg.sender, "not-Chief");
|
||||
|
|
|
|||
7
contracts/tests/MockInstaMapping.sol
Normal file
7
contracts/tests/MockInstaMapping.sol
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
pragma solidity ^0.6.0;
|
||||
|
||||
import { InstaMapping } from "../mapping/staking.sol";
|
||||
|
||||
contract MockInstaMapping is InstaMapping {
|
||||
modifier isChief override {_;}
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@ contract MockSynthetixStaking is ConnectSynthetixStaking{
|
|||
synthetixStakingAddr = _synthetixStakingAddr;
|
||||
}
|
||||
|
||||
function getSynthetixStakingAddr(address token) override internal returns (address) {
|
||||
return synthetixStakingAddr;
|
||||
}
|
||||
// function getSynthetixStakingAddr(address token) override internal returns (address) {
|
||||
// return synthetixStakingAddr;
|
||||
// }
|
||||
|
||||
function emitEvent(bytes32 eventCode, bytes memory eventData) override internal {}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,20 +8,22 @@ const {
|
|||
|
||||
const MockContract = artifacts.require("MockContract");
|
||||
const MockSynthetixStaking = artifacts.require('MockSynthetixStaking');
|
||||
// const ConnectSynthetixStaking = artifacts.require('ConnectSynthetixStaking');
|
||||
const MockInstaMapping = artifacts.require('MockInstaMapping');
|
||||
const erc20ABI = require("./abi/erc20.js");
|
||||
const synthetixStaking = require("./abi/synthetixStaking.json");
|
||||
|
||||
contract('ConnectSynthetixStaking', async accounts => {
|
||||
const [sender, receiver] = accounts;
|
||||
let mock, mockSynthetixStaking, stakingContract, token;
|
||||
let instaMapping;
|
||||
|
||||
before(async function () {
|
||||
// const connectSynthetixStaking = await ConnectSynthetixStaking.deployed();
|
||||
mock = await MockContract.new();
|
||||
mockInstaMapping = await MockInstaMapping.new();
|
||||
mockSynthetixStaking = await MockSynthetixStaking.new(mock.address);
|
||||
stakingContract = new web3.eth.Contract(synthetixStaking, mock.address);
|
||||
token = new web3.eth.Contract(erc20ABI, mock.address);
|
||||
mockInstaMapping.addStakingMapping('snx', mock.address, mock.address);
|
||||
|
||||
// mocking balanceOf
|
||||
let balanceOf = await token.methods.balanceOf(mockSynthetixStaking.address).encodeABI();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user