dsa-connectors-old/test/SynthetixProtocol.js
Lecky Lao cdb8bf01eb created Mocks and MockSynthetix;
adding constructor for MockSynthetix and passing mock for synthetix address;
2020-07-10 01:08:08 +10:00

32 lines
1.1 KiB
JavaScript

const {
BN, // Big Number support
expectEvent, // Assertions for emitted events
expectRevert, // Assertions for transactions that should fail
balance,
ether
} = require('@openzeppelin/test-helpers');
const MockContract = artifacts.require("MockContract");
const MockSynthetixStaking = artifacts.require('MockSynthetixStaking');
const erc20ABI = require("./abi/erc20.js");
contract('ConnectSynthetixStaking', async accounts => {
const [sender, receiver] = accounts;
const mock = await MockContract.deployed();
const mockSynthetixStaking = await MockSynthetixStaking.deployed();
const crvRenWSBTCContract = new web3.eth.Contract(erc20ABI, mock.address);
before(async function () {
let methodId = await crvRenWSBTCContract.methods.balanceOf(sender).encodeABI();
await mock.givenMethodReturnUint(methodId, 10000000);
let crvRenWSBTC = await crvRenWSBTCContract.methods.balanceOf(sender).call();
expect(crvRenWSBTC).to.equal("10000000");
})
it('can mock token', async function() {
// expect(wbtcAfter - wbtcBefore).to.be.at.least(10000000);
});
})