-
Notifications
You must be signed in to change notification settings - Fork 324
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
[api] correct signature's V value in returned web3 transaction #3952
Conversation
@@ -251,7 +254,7 @@ func TestTransactionObjectMarshal(t *testing.T) { | |||
"input":"0x", | |||
"r":"0x3639643839613061663237646361613637663162363261333833353934643937", | |||
"s":"0x3539396161646432623762313634636234313132616138646466643432663839", | |||
"v":"0x35" | |||
"v":"0x24c7" |
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 the correct value corresponding to chainID = 4690
receipt: receipt, | ||
pubkey: selp.SrcPubkey(), | ||
signature: selp.Signature(), |
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 could signature be deleted?
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.
not needed anymore, now the signed tx is generated, which contains correct signature value
Codecov Report
@@ Coverage Diff @@
## master #3952 +/- ##
==========================================
+ Coverage 75.38% 76.16% +0.78%
==========================================
Files 303 328 +25
Lines 25923 27981 +2058
==========================================
+ Hits 19541 21313 +1772
- Misses 5360 5573 +213
- Partials 1022 1095 +73
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
|
||
// recover public key | ||
rawHash := types.NewEIP155Signer(big.NewInt(int64(_evmNetworkID))).Hash(&tx) | ||
pubkey, err := crypto.RecoverPubkey(rawHash[:], sig) |
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.
duplicate code, same as DecodeRawTx
Description
When web3 returns a tx, its signature's V value is not correctly set. Existing func in
action
package is used to generate the correct valueFixes (#3944)
this PR will be needed for v1.12.1 to fix the API issue
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: