Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cheatcodes): silence warnings for older Solidity versions #6638

Merged
merged 1 commit into from
Dec 20, 2023
Merged
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
4 changes: 2 additions & 2 deletions crates/cheatcodes/assets/cheatcodes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/cheatcodes/spec/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ interface Vm {

/// Returns an ordered array of all account accesses from a `vm.startStateDiffRecording` session.
#[cheatcode(group = Evm, safety = Safe)]
function stopAndReturnStateDiff() external returns (AccountAccess[] memory accesses);
function stopAndReturnStateDiff() external returns (AccountAccess[] memory accountAccesses);

// -------- Recording Map Writes --------

Expand Down Expand Up @@ -508,7 +508,7 @@ interface Vm {

/// Gets all the logs according to specified filter.
#[cheatcode(group = Evm, safety = Safe)]
function eth_getLogs(uint256 fromBlock, uint256 toBlock, address addr, bytes32[] memory topics)
function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] memory topics)
external
returns (EthGetLogs[] memory logs);

Expand Down
4 changes: 2 additions & 2 deletions crates/cheatcodes/src/evm/fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl Cheatcode for rpcCall {

impl Cheatcode for eth_getLogsCall {
fn apply_full<DB: DatabaseExt>(&self, ccx: &mut CheatsCtxt<DB>) -> Result {
let Self { fromBlock, toBlock, addr, topics } = self;
let Self { fromBlock, toBlock, target, topics } = self;
let (Ok(from_block), Ok(to_block)) = (u64::try_from(fromBlock), u64::try_from(toBlock))
else {
bail!("blocks in block range must be less than 2^64 - 1")
Expand All @@ -253,7 +253,7 @@ impl Cheatcode for eth_getLogsCall {
ccx.data.db.active_fork_url().ok_or_else(|| fmt_err!("no active fork URL found"))?;
let provider = ProviderBuilder::new(&url).build()?;
let mut filter =
Filter::new().address(addr.to_ethers()).from_block(from_block).to_block(to_block);
Filter::new().address(target.to_ethers()).from_block(from_block).to_block(to_block);
for (i, topic) in topics.iter().enumerate() {
let topic = topic.to_ethers();
match i {
Expand Down
4 changes: 2 additions & 2 deletions testdata/cheats/Vm.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.