Skip to content

Conversation

TropicalDog17
Copy link
Contributor

Motivation

Closes #11495

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Contributor

@onbjerg onbjerg left a 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

}

impl Capabilities {
pub fn from_addresses(addresses: Vec<alloy_primitives::Address>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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(..)

Copy link
Member

@mattsse mattsse left a 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


/// A map of wallet capabilities per chain ID.
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, Default)]
pub struct WalletCapabilities(HashMap<U64, Capabilities>);
Copy link
Member

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?

Comment on lines 6 to 22
#[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 } }
}
}
Copy link
Member

Choose a reason for hiding this comment

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

@TropicalDog17 TropicalDog17 changed the title chore: replace anvil delegation types with alloy's chore: replace anvil delegation capability types with alloy's Sep 13, 2025
mattsse
mattsse previously approved these changes Sep 13, 2025
Copy link
Member

@mattsse mattsse left a 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

alloy-rs/alloy#2867

@mattsse mattsse merged commit 45bdbd0 into foundry-rs:master Sep 13, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Sep 13, 2025
@TropicalDog17 TropicalDog17 deleted the chore/issue-11495 branch September 14, 2025 09:19
MerkleBoy pushed a commit to MerkleBoy/foundry that referenced this pull request Sep 17, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

replace anvil delegation types with alloy's

3 participants