Skip to content

Commit 4574b10

Browse files
authored
fix(entropy): fix calls to expectEmit (#2631)
Update the expectEmit calls to test all topics and data. These were previously only testing the data field. This is going to conflict with the other outstanding PR but I'll resolve that depending on which gets approved first.
1 parent 0f779e5 commit 4574b10

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

target_chains/ethereum/contracts/forge-test/Entropy.t.sol

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
794794
vm.roll(1234);
795795
vm.deal(user1, fee);
796796
vm.startPrank(user1);
797-
vm.expectEmit(false, false, false, true, address(random));
797+
vm.expectEmit(true, true, true, true, address(random));
798798
emit RequestedWithCallback(
799799
provider1,
800800
user1,
@@ -819,7 +819,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
819819
isRequestWithCallback: true
820820
})
821821
);
822-
vm.expectEmit(false, false, false, true, address(random));
822+
vm.expectEmit(true, true, true, true, address(random));
823823
emit EntropyEventsV2.Requested(
824824
provider1,
825825
user1,
@@ -866,7 +866,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
866866
assignedSequenceNumber
867867
);
868868

869-
vm.expectEmit(false, false, false, true, address(random));
869+
vm.expectEmit(true, true, true, true, address(random));
870870
emit RevealedWithCallback(
871871
EntropyStructConverter.toV1Request(req),
872872
userRandomNumber,
@@ -877,7 +877,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
877877
0
878878
)
879879
);
880-
vm.expectEmit(false, false, false, true, address(random));
880+
vm.expectEmit(true, true, true, true, address(random));
881881
emit EntropyEventsV2.Revealed(
882882
provider1,
883883
req.requester,
@@ -933,7 +933,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
933933
assignedSequenceNumber
934934
);
935935

936-
vm.expectEmit(false, false, false, true, address(random));
936+
vm.expectEmit(true, true, true, true, address(random));
937937
emit RevealedWithCallback(
938938
EntropyStructConverter.toV1Request(req),
939939
userRandomNumber,
@@ -944,7 +944,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
944944
0
945945
)
946946
);
947-
vm.expectEmit(false, false, false, true, address(random));
947+
vm.expectEmit(true, true, true, true, address(random));
948948
emit EntropyEventsV2.Revealed(
949949
provider1,
950950
req.requester,
@@ -1030,7 +1030,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
10301030
// Verify the gas limit was set correctly
10311031
assertEq(req.gasLimit10k, 10);
10321032

1033-
vm.expectEmit(false, false, false, true, address(random));
1033+
vm.expectEmit(true, true, true, true, address(random));
10341034
emit RevealedWithCallback(
10351035
EntropyStructConverter.toV1Request(req),
10361036
userRandomNumber,
@@ -1041,7 +1041,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
10411041
0
10421042
)
10431043
);
1044-
vm.expectEmit(false, false, false, true, address(random));
1044+
vm.expectEmit(true, true, true, true, address(random));
10451045
emit EntropyEventsV2.Revealed(
10461046
provider1,
10471047
req.requester,
@@ -1099,7 +1099,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
10991099
0x08c379a0,
11001100
"Callback failed"
11011101
);
1102-
vm.expectEmit(false, false, false, true, address(random));
1102+
vm.expectEmit(true, true, true, true, address(random));
11031103
emit CallbackFailed(
11041104
provider1,
11051105
address(consumer),
@@ -1113,7 +1113,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
11131113
),
11141114
revertReason
11151115
);
1116-
vm.expectEmit(false, false, false, true, address(random));
1116+
vm.expectEmit(true, true, true, true, address(random));
11171117
emit EntropyEventsV2.Revealed(
11181118
provider1,
11191119
address(consumer),
@@ -1167,7 +1167,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
11671167

11681168
// If the callback starts succeeding, we can invoke it and it emits the usual RevealedWithCallback event.
11691169
consumer.setReverts(false);
1170-
vm.expectEmit(false, false, false, true, address(random));
1170+
vm.expectEmit(true, true, true, true, address(random));
11711171
emit RevealedWithCallback(
11721172
EntropyStructConverter.toV1Request(reqAfterFailure),
11731173
userRandomNumber,
@@ -1178,7 +1178,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
11781178
0
11791179
)
11801180
);
1181-
vm.expectEmit(false, false, false, true, address(random));
1181+
vm.expectEmit(true, true, true, true, address(random));
11821182
emit EntropyEventsV2.Revealed(
11831183
provider1,
11841184
reqAfterFailure.requester,
@@ -1243,7 +1243,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
12431243

12441244
// If called with enough gas, the transaction should succeed, but the callback should fail because
12451245
// it uses too much gas.
1246-
vm.expectEmit(false, false, false, true, address(random));
1246+
vm.expectEmit(true, true, true, true, address(random));
12471247
emit CallbackFailed(
12481248
provider1,
12491249
address(consumer),
@@ -1258,7 +1258,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
12581258
// out-of-gas reverts have an empty bytes array as the return value.
12591259
""
12601260
);
1261-
vm.expectEmit(false, false, false, true, address(random));
1261+
vm.expectEmit(true, true, true, true, address(random));
12621262
emit EntropyEventsV2.Revealed(
12631263
provider1,
12641264
address(consumer),
@@ -1311,7 +1311,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
13111311
);
13121312

13131313
// Calling without a gas limit should succeed
1314-
vm.expectEmit(false, false, false, true, address(random));
1314+
vm.expectEmit(true, true, true, true, address(random));
13151315
emit RevealedWithCallback(
13161316
EntropyStructConverter.toV1Request(reqAfterFailure),
13171317
userRandomNumber,
@@ -1322,7 +1322,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
13221322
0
13231323
)
13241324
);
1325-
vm.expectEmit(false, false, false, true, address(random));
1325+
vm.expectEmit(true, true, true, true, address(random));
13261326
emit EntropyEventsV2.Revealed(
13271327
provider1,
13281328
address(consumer),
@@ -1576,9 +1576,9 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
15761576
uint32 newGasLimit = 100000;
15771577

15781578
vm.prank(provider1);
1579-
vm.expectEmit(false, false, false, true, address(random));
1579+
vm.expectEmit(true, true, true, true, address(random));
15801580
emit ProviderDefaultGasLimitUpdated(provider1, 0, newGasLimit);
1581-
vm.expectEmit(false, false, false, true, address(random));
1581+
vm.expectEmit(true, true, true, true, address(random));
15821582
emit EntropyEventsV2.ProviderDefaultGasLimitUpdated(
15831583
provider1,
15841584
0,
@@ -1787,7 +1787,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
17871787
);
17881788

17891789
if (!expectSuccess) {
1790-
vm.expectEmit(false, false, false, true, address(random));
1790+
vm.expectEmit(true, true, true, true, address(random));
17911791
emit CallbackFailed(
17921792
provider1,
17931793
address(consumer),
@@ -1802,7 +1802,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
18021802
// out-of-gas reverts have an empty bytes array as the return value.
18031803
""
18041804
);
1805-
vm.expectEmit(false, false, false, true, address(random));
1805+
vm.expectEmit(true, true, true, true, address(random));
18061806
emit EntropyEventsV2.Revealed(
18071807
provider1,
18081808
address(consumer),
@@ -1832,7 +1832,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
18321832
EntropyStatusConstants.CALLBACK_FAILED
18331833
);
18341834
} else {
1835-
vm.expectEmit(false, false, false, true, address(random));
1835+
vm.expectEmit(true, true, true, true, address(random));
18361836
emit RevealedWithCallback(
18371837
EntropyStructConverter.toV1Request(req),
18381838
userRandomNumber,
@@ -1843,7 +1843,7 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
18431843
0
18441844
)
18451845
);
1846-
vm.expectEmit(false, false, false, true, address(random));
1846+
vm.expectEmit(true, true, true, true, address(random));
18471847
emit EntropyEventsV2.Revealed(
18481848
provider1,
18491849
req.requester,

0 commit comments

Comments
 (0)