Skip to content

Commit

Permalink
Update infra files for test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
RCantu92 committed May 14, 2024
1 parent 13a69ca commit 3688bf3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions scripts/deployments/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ async function migrate(config = {}) {

DEBUG(`[${Object.keys(contracts).length}] forta: ${contracts.token.address}`);

contracts.generalStaking = await contractHelpers.tryFetchProxy(
hre,
'GeneralFortaStakingVault',
'uups',
[deployer.address, contracts.token.address, deployEnv.TREASURY(chainId, deployer)],
{
constructorArgs: [],
unsafeAllow: ['delegatecall'],
},
CACHE
);

DEBUG(`[${Object.keys(contracts).length}] forta: ${contracts.generalStaking.address}`);

if (config.childChain || chainId === 31337) {
contracts.access = await contractHelpers.tryFetchProxy(
hre,
Expand Down
3 changes: 2 additions & 1 deletion test/fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function prepare(config = {}) {
// list signers
this.accounts = await ethers.getSigners();
this.accounts.getAccount = (name) => this.accounts[name] || (this.accounts[name] = this.accounts.shift());
['admin', 'manager', 'minter', 'treasure', 'user1', 'user2', 'user3', 'other'].map((name) => this.accounts.getAccount(name));
['admin', 'manager', 'minter', 'treasure', 'user1', 'user2', 'user3', 'other', 'slasher'].map((name) => this.accounts.getAccount(name));

// migrate
await migrate(
Expand Down Expand Up @@ -50,6 +50,7 @@ function prepare(config = {}) {
this.access.connect(this.accounts.admin).grantRole(this.roles.MIGRATION_EXECUTOR, this.accounts.manager.address),
this.token.connect(this.accounts.admin).grantRole(this.roles.MINTER, this.accounts.minter.address),
this.otherToken.connect(this.accounts.admin).grantRole(this.roles.MINTER, this.accounts.minter.address),
this.generalStaking.connect(this.accounts.admin).grantRole(this.roles.SLASHER, this.accounts.slasher.address),
].map((txPromise) => txPromise.then((tx) => tx.wait()).catch(() => {}))
);

Expand Down

0 comments on commit 3688bf3

Please sign in to comment.