Skip to content

Commit c40c12c

Browse files
committed
chore: hardhat bump, draw test edge case
1 parent c279eff commit c40c12c

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

contracts/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@
129129
"gluegun": "^5.2.0",
130130
"graphql": "^16.9.0",
131131
"graphql-request": "^7.1.2",
132-
"hardhat": "2.26.2",
133-
"hardhat-contract-sizer": "^2.10.0",
132+
"hardhat": "2.26.3",
133+
"hardhat-contract-sizer": "^2.10.1",
134134
"hardhat-deploy": "^1.0.4",
135135
"hardhat-deploy-ethers": "^0.4.2",
136136
"hardhat-deploy-tenderly": "^0.2.1",
137137
"hardhat-docgen": "^1.3.0",
138138
"hardhat-gas-reporter": "^2.3.0",
139-
"hardhat-tracer": "^3.2.1",
139+
"hardhat-tracer": "^3.4.0",
140140
"hardhat-watcher": "^2.5.0",
141141
"pino": "^8.21.0",
142142
"pino-pretty": "^10.3.1",

contracts/test/foundry/KlerosCore_Drawing.t.sol

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {KlerosCore_TestBase} from "./KlerosCore_TestBase.sol";
55
import {KlerosCore} from "../../src/arbitration/KlerosCore.sol";
66
import {SortitionModule} from "../../src/arbitration/SortitionModule.sol";
77
import {ISortitionModule} from "../../src/arbitration/interfaces/ISortitionModule.sol";
8+
import {Vm} from "forge-std/Vm.sol";
89
import "../../src/libraries/Constants.sol";
910

1011
/// @title KlerosCore_DrawingTest
@@ -46,6 +47,22 @@ contract KlerosCore_DrawingTest is KlerosCore_TestBase {
4647
assertEq(choice, 0, "Choice should be empty");
4748
assertEq(voted, false, "Voted should be false");
4849
}
50+
51+
// Try drawing even more...
52+
vm.recordLogs();
53+
core.draw(disputeID, DEFAULT_NB_OF_JURORS); // Should not revert, nor draw any juror, nor change state.
54+
Vm.Log[] memory entries = vm.getRecordedLogs();
55+
56+
// Verify no Draw events were emitted
57+
bytes32 drawEventSignature = keccak256("Draw(address,uint256,uint256,uint256)");
58+
for (uint256 i = 0; i < entries.length; i++) {
59+
assertFalse(entries[i].topics[0] == drawEventSignature, "Draw event should not be emitted");
60+
}
61+
62+
assertEq(totalStaked, 1500, "Wrong amount total staked");
63+
assertEq(totalLocked, 3000, "Wrong amount locked");
64+
assertEq(stakedInCourt, 1500, "Wrong amount staked in court");
65+
assertEq(sortitionModule.disputesWithoutJurors(), 0, "Wrong disputesWithoutJurors count");
4966
}
5067

5168
function test_draw_noEmptyAddresses() public {

yarn.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6625,14 +6625,14 @@ __metadata:
66256625
gluegun: "npm:^5.2.0"
66266626
graphql: "npm:^16.9.0"
66276627
graphql-request: "npm:^7.1.2"
6628-
hardhat: "npm:2.26.2"
6629-
hardhat-contract-sizer: "npm:^2.10.0"
6628+
hardhat: "npm:2.26.3"
6629+
hardhat-contract-sizer: "npm:^2.10.1"
66306630
hardhat-deploy: "npm:^1.0.4"
66316631
hardhat-deploy-ethers: "npm:^0.4.2"
66326632
hardhat-deploy-tenderly: "npm:^0.2.1"
66336633
hardhat-docgen: "npm:^1.3.0"
66346634
hardhat-gas-reporter: "npm:^2.3.0"
6635-
hardhat-tracer: "npm:^3.2.1"
6635+
hardhat-tracer: "npm:^3.4.0"
66366636
hardhat-watcher: "npm:^2.5.0"
66376637
isomorphic-fetch: "npm:^3.0.0"
66386638
pino: "npm:^8.21.0"
@@ -22033,16 +22033,16 @@ __metadata:
2203322033
languageName: node
2203422034
linkType: hard
2203522035

22036-
"hardhat-contract-sizer@npm:^2.10.0":
22037-
version: 2.10.0
22038-
resolution: "hardhat-contract-sizer@npm:2.10.0"
22036+
"hardhat-contract-sizer@npm:^2.10.1":
22037+
version: 2.10.1
22038+
resolution: "hardhat-contract-sizer@npm:2.10.1"
2203922039
dependencies:
2204022040
chalk: "npm:^4.0.0"
2204122041
cli-table3: "npm:^0.6.0"
2204222042
strip-ansi: "npm:^6.0.0"
2204322043
peerDependencies:
2204422044
hardhat: ^2.0.0
22045-
checksum: 10/2b3011fe5333c2f1dbcfa6c73dcb1c61da9e2e045775c24bb773fe5f3ac14e9923907fef0e61fc2897e82a61997ce74e73baadb7f69dfdeccc86ae878cf67792
22045+
checksum: 10/521e985f0e6b5c1d06e38be8b374ae30f26ed6a72740ecfeeea1d8d5ee1341b98f699ed5587cc429e6de84da2c22df612e394ce492d393a4922702e82cc051f9
2204622046
languageName: node
2204722047
linkType: hard
2204822048

@@ -22143,9 +22143,9 @@ __metadata:
2214322143
languageName: node
2214422144
linkType: hard
2214522145

22146-
"hardhat-tracer@npm:^3.2.1":
22147-
version: 3.2.1
22148-
resolution: "hardhat-tracer@npm:3.2.1"
22146+
"hardhat-tracer@npm:^3.4.0":
22147+
version: 3.4.0
22148+
resolution: "hardhat-tracer@npm:3.4.0"
2214922149
dependencies:
2215022150
chalk: "npm:^4.1.2"
2215122151
debug: "npm:^4.3.4"
@@ -22154,7 +22154,7 @@ __metadata:
2215422154
peerDependencies:
2215522155
chai: 4.x
2215622156
hardhat: ">=2.22.5 <3.x"
22157-
checksum: 10/963afeb42c1ed30704877c3b521afc748e60042d218cef333fc11d3246f544267c303df0effc1e2a5cac9cc8a9ec744fda6ceb4e3fc156d3e17f4cfb766f6ab1
22157+
checksum: 10/cdbab3bc60b73156866b5fdc27486ef75894094f67382dad28f0868ab167116787c61d9ab430a61ac49fb1787a47da9281fb421e8dc6fefc9dd4fa7660ad3f60
2215822158
languageName: node
2215922159
linkType: hard
2216022160

@@ -22169,9 +22169,9 @@ __metadata:
2216922169
languageName: node
2217022170
linkType: hard
2217122171

22172-
"hardhat@npm:2.26.2":
22173-
version: 2.26.2
22174-
resolution: "hardhat@npm:2.26.2"
22172+
"hardhat@npm:2.26.3":
22173+
version: 2.26.3
22174+
resolution: "hardhat@npm:2.26.3"
2217522175
dependencies:
2217622176
"@ethereumjs/util": "npm:^9.1.0"
2217722177
"@ethersproject/abi": "npm:^5.1.2"
@@ -22222,7 +22222,7 @@ __metadata:
2222222222
optional: true
2222322223
bin:
2222422224
hardhat: internal/cli/bootstrap.js
22225-
checksum: 10/ef9f5f232264ed45a406a7053ccce71e67b0ce084de2de6fa2c24ff0bb1ec0d7b69f61769b3ac94a50445709b25bcf0d8ee135e1509e53331a3fea44d01cbb63
22225+
checksum: 10/77fabed0a9f5a5871bd071cd1eae3ce120ee878370a0d58e1a762fd49d01b68385b955c111d4a55147b1540333712ef36796fd5ee142e504aad17e2b2f746d6d
2222622226
languageName: node
2222722227
linkType: hard
2222822228

0 commit comments

Comments
 (0)