Skip to content

Commit 3fa2665

Browse files
Merge pull request #144 from threshold-network/slither-incorrect-equality
Cleaning up Slither and Linting - unblocking CI checks This PR cleans up existing code by linting a test file and disables "incorrect-equality" slither check for one of the `require` statements. These changes are needed to pass CI checks in other PR and currently is a blocker. For some reason, CI didn't catch linting and slither issues when the actual code was merged to the main branch here f468a7d
2 parents f468a7d + 41c8b9d commit 3fa2665

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

contracts/staking/TokenStaking.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
215215
}
216216

217217
modifier onlyOwnerOf(address stakingProvider) {
218+
// slither-disable-next-line incorrect-equality
218219
require(
219220
stakingProviders[stakingProvider].owner == msg.sender,
220221
"Caller is not owner"

test/staking/TokenStaking.test.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,9 +1379,7 @@ describe("TokenStaking", () => {
13791379
tx = await tokenStaking.stakeKeep(stakingProvider.address)
13801380

13811381
await nucypherStakingMock.setStaker(staker.address, nuStake)
1382-
await tokenStaking
1383-
.connect(staker)
1384-
.topUpNu(stakingProvider.address)
1382+
await tokenStaking.connect(staker).topUpNu(stakingProvider.address)
13851383

13861384
await tToken.connect(staker).approve(tokenStaking.address, tStake)
13871385
await tokenStaking
@@ -3537,9 +3535,7 @@ describe("TokenStaking", () => {
35373535
await tokenStaking
35383536
.connect(staker)
35393537
.unstakeNu(stakingProvider.address, nuInTAmount)
3540-
tx = await tokenStaking
3541-
.connect(staker)
3542-
.topUpNu(stakingProvider.address)
3538+
tx = await tokenStaking.connect(staker).topUpNu(stakingProvider.address)
35433539
})
35443540

35453541
it("should update only Nu staked amount", async () => {
@@ -3657,9 +3653,7 @@ describe("TokenStaking", () => {
36573653
blockTimestamp = await lastBlockTime()
36583654

36593655
await nucypherStakingMock.setStaker(staker.address, nuAmount)
3660-
tx = await tokenStaking
3661-
.connect(staker)
3662-
.topUpNu(stakingProvider.address)
3656+
tx = await tokenStaking.connect(staker).topUpNu(stakingProvider.address)
36633657
})
36643658

36653659
it("should update only Nu staked amount", async () => {

0 commit comments

Comments
 (0)