Skip to content

Conversation

@sontrinh16
Copy link

No description provided.

@catShaark catShaark marked this pull request as ready for review October 11, 2024 14:56
@neitdung
Copy link
Contributor

@vietanh2k all lint errors must be fixed

@neitdung
Copy link
Contributor

neitdung commented Oct 24, 2024

@catShaark @sontrinh16 ValAddressFromBech32 and AccAddressFromBech32 still exist in cosmos-sdk@v0.50.10 but module staking have used new function to get validator address and account address is validatorAddressCodec.StringToBytes(msg.ValidatorAddress), authKeeper.AddressCodec().StringToBytes(msg.DelegatorAddress). Should we replace to new function, does it effect current logic?

@sontrinh16
Copy link
Author

ValAddressFromBech32

yep, both still uses Bech32Codec so still the same

multiStakerAddr, valAcc, err := types.AccAddrAndValAddrFromStrings(msg.DelegatorAddress, msg.ValidatorAddress)
func (k msgServer) CreateValidator(ctx context.Context, msg *stakingtypes.MsgCreateValidator) (*stakingtypes.MsgCreateValidatorResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
multiStakerAddr, valAcc, err := types.ValidatorAccAddrAndValAddrFromStrings(msg.ValidatorAddress)
Copy link
Contributor

@neitdung neitdung Oct 29, 2024

Choose a reason for hiding this comment

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

This is false, validator address is not multi staker address, validator and delegator have different address' prefix and we don't need to create new function to generate validator address.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've re-read sdk50, it still work, but I think we should add address codec and validator codec for transparent this logic

return valUpdates, nil
}

func (am AppModule) StakingAppModule() staking.AppModule {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this function?

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.

5 participants