Skip to content

Commit

Permalink
Better way to get SNX in integration tests (#1303)
Browse files Browse the repository at this point in the history
* Better way to get SNX

* 2192
  • Loading branch information
eternauta1337 authored May 31, 2021
1 parent 704c3ec commit 4081f23
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 67 deletions.
1 change: 0 additions & 1 deletion contracts/MintableSynthetix.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ contract MintableSynthetix is BaseSynthetix {
) public BaseSynthetix(_proxy, _tokenState, _owner, _totalSupply, _resolver) {}

/* ========== INTERNALS =================== */

function _mintSecondary(address account, uint amount) internal {
tokenState.setBalanceOf(account, tokenState.balanceOf(account).add(amount));
emitTransfer(address(this), account, amount);
Expand Down
1 change: 0 additions & 1 deletion hardhat/tasks/task-test-integration-l2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ task('test:integration:l2', 'run isolated layer 2 production tests')
if (taskArguments.deploy) {
await deployInstance({
useOvm: true,
ignoreCustomParameters: true,
providerUrl,
providerPort,
});
Expand Down
71 changes: 41 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions test/integration/behaviors/erc20.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ const { assert } = require('../../contracts/common');

function itBehavesLikeAnERC20({ ctx }) {
describe('erc20 functionality', () => {
let user;
let owner, user;
let Synthetix;

let userBalance;

const amountToTransfer = ethers.utils.parseEther('1');

before('target contracts and users', () => {
({ Synthetix } = ctx.contracts);

owner = ctx.users.owner;
user = ctx.users.someUser;
});

Expand All @@ -19,10 +22,8 @@ function itBehavesLikeAnERC20({ ctx }) {
});

describe('when the owner transfers SNX to the user', () => {
const amountToTransfer = ethers.utils.parseEther('1');

before('transfer', async () => {
Synthetix = Synthetix.connect(ctx.users.owner);
Synthetix = Synthetix.connect(owner);

const tx = await Synthetix.transfer(user.address, amountToTransfer);
await tx.wait();
Expand Down
5 changes: 0 additions & 5 deletions test/integration/dual/withdraw.integration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const ethers = require('ethers');
const { assert } = require('../../contracts/common');
const { bootstrapDual } = require('../utils/bootstrap');
const { ensureBalance } = require('../utils/balances');
const { finalizationOnL1 } = require('../utils/watchers');

describe('withdraw() integration tests (L1, L2)', () => {
Expand All @@ -24,10 +23,6 @@ describe('withdraw() integration tests (L1, L2)', () => {
owner = ctx.l2.users.owner;
});

before('ensure the owner has SNX on L2', async () => {
await ensureBalance({ ctx: ctx.l2, symbol: 'SNX', user: owner, balance: amountToWithdraw });
});

before('record balances', async () => {
ownerBalance = await Synthetix.balanceOf(owner.address);
});
Expand Down
5 changes: 0 additions & 5 deletions test/integration/dual/withdrawTo.integration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const ethers = require('ethers');
const { assert } = require('../../contracts/common');
const { bootstrapDual } = require('../utils/bootstrap');
const { ensureBalance } = require('../utils/balances');
const { finalizationOnL1 } = require('../utils/watchers');

describe('withdrawTo() integration tests (L1, L2)', () => {
Expand All @@ -25,10 +24,6 @@ describe('withdrawTo() integration tests (L1, L2)', () => {
user = ctx.l2.users.someUser;
});

before('ensure the owner has SNX on L2', async () => {
await ensureBalance({ ctx: ctx.l2, symbol: 'SNX', user: owner, balance: amountToWithdraw });
});

before('record balances', async () => {
ownerBalance = await Synthetix.balanceOf(owner.address);
});
Expand Down
Loading

0 comments on commit 4081f23

Please sign in to comment.