Skip to content

Commit 0cc5355

Browse files
authored
chore: fix test isolate, different address for caller (#9663)
1 parent 192aa2c commit 0cc5355

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Diff for: testdata/default/cheats/RecordAccountAccesses.t.sol

+6-8
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,12 @@ contract RecordAccountAccessesTest is DSTest {
343343
// contract calls to self in constructor
344344
SelfCaller caller = new SelfCaller{value: 2 ether}("hello2 world2");
345345

346-
assertEq(
347-
"0x000000000000000000000000000000000000162e\n- balance diff: 0 \xE2\x86\x92 1000000000000000000\n\n0x1d1499e622D69689cdf9004d05Ec547d650Ff211\n- balance diff: 0 \xE2\x86\x92 2000000000000000000\n\n",
348-
cheats.getStateDiff()
349-
);
350-
assertEq(
351-
"{\"0x000000000000000000000000000000000000162e\":{\"label\":null,\"balanceDiff\":{\"previousValue\":\"0x0\",\"newValue\":\"0xde0b6b3a7640000\"},\"stateDiff\":{}},\"0x1d1499e622d69689cdf9004d05ec547d650ff211\":{\"label\":null,\"balanceDiff\":{\"previousValue\":\"0x0\",\"newValue\":\"0x1bc16d674ec80000\"},\"stateDiff\":{}}}",
352-
cheats.getStateDiffJson()
353-
);
346+
string memory callerAddress = cheats.toString(address(caller));
347+
string memory expectedStateDiff =
348+
"0x000000000000000000000000000000000000162e\n- balance diff: 0 \xE2\x86\x92 1000000000000000000\n\n";
349+
expectedStateDiff = string.concat(expectedStateDiff, callerAddress);
350+
expectedStateDiff = string.concat(expectedStateDiff, "\n- balance diff: 0 \xE2\x86\x92 2000000000000000000\n\n");
351+
assertEq(expectedStateDiff, cheats.getStateDiff());
354352

355353
Vm.AccountAccess[] memory called = filterExtcodesizeForLegacyTests(cheats.stopAndReturnStateDiff());
356354
assertEq(called.length, 6);

0 commit comments

Comments
 (0)