mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
cdb8bf01eb
adding constructor for MockSynthetix and passing mock for synthetix address;
32 lines
1.1 KiB
JavaScript
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);
|
|
});
|
|
})
|