Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Jan 14, 2024
1 parent de5cbe2 commit b92123b
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 136 deletions.
3 changes: 2 additions & 1 deletion proto/multistaking/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ message GenesisState {
[ (gogoproto.nullable) = false ];
repeated ValidatorMultiStakingCoin validator_multi_staking_coins = 4
[ (gogoproto.nullable) = false ];
cosmos.staking.v1beta1.GenesisState staking_genesis_state = 5;
cosmos.staking.v1beta1.GenesisState staking_genesis_state = 5
[ (gogoproto.nullable) = false ];
}

message MultiStakingCoinInfo {
Expand Down
6 changes: 4 additions & 2 deletions proto/multistaking/v1/multi_staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ message MultiStakingLock {
option (gogoproto.goproto_getters) = false;
// option (gogoproto.goproto_stringer) = false;

LockID lockID = 1;
LockID lockID = 1 [ (gogoproto.nullable) = false ];
;

MultiStakingCoin locked_coin = 2 [ (gogoproto.nullable) = false ];
};
Expand All @@ -50,7 +51,8 @@ message MultiStakingUnlock {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

UnlockID unlockID = 1;
UnlockID unlockID = 1 [ (gogoproto.nullable) = false ];
;

repeated UnlockEntry entries = 2 [ (gogoproto.nullable) = false ];
}
Expand Down
4 changes: 2 additions & 2 deletions x/multi-staking/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) (res []abc
k.SetValidatorMultiStakingCoin(ctx, valAddr, valMultiStakingCoin.CoinDenom)
}

return k.stakingKeeper.InitGenesis(ctx, data.StakingGenesisState)
return k.stakingKeeper.InitGenesis(ctx, &data.StakingGenesisState)
}

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
Expand Down Expand Up @@ -69,6 +69,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
MultiStakingUnlocks: multiStakingUnlocks,
MultiStakingCoinInfo: multiStakingCoinInfos,
ValidatorMultiStakingCoins: ValidatorMultiStakingCoinLists,
StakingGenesisState: k.stakingKeeper.ExportGenesis(ctx),
StakingGenesisState: *k.stakingKeeper.ExportGenesis(ctx),
}
}
2 changes: 1 addition & 1 deletion x/multi-staking/keeper/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func (k Keeper) GetOrCreateMultiStakingLock(ctx sdk.Context, lockID types.LockID) types.MultiStakingLock {
multiStakingLock, found := k.GetMultiStakingLock(ctx, lockID)
if !found {
multiStakingLock = types.NewMultiStakingLock(&lockID, types.MultiStakingCoin{Amount: sdk.ZeroInt()})
multiStakingLock = types.NewMultiStakingLock(lockID, types.MultiStakingCoin{Amount: sdk.ZeroInt()})
}
return multiStakingLock
}
Expand Down
2 changes: 1 addition & 1 deletion x/multi-staking/keeper/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (k Keeper) GetMultiStakingLock(ctx sdk.Context, multiStakingLockID types.Lo

func (k Keeper) SetMultiStakingLock(ctx sdk.Context, multiStakingLock types.MultiStakingLock) {
if multiStakingLock.IsEmpty() {
k.RemoveMultiStakingLock(ctx, *multiStakingLock.LockID)
k.RemoveMultiStakingLock(ctx, multiStakingLock.LockID)
return
}

Expand Down
2 changes: 1 addition & 1 deletion x/multi-staking/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func DefaultGenesis() *GenesisState {
stakingGenesis := stakingtypes.DefaultGenesisState()

return &GenesisState{
StakingGenesisState: stakingGenesis,
StakingGenesisState: *stakingGenesis,
}
}

Expand Down
99 changes: 46 additions & 53 deletions x/multi-staking/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/multi-staking/types/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func NewMultiStakingLock(lockID *LockID, lockedCoin MultiStakingCoin) MultiStakingLock {
func NewMultiStakingLock(lockID LockID, lockedCoin MultiStakingCoin) MultiStakingLock {
return MultiStakingLock{
LockID: lockID,
LockedCoin: lockedCoin,
Expand Down
Loading

0 comments on commit b92123b

Please sign in to comment.