-
Notifications
You must be signed in to change notification settings - Fork 221
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
fix: make a sensible encoding api #1496
base: main
Are you sure you want to change the base?
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.
only looked briefly because rlp gives me headaches
wdyt @Rjected
fn eip2718_encode_with_type(&self, signature: &Signature, ty: u8, out: &mut dyn BufMut) { | ||
out.put_u8(ty); |
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.
why would this need a type as argument
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.
to demonstrate how cheap and low-effort it is to have abstraction here :)
539cf91
to
95844bf
Compare
this is rebased and ready for review The main thing it does is make an INTERNAL trait |
95844bf
to
bb3c510
Compare
now closes #1510 as well |
Spawned from the depths of #1485
Motivation
Fix transaction coding APIs to be usable and clear
encode_with_signature
encode_with_signature
are wrongencode_with_signature
produces 2718 output whenwith_header
is false, and RLP in network format whenwith_header
istrue
. All otherencode_
methods produce RLP output in non-network formatdecode_with_signature
is missing entirelyEncodableSignature
seems to now be redundant as reth migrated toalloy-primitives::Signature
Solution
create a simple API in which encoding and decoding function names specify which format they produce/accept
PR Checklist