-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: LSM changes to staking #7
Conversation
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
DefaultWeightMsgWithdrawValidatorCommission int = 50 | ||
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
DefaultWeightMsgWithdrawDelegationReward int = 50 | ||
DefaultWeightMsgWithdrawValidatorCommission int = 50 | ||
DefaultWeightMsgFundCommunityPool int = 50 | ||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec | ||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec | ||
OpWeightMsgWithdrawAllTokenizeShareRecordReward = "op_weight_msg_withdraw_all_tokenize_share_record_reward" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec | ||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec | ||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec | ||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
TypeMsgRedeemTokensForShares = "redeem_tokens_for_shares" | ||
TypeMsgTransferTokenizeShareRecord = "transfer_tokenize_share_record" | ||
TypeMsgDisableTokenizeShares = "disable_tokenize_shares" | ||
TypeMsgEnableTokenizeShares = "enable_tokenize_shares" |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
TypeMsgBeginRedelegate = "begin_redelegate" | ||
TypeMsgUpdateParams = "update_params" | ||
TypeMsgTokenizeShares = "tokenize_shares" | ||
TypeMsgRedeemTokensForShares = "redeem_tokens_for_shares" |
Check failure
Code scanning / gosec
Potential hardcoded credentials Error
x/distribution/types/msg.go
Outdated
func (msg MsgWithdrawTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { | ||
owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
x/distribution/types/msg.go
Outdated
func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { | ||
owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
@@ -17,6 +17,7 @@ | |||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | |||
|
|||
k.TrackHistoricalInfo(ctx) | |||
k.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
func (msg MsgUnbondValidator) GetSigners() []sdk.AccAddress { | ||
valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgTokenizeShares) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgRedeemTokensForShares) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgTransferTokenizeShareRecord) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.Sender) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgDisableTokenizeShares) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgEnableTokenizeShares) GetSigners() []sdk.AccAddress { | ||
sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
func (msg MsgValidatorBond) GetSigners() []sdk.AccAddress { | ||
delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
tag LSM tests to be refactored Fix nits
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.
gosec found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
...cTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail
Outdated
Show resolved
Hide resolved
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.
The logic seems good. Check my comments below. Also,
- the following tests are missing:
TestNewTokenizeSharesCmd
,TestNewRedeemTokensCmd
,TestNewTransferTokenizeShareRecordCmd
(before inx/staking/client/testutil/suite.go
); - signers in
proto/cosmos/staking/v1beta1/tx.proto
are missing (checkx/staking/types/msg.go
to identify the signers for each message); - let's not forget to add the necessary changes to
RandomFees
intypes/simulation/account.go
cc @MSalopek
Co-authored-by: Marius Poke <[email protected]>
Co-authored-by: Marius Poke <[email protected]>
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change