-
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
[staking] fix ToEthTx() panic #3910
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3910 +/- ##
==========================================
+ Coverage 75.38% 76.09% +0.71%
==========================================
Files 303 327 +24
Lines 25923 27840 +1917
==========================================
+ Hits 19541 21185 +1644
- Misses 5360 5563 +203
- Partials 1022 1092 +70
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
action/candidate_register.go
Outdated
data, err := cr.encodeABIBinary() | ||
if err != nil { | ||
return nil, err | ||
} | ||
ethAddr := common.BytesToAddress(address.StakingProtocolAddrHash[:]) |
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.
easier way of getting the address, compared to 5 lines in the left side
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.
good to learn a new tip
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.
also in a new pr
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.
ok, will file a new PR
good fix, I found in the ops exceptions log that |
action/stake_reclaim.go
Outdated
data, err := su.encodeABIBinary() | ||
if err != nil { | ||
return nil, err | ||
} | ||
ethAddr := common.BytesToAddress(address.StakingProtocolAddrHash[:]) |
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.
It is used in several places, can place this in global var()?
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.
will do in next PR
action/candidate_register.go
Outdated
data, err := cr.encodeABIBinary() | ||
if err != nil { | ||
return nil, err | ||
} | ||
ethAddr := common.BytesToAddress(address.StakingProtocolAddrHash[:]) |
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.
good to learn a new tip
action/builder.go
Outdated
@@ -22,7 +22,6 @@ type Builder struct { | |||
} | |||
|
|||
var ( | |||
_stakingProtocolAddr, _ = address.FromString(address.StakingProtocolAddr) |
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.
filed in a new pr?
Bc no vriadic param is available in solidity, the query of native action is to be disabled without choices. |
1 similar comment
Bc no vriadic param is available in solidity, the query of native action is to be disabled without choices. |
rewardEthAddr := common.BytesToAddress(cu.rewardAddress.Bytes()) | ||
data, err := _candidateUpdateMethod.Inputs.Pack(cu.name, operatorEthAddr, rewardEthAddr) | ||
if cu.operatorAddress == nil { | ||
return nil, ErrAddress |
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.
it's not caused by an invalid address, but an option param
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Description
as title, issue found and reported by Jeremi
Fixes #3909
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
Checklist: