-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore: replace anvil delegation capability types with alloy's #11610
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
Conversation
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.
some nits, ty for this
crates/anvil/core/src/eth/wallet.rs
Outdated
} | ||
|
||
impl Capabilities { | ||
pub fn from_addresses(addresses: Vec<alloy_primitives::Address>) -> Self { |
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.
pub fn from_addresses(addresses: Vec<alloy_primitives::Address>) -> Self { | |
pub fn from_addresses(addresses: Vec<Address>) -> Self { |
make this fully qualified, remember to import
let's also make this a bit more descriptive, technically you could have other capabilities as well, so let's name it smth like delegation_from_addresses(..)
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.
cool
I think we can replace even more
crates/anvil/core/src/eth/wallet.rs
Outdated
|
||
/// A map of wallet capabilities per chain ID. | ||
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, Default)] | ||
pub struct WalletCapabilities(HashMap<U64, Capabilities>); |
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.
I think we can also replace this one?
crates/anvil/core/src/eth/wallet.rs
Outdated
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)] | ||
pub struct Capabilities { | ||
/// The capability to delegate. | ||
pub delegation: DelegationCapability, | ||
} | ||
|
||
impl Default for Capabilities { | ||
fn default() -> Self { | ||
Self { delegation: DelegationCapability { addresses: Vec::new() } } | ||
} | ||
} | ||
|
||
impl Capabilities { | ||
pub fn delegation_from_addresses(addresses: Vec<Address>) -> Self { | ||
Self { delegation: DelegationCapability { addresses } } | ||
} | ||
} |
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.
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.
ty, we can do some touchups after we have
…y-rs#11610) * replace * fix test compile * bet * lint * update docs * chore * replace Capabilities with alloy's * chore: rm more * chore: fix --------- Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Motivation
Closes #11495
Solution
PR Checklist