Skip to content

chore: remove unused code #10718

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

zerosnacks
Copy link
Member

Motivation

Opening for visibility + discussion

Solution

Methodology: https://gist.github.com/zerosnacks/227ac62697fba3c868db4156d4e37610

Removes unused code

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines -2422 to -2429
/// Sets the reported block number
///
/// Handler for ETH RPC call: `anvil_setBlock`
pub fn anvil_set_block(&self, block_number: u64) -> Result<()> {
node_info!("anvil_setBlock");
self.backend.set_block_number(block_number);
Ok(())
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably be implemented instead of removed

Comment on lines -570 to -600
/// Returns protocol version encoded as a string (quotes are necessary).
///
/// Handler for ETH RPC call: `eth_protocolVersion`
pub fn protocol_version(&self) -> Result<u64> {
node_info!("eth_protocolVersion");
Ok(1)
}

/// Returns the number of hashes per second that the node is mining with.
///
/// Handler for ETH RPC call: `eth_hashrate`
pub fn hashrate(&self) -> Result<U256> {
node_info!("eth_hashrate");
Ok(U256::ZERO)
}

/// Returns the client coinbase address.
///
/// Handler for ETH RPC call: `eth_coinbase`
pub fn author(&self) -> Result<Address> {
node_info!("eth_coinbase");
Ok(self.backend.coinbase())
}

/// Returns true if client is actively mining new blocks.
///
/// Handler for ETH RPC call: `eth_mining`
pub fn is_mining(&self) -> Result<bool> {
node_info!("eth_mining");
Ok(self.is_mining)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

these should likely be implemented, they are currently not

Comment on lines -325 to -327
// Helper function to set default chains
fn create_default_chains() -> HashMap<String, ChainData> {
let mut chains = HashMap::new();
Copy link
Member Author

@zerosnacks zerosnacks Jun 5, 2025

Choose a reason for hiding this comment

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

This is entirely unused / not wired up, I think these are leftover files from #10226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants