Skip to content

Commit 225c4e2

Browse files
committed
Linting TokenStaking unit tests file
1 parent 6eaf4d5 commit 225c4e2

File tree

1 file changed

+78
-81
lines changed

1 file changed

+78
-81
lines changed

test/staking/TokenStaking.test.js

Lines changed: 78 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6637,7 +6637,7 @@ describe("TokenStaking", () => {
66376637
it("should add one slashing event", async () => {
66386638
expect(await tokenStaking.slashingQueue(0)).to.deep.equal([
66396639
stakingProvider.address,
6640-
amountToSlash
6640+
amountToSlash,
66416641
])
66426642
expect(await tokenStaking.getSlashingQueueLength()).to.equal(1)
66436643
})
@@ -7260,99 +7260,96 @@ describe("TokenStaking", () => {
72607260
})
72617261
})
72627262

7263-
context(
7264-
"when decrease authorized amount to zero",
7265-
() => {
7266-
const tAmount = initialStakerBalance
7263+
context("when decrease authorized amount to zero", () => {
7264+
const tAmount = initialStakerBalance
72677265

7268-
const amountToSlash = tAmount.div(3)
7269-
const authorized = amountToSlash
7266+
const amountToSlash = tAmount.div(3)
7267+
const authorized = amountToSlash
72707268

7271-
beforeEach(async () => {
7272-
await tokenStaking.connect(deployer).setAuthorizationCeiling(2)
7273-
await tokenStaking
7274-
.connect(deployer)
7275-
.approveApplication(application1Mock.address)
7276-
await tokenStaking
7277-
.connect(deployer)
7278-
.approveApplication(application2Mock.address)
7269+
beforeEach(async () => {
7270+
await tokenStaking.connect(deployer).setAuthorizationCeiling(2)
7271+
await tokenStaking
7272+
.connect(deployer)
7273+
.approveApplication(application1Mock.address)
7274+
await tokenStaking
7275+
.connect(deployer)
7276+
.approveApplication(application2Mock.address)
72797277

7280-
await tToken.connect(staker).approve(tokenStaking.address, tAmount)
7281-
await tokenStaking
7282-
.connect(staker)
7283-
.stake(
7284-
stakingProvider.address,
7285-
staker.address,
7286-
staker.address,
7287-
tAmount
7288-
)
7289-
await tokenStaking
7290-
.connect(staker)
7291-
.increaseAuthorization(
7292-
stakingProvider.address,
7293-
application2Mock.address,
7294-
authorized
7295-
)
7296-
await tokenStaking
7297-
.connect(staker)
7298-
.increaseAuthorization(
7299-
stakingProvider.address,
7300-
application1Mock.address,
7301-
authorized
7302-
)
7278+
await tToken.connect(staker).approve(tokenStaking.address, tAmount)
7279+
await tokenStaking
7280+
.connect(staker)
7281+
.stake(
7282+
stakingProvider.address,
7283+
staker.address,
7284+
staker.address,
7285+
tAmount
7286+
)
7287+
await tokenStaking
7288+
.connect(staker)
7289+
.increaseAuthorization(
7290+
stakingProvider.address,
7291+
application2Mock.address,
7292+
authorized
7293+
)
7294+
await tokenStaking
7295+
.connect(staker)
7296+
.increaseAuthorization(
7297+
stakingProvider.address,
7298+
application1Mock.address,
7299+
authorized
7300+
)
73037301

7304-
await application1Mock.slash(amountToSlash, [stakingProvider.address])
7302+
await application1Mock.slash(amountToSlash, [stakingProvider.address])
73057303

7306-
await tokenStaking.processSlashing(1)
7307-
})
7304+
await tokenStaking.processSlashing(1)
7305+
})
73087306

7309-
it("should decrease authorized amount", async () => {
7310-
expect(
7311-
await tokenStaking.authorizedStake(
7312-
stakingProvider.address,
7313-
application1Mock.address
7314-
)
7315-
).to.equal(0)
7316-
expect(
7317-
await tokenStaking.authorizedStake(
7318-
stakingProvider.address,
7319-
application2Mock.address
7320-
)
7321-
).to.equal(0)
7322-
})
7307+
it("should decrease authorized amount", async () => {
7308+
expect(
7309+
await tokenStaking.authorizedStake(
7310+
stakingProvider.address,
7311+
application1Mock.address
7312+
)
7313+
).to.equal(0)
7314+
expect(
7315+
await tokenStaking.authorizedStake(
7316+
stakingProvider.address,
7317+
application2Mock.address
7318+
)
7319+
).to.equal(0)
7320+
})
73237321

7324-
it("should allow to authorize one more application", async () => {
7325-
await tokenStaking
7326-
.connect(staker)
7327-
.increaseAuthorization(
7328-
stakingProvider.address,
7329-
application1Mock.address,
7330-
authorized
7331-
)
7322+
it("should allow to authorize one more application", async () => {
7323+
await tokenStaking
7324+
.connect(staker)
7325+
.increaseAuthorization(
7326+
stakingProvider.address,
7327+
application1Mock.address,
7328+
authorized
7329+
)
73327330

7333-
await tokenStaking
7331+
await tokenStaking
7332+
.connect(staker)
7333+
.increaseAuthorization(
7334+
stakingProvider.address,
7335+
application2Mock.address,
7336+
authorized
7337+
)
7338+
7339+
await tokenStaking
7340+
.connect(deployer)
7341+
.approveApplication(auxiliaryAccount.address)
7342+
await expect(
7343+
tokenStaking
73347344
.connect(staker)
73357345
.increaseAuthorization(
73367346
stakingProvider.address,
7337-
application2Mock.address,
7347+
auxiliaryAccount.address,
73387348
authorized
73397349
)
7340-
7341-
await tokenStaking
7342-
.connect(deployer)
7343-
.approveApplication(auxiliaryAccount.address)
7344-
await expect(
7345-
tokenStaking
7346-
.connect(staker)
7347-
.increaseAuthorization(
7348-
stakingProvider.address,
7349-
auxiliaryAccount.address,
7350-
authorized
7351-
)
7352-
).to.be.revertedWith("Too many applications")
7353-
})
7354-
}
7355-
)
7350+
).to.be.revertedWith("Too many applications")
7351+
})
7352+
})
73567353
})
73577354

73587355
describe("cleanAuthorizedApplications", () => {

0 commit comments

Comments
 (0)