Use Prettier for JS files (#3913)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Francisco
2023-01-04 11:03:40 -03:00
committed by GitHub
parent 88754d0b36
commit a28aafdc85
135 changed files with 2737 additions and 3121 deletions

View File

@ -5,7 +5,7 @@ const { expect } = require('chai');
const PausableMock = artifacts.require('PausableMock');
contract('Pausable', function (accounts) {
const [ pauser ] = accounts;
const [pauser] = accounts;
beforeEach(async function () {
this.pausable = await PausableMock.new();
@ -24,15 +24,13 @@ contract('Pausable', function (accounts) {
});
it('cannot take drastic measure in non-pause', async function () {
await expectRevert(this.pausable.drasticMeasure(),
'Pausable: not paused',
);
await expectRevert(this.pausable.drasticMeasure(), 'Pausable: not paused');
expect(await this.pausable.drasticMeasureTaken()).to.equal(false);
});
context('when paused', function () {
beforeEach(async function () {
(this.receipt = await this.pausable.pause({ from: pauser }));
this.receipt = await this.pausable.pause({ from: pauser });
});
it('emits a Paused event', function () {
@ -60,7 +58,7 @@ contract('Pausable', function (accounts) {
context('when unpaused', function () {
beforeEach(async function () {
(this.receipt = await this.pausable.unpause({ from: pauser }));
this.receipt = await this.pausable.unpause({ from: pauser });
});
it('emits an Unpaused event', function () {
@ -74,9 +72,7 @@ contract('Pausable', function (accounts) {
});
it('should prevent drastic measure', async function () {
await expectRevert(this.pausable.drasticMeasure(),
'Pausable: not paused',
);
await expectRevert(this.pausable.drasticMeasure(), 'Pausable: not paused');
});
it('reverts when re-unpausing', async function () {

View File

@ -5,7 +5,7 @@ const { expect } = require('chai');
const PullPaymentMock = artifacts.require('PullPaymentMock');
contract('PullPayment', function (accounts) {
const [ payer, payee1, payee2 ] = accounts;
const [payer, payee1, payee2] = accounts;
const amount = ether('17');

View File

@ -19,8 +19,7 @@ contract('ReentrancyGuard', function () {
it('does not allow remote callback', async function () {
const attacker = await ReentrancyAttack.new();
await expectRevert(
this.reentrancyMock.countAndCall(attacker.address), 'ReentrancyAttack: failed call');
await expectRevert(this.reentrancyMock.countAndCall(attacker.address), 'ReentrancyAttack: failed call');
});
it('_reentrancyGuardEntered should be true when guarded', async function () {
@ -35,14 +34,10 @@ contract('ReentrancyGuard', function () {
// I put them here as documentation, and to monitor any changes
// in the side-effects.
it('does not allow local recursion', async function () {
await expectRevert(
this.reentrancyMock.countLocalRecursive(10), 'ReentrancyGuard: reentrant call',
);
await expectRevert(this.reentrancyMock.countLocalRecursive(10), 'ReentrancyGuard: reentrant call');
});
it('does not allow indirect local recursion', async function () {
await expectRevert(
this.reentrancyMock.countThisRecursive(10), 'ReentrancyMock: failed call',
);
await expectRevert(this.reentrancyMock.countThisRecursive(10), 'ReentrancyMock: failed call');
});
});