-
Notifications
You must be signed in to change notification settings - Fork 834
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
imp(staking): replace bech32 address with evm hex address for Createvalidator function #2122
imp(staking): replace bech32 address with evm hex address for Createvalidator function #2122
Conversation
…alidator function
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2122 +/- ##
=======================================
Coverage 69.10% 69.10%
=======================================
Files 304 304
Lines 23737 23742 +5
=======================================
+ Hits 16403 16408 +5
Misses 6433 6433
Partials 901 901
|
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.
LGTM! Thank you for this @luchenqun!
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 good @luchenqun! Thanks a lot for the contribution. I do agree with adjusting the call signature to remove the delegatorAddress
since it makes no sense to pass the same address twice.
Okay, I'll implement that feature later. |
…d event CreateValidator
@Vvaradinov @MalteHerrmann |
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.
LGTM! Thanks @luchenqun 🙏
Description
I changed the input parameter
string memory validatorAddress
in the precompiled contract functioncreateValidator
toaddress validatorAddress
. For this input parameter, for example:it was evmosvaloper1hajh6rhhkjqkwet6wqld3lgx8ur4y3khljfx82 before,
but now it is 0xbf657D0ef7b48167657A703Ed8Fd063F075246D7.
see more details #2076 , Of course, I have also updated the relevant unit tests.
Further Discussion
For the two input parameters
delegatorAddress
andvalidatorAddress
in thecreateValidator
function. I think we only need to keep thevalidatorAddress
in it, because they are essentially the same address. More detailed information can be found in the cosmos sdk related code:https://github.com/cosmos/cosmos-sdk/blob/e049998eb5f2582fe0bb5ab102f0de87b1466534/proto/cosmos/staking/v1beta1/tx.proto#L71-L75
https://github.com/evmos/cosmos-sdk/blob/ab1087a4131e5798ef3a21cefb362800498a67de/x/staking/types/msg.go#L99-L101
Therefore, I suggest that the
createValidator
function in the pre-compiled contract StakingI.sol be change fromto
and for the event
CreateValidator
change fromto