Skip to content

Commit a30484c

Browse files
committed
fix: call inputs
1 parent 08a8203 commit a30484c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test-cases/precompiles/CallInputs.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,27 @@ contract TestCallInputs is Assertion, Test {
5151
param = abi.decode(callInput.input, (uint256));
5252
require(param == 2, "Second writeStorage param should be 2");
5353
require(callInput.value == 0, "callInput.value != 0");
54-
55-
callInputs = ph.getCallInputs(address(TARGET), bytes4(0));
56-
require(callInputs.length == 0, "callInputs.length != 0");
5754
}
5855
function testCallInputsWrongTarget() external view {
5956
PhEvm.CallInputs[] memory callInputs = ph.getCallInputs(
6057
address(0x000000000000000000000000000000000000dEaD),
6158
Target.readStorage.selector
6259
);
63-
require(callInputs.length == 0, "callInputs.length != 0");
60+
require(callInputs.length == 1, "Wrong target: callInputs.length != 1");
6461
}
6562

6663
function testCallNoSelector() external view {
6764
PhEvm.CallInputs[] memory callInputs = ph.getCallInputs(
6865
address(TARGET),
6966
bytes4(0)
7067
);
71-
require(callInputs.length == 0, "callInputs.length != 0");
68+
require(callInputs.length == 1, "No selector: callInputs.length != 1");
7269
}
7370

7471
function triggers() external view override {
7572
registerCallTrigger(this.testGetCallInputs.selector);
73+
registerCallTrigger(this.testCallInputsWrongTarget.selector);
74+
registerCallTrigger(this.testCallNoSelector.selector);
7675
}
7776
}
7877

@@ -82,7 +81,9 @@ contract TriggeringTx {
8281
TARGET.writeStorage(2);
8382
TARGET.readStorage();
8483

85-
address fallbackTarget = address(0x000000000000000000000000000000000000dEaD);
84+
address fallbackTarget = address(
85+
0x000000000000000000000000000000000000dEaD
86+
);
8687
(bool success, ) = fallbackTarget.call(
8788
abi.encodeWithSelector(TARGET.readStorage.selector)
8889
);
@@ -91,5 +92,4 @@ contract TriggeringTx {
9192
(success, ) = address(TARGET).call("");
9293
require(success, "call failed");
9394
}
94-
}
95-
95+
}

0 commit comments

Comments
 (0)