Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to get SNX in integration tests #1303

Merged
merged 2 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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