No longer assigning awaits to temporary variables. (#1216)

This commit is contained in:
Nicolás Venturo
2018-08-17 16:10:40 -03:00
committed by GitHub
parent df9426f989
commit 20cf885430
43 changed files with 231 additions and 467 deletions

View File

@ -15,18 +15,15 @@ contract('Superuser', function ([_, firstOwner, newSuperuser, newOwner, anyone])
context('in normal conditions', () => {
it('should set the owner as the default superuser', async function () {
const ownerIsSuperuser = await this.superuser.isSuperuser(firstOwner);
ownerIsSuperuser.should.be.equal(true);
(await this.superuser.isSuperuser(firstOwner)).should.be.be.true;
});
it('should change superuser after transferring', async function () {
await this.superuser.transferSuperuser(newSuperuser, { from: firstOwner });
const ownerIsSuperuser = await this.superuser.isSuperuser(firstOwner);
ownerIsSuperuser.should.be.equal(false);
(await this.superuser.isSuperuser(firstOwner)).should.be.be.false;
const newSuperuserIsSuperuser = await this.superuser.isSuperuser(newSuperuser);
newSuperuserIsSuperuser.should.be.equal(true);
(await this.superuser.isSuperuser(newSuperuser)).should.be.be.true;
});
it('should prevent changing to a null superuser', async function () {
@ -43,8 +40,7 @@ contract('Superuser', function ([_, firstOwner, newSuperuser, newOwner, anyone])
'OwnershipTransferred'
);
const currentOwner = await this.superuser.owner();
currentOwner.should.be.equal(newOwner);
(await this.superuser.owner()).should.equal(newOwner);
});
it('should change owner after the owner transfers the ownership', async function () {
@ -53,8 +49,7 @@ contract('Superuser', function ([_, firstOwner, newSuperuser, newOwner, anyone])
'OwnershipTransferred'
);
const currentOwner = await this.superuser.owner();
currentOwner.should.be.equal(newOwner);
(await this.superuser.owner()).should.equal(newOwner);
});
});