Use Prettier for JS files (#3913)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
const { expectRevert } = require('@openzeppelin/test-helpers');
|
||||
const { BridgeHelper } = require('../helpers/crosschain');
|
||||
|
||||
const {
|
||||
DEFAULT_ADMIN_ROLE,
|
||||
shouldBehaveLikeAccessControl,
|
||||
} = require('./AccessControl.behavior.js');
|
||||
const { DEFAULT_ADMIN_ROLE, shouldBehaveLikeAccessControl } = require('./AccessControl.behavior.js');
|
||||
|
||||
const crossChainRoleAlias = (role) => web3.utils.leftPad(
|
||||
web3.utils.toHex(web3.utils.toBN(role).xor(web3.utils.toBN(web3.utils.soliditySha3('CROSSCHAIN_ALIAS')))),
|
||||
64,
|
||||
);
|
||||
const crossChainRoleAlias = role =>
|
||||
web3.utils.leftPad(
|
||||
web3.utils.toHex(web3.utils.toBN(role).xor(web3.utils.toBN(web3.utils.soliditySha3('CROSSCHAIN_ALIAS')))),
|
||||
64,
|
||||
);
|
||||
|
||||
const AccessControlCrossChainMock = artifacts.require('$AccessControlCrossChainMock');
|
||||
|
||||
@ -39,23 +37,13 @@ contract('AccessControl', function (accounts) {
|
||||
|
||||
it('Crosschain calls not authorized to non-aliased addresses', async function () {
|
||||
await expectRevert(
|
||||
this.bridge.call(
|
||||
accounts[0],
|
||||
this.accessControl,
|
||||
'$_checkRole(bytes32)',
|
||||
[ ROLE ],
|
||||
),
|
||||
this.bridge.call(accounts[0], this.accessControl, '$_checkRole(bytes32)', [ROLE]),
|
||||
`AccessControl: account ${accounts[0].toLowerCase()} is missing role ${crossChainRoleAlias(ROLE)}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('Crosschain calls not authorized to non-aliased addresses', async function () {
|
||||
await this.bridge.call(
|
||||
accounts[1],
|
||||
this.accessControl,
|
||||
'$_checkRole(bytes32)',
|
||||
[ ROLE ],
|
||||
);
|
||||
await this.bridge.call(accounts[1], this.accessControl, '$_checkRole(bytes32)', [ROLE]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user