Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/revive-strategy/src/tracing/call_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ impl Tracing for ExpectedCallTracer {
&mut self,
_from: H160,
to: H160,
_is_delegate_call: bool,
is_delegate_call: bool,
_is_read_only: bool,
value: U256,
input: &[u8],
_gas: Weight,
) {
if is_delegate_call {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you run ExpectCallRevive tests?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking now with the updated polkadot-sdk

return;
}

if !self.is_create
&& let Some(expected_calls_for_target) = self.data.get_mut(&Address::from(to.0))
{
Expand Down
14 changes: 14 additions & 0 deletions testdata/default/cheats/ExpectCallRevive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,17 @@ contract ExpectCallMixedTest is DSTest {
target.add(1, 2);
}
}

contract ExpectCallDelegateSkipTest is DSTest {
Vm constant vm = Vm(HEVM_ADDRESS);

function testExpectCallSkipsDelegateCalls() public {
ProxyWithDelegateCall proxy = new ProxyWithDelegateCall();
SimpleCall target = new SimpleCall();

vm.expectCall(address(target), abi.encodeWithSignature("call()"), 1);

target.call();
proxy.delegateCall(target);
}
}