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

@ -9,7 +9,7 @@ contract('SafeCast', async function () {
this.safeCast = await SafeCast.new();
});
function testToUint (bits) {
function testToUint(bits) {
describe(`toUint${bits}`, () => {
const maxValue = new BN('2').pow(new BN(bits)).subn(1);
@ -60,21 +60,15 @@ contract('SafeCast', async function () {
});
it('reverts when casting -1', async function () {
await expectRevert(
this.safeCast.$toUint256(-1),
'SafeCast: value must be positive',
);
await expectRevert(this.safeCast.$toUint256(-1), 'SafeCast: value must be positive');
});
it(`reverts when casting INT256_MIN (${minInt256})`, async function () {
await expectRevert(
this.safeCast.$toUint256(minInt256),
'SafeCast: value must be positive',
);
await expectRevert(this.safeCast.$toUint256(minInt256), 'SafeCast: value must be positive');
});
});
function testToInt (bits) {
function testToInt(bits) {
describe(`toInt${bits}`, () => {
const minValue = new BN('-2').pow(new BN(bits - 1));
const maxValue = new BN('2').pow(new BN(bits - 1)).subn(1);
@ -148,17 +142,11 @@ contract('SafeCast', async function () {
});
it(`reverts when casting INT256_MAX + 1 (${maxInt256.addn(1)})`, async function () {
await expectRevert(
this.safeCast.$toInt256(maxInt256.addn(1)),
'SafeCast: value doesn\'t fit in an int256',
);
await expectRevert(this.safeCast.$toInt256(maxInt256.addn(1)), "SafeCast: value doesn't fit in an int256");
});
it(`reverts when casting UINT256_MAX (${maxUint256})`, async function () {
await expectRevert(
this.safeCast.$toInt256(maxUint256),
'SafeCast: value doesn\'t fit in an int256',
);
await expectRevert(this.safeCast.$toInt256(maxUint256), "SafeCast: value doesn't fit in an int256");
});
});
});