Skip to content

Commit f1ec484

Browse files
fix(SM): shadow var
1 parent 1ec4e02 commit f1ec484

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

contracts/src/arbitration/SortitionModule.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ contract SortitionModule is ISortitionModule, Initializable, UUPSProxiable {
560560
/// @dev Gets the balance of a juror in a court.
561561
/// @param _juror The address of the juror.
562562
/// @param _courtID The ID of the court.
563-
/// @return totalStaked The total amount of tokens staked including locked tokens and penalty deductions. Equivalent to the effective stake in the General court.
563+
/// @return totalStakedPnk The total amount of tokens staked including locked tokens and penalty deductions. Equivalent to the effective stake in the General court.
564564
/// @return totalLocked The total amount of tokens locked in disputes.
565565
/// @return stakedInCourt The amount of tokens staked in the specified court including locked tokens and penalty deductions.
566566
/// @return nbCourts The number of courts the juror has directly staked in.
@@ -571,10 +571,10 @@ contract SortitionModule is ISortitionModule, Initializable, UUPSProxiable {
571571
external
572572
view
573573
override
574-
returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)
574+
returns (uint256 totalStakedPnk, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)
575575
{
576576
Juror storage juror = jurors[_juror];
577-
totalStaked = juror.stakedPnk;
577+
totalStakedPnk = juror.stakedPnk;
578578
totalLocked = juror.lockedPnk;
579579
stakedInCourt = stakeOf(_juror, _courtID);
580580
nbCourts = juror.courtIDs.length;

contracts/test/integration/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,28 @@ describe("Integration tests", async () => {
7676

7777
await core.setStake(1, ONE_THOUSAND_PNK);
7878
await sortitionModule.getJurorBalance(deployer, 1).then((result) => {
79-
expect(result.totalStaked).to.equal(ONE_THOUSAND_PNK);
79+
expect(result.totalStakedPnk).to.equal(ONE_THOUSAND_PNK);
8080
expect(result.totalLocked).to.equal(0);
8181
logJurorBalance(result);
8282
});
8383

8484
await core.setStake(1, ONE_HUNDRED_PNK * 5n);
8585
await sortitionModule.getJurorBalance(deployer, 1).then((result) => {
86-
expect(result.totalStaked).to.equal(ONE_HUNDRED_PNK * 5n);
86+
expect(result.totalStakedPnk).to.equal(ONE_HUNDRED_PNK * 5n);
8787
expect(result.totalLocked).to.equal(0);
8888
logJurorBalance(result);
8989
});
9090

9191
await core.setStake(1, 0);
9292
await sortitionModule.getJurorBalance(deployer, 1).then((result) => {
93-
expect(result.totalStaked).to.equal(0);
93+
expect(result.totalStakedPnk).to.equal(0);
9494
expect(result.totalLocked).to.equal(0);
9595
logJurorBalance(result);
9696
});
9797

9898
await core.setStake(1, ONE_THOUSAND_PNK * 4n);
9999
await sortitionModule.getJurorBalance(deployer, 1).then((result) => {
100-
expect(result.totalStaked).to.equal(ONE_THOUSAND_PNK * 4n);
100+
expect(result.totalStakedPnk).to.equal(ONE_THOUSAND_PNK * 4n);
101101
expect(result.totalLocked).to.equal(0);
102102
logJurorBalance(result);
103103
});
@@ -203,6 +203,10 @@ describe("Integration tests", async () => {
203203
};
204204
});
205205

206-
const logJurorBalance = async (result: { totalStaked: bigint; totalLocked: bigint }) => {
207-
console.log("staked=%s, locked=%s", ethers.formatUnits(result.totalStaked), ethers.formatUnits(result.totalLocked));
206+
const logJurorBalance = async (result: { totalStakedPnk: bigint; totalLocked: bigint }) => {
207+
console.log(
208+
"staked=%s, locked=%s",
209+
ethers.formatUnits(result.totalStakedPnk),
210+
ethers.formatUnits(result.totalLocked)
211+
);
208212
};

0 commit comments

Comments
 (0)