Skip to content
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

Transaction.decode/1 #100

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Transaction.decode/1 #100

wants to merge 3 commits into from

Conversation

robrobbins
Copy link

Just getting started here. Will spend a few hours each working day if possible getting it done. Shouldn't take too long as we already have a working case in my day job at Coinlist (for legacy, will be adding 1559 next week)

Will remain in draft as i like to psuedocode and comment to discuss before going down a path too far

@robrobbins
Copy link
Author

robrobbins commented Mar 25, 2024

haven't forgotten this. just busy... i'll get there

got some time today and sketched out what a type2 decode may look like, assuming it returns a tx struct. i'll flush out the test on my next go-round


{:ok, public_key} = ExSecp256k1.recover(tx_hash, r, s, :binary.decode_unsigned(y))

{:ok, struct!(__MODULE__, %{
Copy link
Author

Choose a reason for hiding this comment

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

@alisinabh i'm assuming we want to return a transaction struct from decode/1

Copy link
Member

Choose a reason for hiding this comment

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

Hey, Sorry I somehow missed this.

Yes it should.

Do you still want to work on this?

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.

2 participants