-
Notifications
You must be signed in to change notification settings - Fork 308
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
chore: remove associated constant from RlpEcdsaEncodableTx #2172
chore: remove associated constant from RlpEcdsaEncodableTx #2172
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.
a good start, but for this pr we can simply move the associated constant from the encodable to the decodable trait until we figure out what to do with the default decode impls
@@ -195,8 +195,8 @@ pub trait RlpEcdsaDecodableTx: RlpEcdsaEncodableTx { | |||
|
|||
/// Decodes the transaction from eip2718 bytes, expecting the default type | |||
/// flag. | |||
fn eip2718_decode(buf: &mut &[u8]) -> Eip2718Result<Signed<Self>> { | |||
Self::eip2718_decode_with_type(buf, Self::DEFAULT_TX_TYPE) | |||
fn eip2718_decode(&self, buf: &mut &[u8]) -> Eip2718Result<Signed<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.
we can't give the decoding fns a &self arg because this defeats the purpose of decoding, so we need to fix this separately
/// The default transaction type for this transaction. | ||
const DEFAULT_TX_TYPE: u8; | ||
|
||
pub trait RlpEcdsaEncodableTx: Sized + Typed2718 { |
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.
this is great
} | ||
} | ||
|
||
/// Helper trait for managing RLP decoding of transactions inside 2718 envelopes. | ||
#[doc(hidden)] | ||
#[doc(alias = "RlpDecodableTx", alias = "RlpTxDecoding")] | ||
pub trait RlpEcdsaDecodableTx: RlpEcdsaEncodableTx { | ||
pub trait RlpEcdsaDecodableTx: RlpEcdsaEncodableTx + Typed2718 { |
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.
here we now need to introduce the associated constant for now, because we can't remove that in one go, but we want to remove it from the encodable trait right away
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.
lgtm
<!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Bug fixes and new features should include tests. Contributors guide: https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md The contributors guide includes instructions for running rustfmt and building the documentation. --> <!-- ** Please select "Allow edits from maintainers" in the PR Options ** --> ## Motivation same as alloy-rs/alloy#2172 <!-- Explain the context and why you're making that change. What is the problem you're trying to solve? In some cases there is not a problem and this can be thought of as being the motivation for your change. --> ## Solution <!-- Summarize the solution and provide any necessary context needed to understand the code change. --> ## PR Checklist - [ ] Added Tests - [ ] Added Documentation - [ ] Breaking changes --------- Co-authored-by: Matthias Seitz <[email protected]>
Hey, couldn't help but notice this API breaking change was included in the patch release |
Motivation
closes #2171
Solution
PR Checklist