Skip to content

Conversation

@Evalir
Copy link
Member

@Evalir Evalir commented Jan 11, 2024

Motivation

Part of #6715.

Solution

Migrates the cheats manager and pushes any conversions straight to the signing step, which will then be removed once signers are migrated. While it doesn't remove many conversions, it makes easier to remove them later with the new signers.

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.

smol nit

#[cfg(feature = "impersonated-tx")]
pub fn is_impersonated(&self) -> bool {
self.signature() == IMPERSONATED_SIGNATURE
to_alloy_signature(self.signature()) == IMPERSONATED_SIGNATURE
Copy link
Member

Choose a reason for hiding this comment

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

make self.signature() return an alloy signature imo, any reason why we cannot port the typed transaction fields to be alloy?

Copy link
Member Author

@Evalir Evalir Jan 12, 2024

Choose a reason for hiding this comment

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

thought about doing this, but migrating typedtransaction so early would make us migrate most of anvil in one go with a longer running pr—ideally we want to avoid this.

TypedTransaction, along with other base types are getting migrated on this PR: #6778

//! Support for "cheat codes" / bypass functions
use alloy_primitives::Address;
use alloy_rpc_types::Signature;
Copy link
Member

Choose a reason for hiding this comment

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

@DaniPopes are we mixing types here? or should we pull signature into primitives?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do have alloy_primitives::Signature! we'll pull it in once needed when we get into actually moving types that can recover their signer (TypedTransaction, e.g) here #6778. For now we can use this type, as right now we just need an equivalence check

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.

lgtm

@Evalir Evalir merged commit 78b22db into master Jan 12, 2024
@Evalir Evalir deleted the evalir/migrate-cheatsmanager branch January 12, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants