-
Notifications
You must be signed in to change notification settings - Fork 0
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
A fix to allow leading zero on sig values #71
Conversation
d2ac082
to
93bbbb9
Compare
// If we fail to decode with the strict RLP from reth, | ||
// and we don't have a raw.sender which suggests a native signed trx | ||
// then try the telos legacy decode without passing a signature | ||
if signed_legacy_result.is_err() && raw.sender.is_none() { |
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 should be the same without having 2 if checks for signed_legacy_result error
if signed_legacy_result.is_err() && raw.sender.is_none() { | |
if signed_legacy_result.is_err() { | |
if raw.sender.is_none() { | |
signed_legacy_result = | |
TxLegacy::decode_telos_signed_fields(&mut raw.tx.clone().as_slice(), None); | |
} | |
let address = Address::from( | |
raw.sender | |
.expect("Failed to get address from sender in unsigned transaction, signed_legacy_result is Err") | |
.data, | |
); | |
let sig = make_unique_vrs(block_hash, address, trx_index); | |
let unsigned_legacy = TxLegacy::decode_telos_signed_fields( | |
&mut raw.tx.clone().as_slice(), | |
Some(sig), | |
)?; | |
let envelope = TxEnvelope::Legacy(unsigned_legacy); | |
return Ok(TelosEVMTransaction { envelope, receipt }); | |
} |
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 does change the behavior, if we decode_telos_signed_fields with a None signature successfully then we don't want to enter the second if block.
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.
2 minor comments, lgtm
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.
Looks fine, just minor comments.
No description provided.