Skip to content

Commit

Permalink
Update the staked length functino name to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Apr 4, 2024
1 parent d3c8b55 commit 439f706
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/ethereum/contracts/StakingV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ return a
}
/* ~~~~~~~~~~ INFORMATIONAL ~~~~~~~~~~ */

function stakingPositionsLen(address _account) public view returns (uint) {
function stakedPositionsLen(address _account) public view returns (uint) {
return stakedStorage_[_account].length;
}

Expand Down
10 changes: 5 additions & 5 deletions contracts/ethereum/test/staking-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ describe("StakingV1", async () => {
expect(await stakingContract.callStatic.stake(amountStaked)).to.be.equal(amountStaked);
// then send on-chain to continue the life of the testing
await stakingContract.stake(amountStaked);
expect(await stakingContract.stakingPositionsLen(signerAddr)).to.be.equal(1);
expect(await stakingContract.stakedPositionsLen(signerAddr)).to.be.equal(1);
let { flyStaked } = await stakingContract.stakingDetails(signerAddr);
expect(flyStaked).to.be.equal(amountStaked);
const { flyRemaining } = await stakingContract.callStatic.beginUnstake(0);
Expand All @@ -1144,7 +1144,7 @@ describe("StakingV1", async () => {
.to.be.equal(amountStaked);

await stakingContract.stake(amountStaked);
expect(await stakingContract.stakingPositionsLen(signerAddr))
expect(await stakingContract.stakedPositionsLen(signerAddr))
.to.be.equal(1);

// now wait a seeminly random amount of time, get the points
Expand Down Expand Up @@ -1256,7 +1256,7 @@ describe("StakingV1", async () => {

// the amount of positions remaining should be equal to 2 since we
// closed the newest position.
expect(await stakingContract.stakingPositionsLen(signerAddr)).to.be.equal(2);
expect(await stakingContract.stakedPositionsLen(signerAddr)).to.be.equal(2);

({ flyStaked } = await stakingContract.stakingDetails(signerAddr));
expect(flyStaked).to.be.equal(s1.add(s2.sub(flyUnstake1)).add(s3));
Expand All @@ -1273,7 +1273,7 @@ describe("StakingV1", async () => {

({ flyStaked } = await stakingContract.stakingDetails(signerAddr));
expect(flyStaked).to.be.equal(s3);
expect(await stakingContract.stakingPositionsLen(signerAddr)).to.be.equal(1);
expect(await stakingContract.stakedPositionsLen(signerAddr)).to.be.equal(1);

/*
* unstake just 1 this time.
Expand All @@ -1287,7 +1287,7 @@ describe("StakingV1", async () => {

({ flyStaked } = await stakingContract.stakingDetails(signerAddr));
expect(flyStaked).to.be.equal(s3.sub(1));
expect(await stakingContract.stakingPositionsLen(signerAddr)).to.be.equal(1);
expect(await stakingContract.stakedPositionsLen(signerAddr)).to.be.equal(1);
});
});

Expand Down

0 comments on commit 439f706

Please sign in to comment.