-
Notifications
You must be signed in to change notification settings - Fork 9
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
bump sdk50 #144
base: main
Are you sure you want to change the base?
bump sdk50 #144
Conversation
@@ -189,7 +207,7 @@ replace ( | |||
// use cosmos fork of keyring | |||
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 | |||
// stick with compatible version or x/exp in v0.47.x line | |||
golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb | |||
// golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb | |||
// stick with compatible version of rapid in v0.47.x line | |||
pgregory.net/rapid => pgregory.net/rapid v0.5.5 |
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.
Should replace goleveldb too:
// replace broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
if err != nil { | ||
return nil, err | ||
} | ||
|
||
lockID := types.MultiStakingLockID(msg.DelegatorAddress, msg.ValidatorAddress) | ||
lockID := types.MultiStakingLockID(multiStakerAddr.String(), msg.ValidatorAddress) |
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.
DelegatorAddr is deprecated in sdk50. Maybe we shouldn't care this ?
"github.com/cosmos/cosmos-sdk/store/prefix" | ||
"cosmossdk.io/math" | ||
"cosmossdk.io/store/prefix" | ||
sdk_type "cosmossdk.io/store/types" |
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.
storetypes here for better readability
@@ -25,8 +28,11 @@ import ( | |||
) | |||
|
|||
var ( | |||
_ module.AppModule = AppModule{} | |||
_ module.AppModuleBasic = AppModuleBasic{} | |||
_ module.HasABCIGenesis = AppModule{} |
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.
Missing:
_ module.AppModuleBasic = AppModuleBasic{}
_ module.AppModuleSimulation = AppModule{}
_ module.HasInvariants = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
@@ -51,10 +37,4 @@ func init() { | |||
RegisterLegacyAminoCodec(amino) |
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.
unused init() and amino codec
|
||
app.BasicModuleManager = module.NewBasicManagerFromManager( |
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.
BasicModuleManager and ModuleBasics should only have one. Since we already have ModuleBasics, there is no need to add BasicModuleManager
) | ||
|
||
type Keeper struct { | ||
storeKey storetypes.StoreKey | ||
cdc codec.BinaryCodec | ||
accountKeeper types.AccountKeeper | ||
accountKeeper authkeeper.AccountKeeper |
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.
Should keep abstract interface here
authority string | ||
} | ||
|
||
func NewKeeper( | ||
cdc codec.BinaryCodec, | ||
accountKeeper types.AccountKeeper, | ||
accountKeeper authkeeper.AccountKeeper, |
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.
Should keep abstract interface here
@@ -53,13 +55,14 @@ func (k Keeper) EndBlocker(ctx sdk.Context, matureUnbondingDelegations []staking | |||
} | |||
|
|||
func (k Keeper) BurnUnbondedCoinAndUnlockedMultiStakingCoin( | |||
ctx sdk.Context, | |||
c context.Context, |
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.
Should be ctx and sdkCtx
func (k msgServer) UpdateMultiStakingParams(goCtx context.Context, msg *types.MsgUpdateMultiStakingParams) (*types.MsgUpdateMultiStakingParamsResponse, error) { | ||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
func (k msgServer) UpdateMultiStakingParams(ctx context.Context, msg *types.MsgUpdateMultiStakingParams) (*types.MsgUpdateMultiStakingParamsResponse, error) { | ||
sdkctx := sdk.UnwrapSDKContext(ctx) |
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.
sdkCtx
func (k msgServer) UpdateParams(goCtx context.Context, msg *stakingtypes.MsgUpdateParams) (*stakingtypes.MsgUpdateParamsResponse, error) { | ||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
func (k msgServer) UpdateParams(ctx context.Context, msg *stakingtypes.MsgUpdateParams) (*stakingtypes.MsgUpdateParamsResponse, error) { | ||
sdkctx := sdk.UnwrapSDKContext(ctx) |
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.
sdkCtx
|
||
multiStakerAddr, valAcc, err := types.AccAddrAndValAddrFromStrings(msg.DelegatorAddress, msg.ValidatorAddress) | ||
func (k msgServer) CreateValidator(c context.Context, msg *stakingtypes.MsgCreateValidator) (*stakingtypes.MsgCreateValidatorResponse, error) { | ||
ctx := sdk.UnwrapSDKContext(c) |
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.
ctx and sdkCtx
@@ -38,9 +39,10 @@ func (k Keeper) GetUnlockEntryAtCreationHeight(ctx sdk.Context, unlockID types.U | |||
// SetMultiStakingUnlockEntry adds an entry to the unbonding delegation at | |||
// the given addresses. It creates the unbonding delegation if it does not exist. | |||
func (k Keeper) SetMultiStakingUnlockEntry( | |||
ctx sdk.Context, unlockID types.UnlockID, | |||
c context.Context, unlockID types.UnlockID, |
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.
ctx and sdkCtx
@@ -73,9 +75,10 @@ func (k Keeper) DeleteUnlockEntryAtCreationHeight( | |||
} | |||
|
|||
func (k Keeper) DecreaseUnlockEntryAmount( | |||
ctx sdk.Context, unlockID types.UnlockID, | |||
c context.Context, unlockID types.UnlockID, |
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.
ctx and sdkCtx
No description provided.