-
Notifications
You must be signed in to change notification settings - Fork 2k
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
zerosnacks
wants to merge
7
commits into
master
Choose a base branch
from
zerosnacks/remove-dead-code-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
chore: remove unused code #10718
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
57fa521
start trimming unused functions
zerosnacks ccf98e8
continue cleaning up
zerosnacks 530b4c4
more unused code
zerosnacks 7fe1c6a
moar!
zerosnacks 88a11bd
clean up
zerosnacks 973ff85
fix clippy
zerosnacks 4aa03f9
restore small helpers that make sense
zerosnacks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,8 +113,6 @@ pub struct EthApi { | |
/// Holds all blockchain related data | ||
/// In-Memory only for now | ||
pub backend: Arc<backend::mem::Backend>, | ||
/// Whether this node is mining | ||
is_mining: bool, | ||
/// available signers | ||
signers: Arc<Vec<Box<dyn Signer>>>, | ||
/// data required for `eth_feeHistory` | ||
|
@@ -155,7 +153,6 @@ impl EthApi { | |
Self { | ||
pool, | ||
backend, | ||
is_mining: true, | ||
signers, | ||
fee_history_cache, | ||
fee_history_limit, | ||
|
@@ -567,38 +564,6 @@ impl EthApi { | |
Ok(alloy_primitives::hex::encode_prefixed(&hash[..])) | ||
} | ||
|
||
/// 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) | ||
} | ||
|
||
/// Returns the chain ID used for transaction signing at the | ||
/// current best block. None is returned if not | ||
/// available. | ||
|
@@ -2419,15 +2384,6 @@ impl EthApi { | |
Ok(blocks) | ||
} | ||
|
||
/// 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(()) | ||
} | ||
Comment on lines
-2422
to
-2429
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be implemented instead of removed |
||
|
||
/// Sets the backend rpc url | ||
/// | ||
/// Handler for ETH RPC call: `anvil_setRpcUrl` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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