From b92123b6d8d489595b639810766b2382235e1a75 Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Sun, 14 Jan 2024 17:20:20 +0700 Subject: [PATCH] fix types --- proto/multistaking/v1/genesis.proto | 3 +- proto/multistaking/v1/multi_staking.proto | 6 +- x/multi-staking/keeper/genesis.go | 4 +- x/multi-staking/keeper/lock.go | 2 +- x/multi-staking/keeper/store.go | 2 +- x/multi-staking/types/genesis.go | 2 +- x/multi-staking/types/genesis.pb.go | 99 ++++++++-------- x/multi-staking/types/lock.go | 2 +- x/multi-staking/types/multi_staking.pb.go | 134 ++++++++++------------ 9 files changed, 118 insertions(+), 136 deletions(-) diff --git a/proto/multistaking/v1/genesis.proto b/proto/multistaking/v1/genesis.proto index d6b03762..23c33b10 100644 --- a/proto/multistaking/v1/genesis.proto +++ b/proto/multistaking/v1/genesis.proto @@ -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 { diff --git a/proto/multistaking/v1/multi_staking.proto b/proto/multistaking/v1/multi_staking.proto index b11f406c..8b952818 100644 --- a/proto/multistaking/v1/multi_staking.proto +++ b/proto/multistaking/v1/multi_staking.proto @@ -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 ]; }; @@ -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 ]; } diff --git a/x/multi-staking/keeper/genesis.go b/x/multi-staking/keeper/genesis.go index b9be4f1f..ae7c658d 100644 --- a/x/multi-staking/keeper/genesis.go +++ b/x/multi-staking/keeper/genesis.go @@ -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 { @@ -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), } } diff --git a/x/multi-staking/keeper/lock.go b/x/multi-staking/keeper/lock.go index 2217df18..30ceb51e 100644 --- a/x/multi-staking/keeper/lock.go +++ b/x/multi-staking/keeper/lock.go @@ -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 } diff --git a/x/multi-staking/keeper/store.go b/x/multi-staking/keeper/store.go index 47fd6ce4..88b172d6 100644 --- a/x/multi-staking/keeper/store.go +++ b/x/multi-staking/keeper/store.go @@ -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 } diff --git a/x/multi-staking/types/genesis.go b/x/multi-staking/types/genesis.go index b040475f..7919a8de 100644 --- a/x/multi-staking/types/genesis.go +++ b/x/multi-staking/types/genesis.go @@ -8,7 +8,7 @@ func DefaultGenesis() *GenesisState { stakingGenesis := stakingtypes.DefaultGenesisState() return &GenesisState{ - StakingGenesisState: stakingGenesis, + StakingGenesisState: *stakingGenesis, } } diff --git a/x/multi-staking/types/genesis.pb.go b/x/multi-staking/types/genesis.pb.go index 30ededba..9e472bfd 100644 --- a/x/multi-staking/types/genesis.pb.go +++ b/x/multi-staking/types/genesis.pb.go @@ -35,7 +35,7 @@ type GenesisState struct { MultiStakingUnlocks []MultiStakingUnlock `protobuf:"bytes,2,rep,name=multi_staking_unlocks,json=multiStakingUnlocks,proto3" json:"multi_staking_unlocks"` MultiStakingCoinInfo []MultiStakingCoinInfo `protobuf:"bytes,3,rep,name=multi_staking_coin_info,json=multiStakingCoinInfo,proto3" json:"multi_staking_coin_info"` ValidatorMultiStakingCoins []ValidatorMultiStakingCoin `protobuf:"bytes,4,rep,name=validator_multi_staking_coins,json=validatorMultiStakingCoins,proto3" json:"validator_multi_staking_coins"` - StakingGenesisState *types.GenesisState `protobuf:"bytes,5,opt,name=staking_genesis_state,json=stakingGenesisState,proto3" json:"staking_genesis_state,omitempty"` + StakingGenesisState types.GenesisState `protobuf:"bytes,5,opt,name=staking_genesis_state,json=stakingGenesisState,proto3" json:"staking_genesis_state"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -99,11 +99,11 @@ func (m *GenesisState) GetValidatorMultiStakingCoins() []ValidatorMultiStakingCo return nil } -func (m *GenesisState) GetStakingGenesisState() *types.GenesisState { +func (m *GenesisState) GetStakingGenesisState() types.GenesisState { if m != nil { return m.StakingGenesisState } - return nil + return types.GenesisState{} } type MultiStakingCoinInfo struct { @@ -159,39 +159,39 @@ func init() { func init() { proto.RegisterFile("multistaking/v1/genesis.proto", fileDescriptor_8f95a201ebed173c) } var fileDescriptor_8f95a201ebed173c = []byte{ - // 505 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x41, 0x6b, 0x13, 0x41, - 0x18, 0xcd, 0x36, 0xad, 0xe0, 0x44, 0x10, 0x37, 0x29, 0xdd, 0x06, 0xba, 0x89, 0x6d, 0x95, 0x20, - 0x64, 0x87, 0xd4, 0x93, 0xe0, 0x29, 0x16, 0x44, 0xd0, 0x4b, 0x82, 0x56, 0x84, 0xb2, 0xcc, 0x6e, - 0x26, 0x9b, 0x21, 0x3b, 0xf3, 0x85, 0xcc, 0x64, 0xb5, 0xbf, 0xc1, 0x8b, 0x3f, 0xc6, 0x1f, 0xd1, - 0x63, 0xf1, 0x24, 0x1e, 0x8a, 0x24, 0xbf, 0xc2, 0x9b, 0xec, 0xcc, 0x84, 0x26, 0x9b, 0xb6, 0xa7, - 0x9d, 0x37, 0xef, 0xed, 0x7b, 0x33, 0xdf, 0x3c, 0x74, 0xc0, 0x67, 0xa9, 0x62, 0x52, 0x91, 0x31, - 0x13, 0x09, 0xce, 0x3a, 0x38, 0xa1, 0x82, 0x4a, 0x26, 0x83, 0xc9, 0x14, 0x14, 0xb8, 0x8f, 0x57, - 0xe9, 0x20, 0xeb, 0xd4, 0xf7, 0x13, 0x80, 0x24, 0xa5, 0x58, 0xd3, 0xd1, 0x6c, 0x88, 0x89, 0xb8, - 0x30, 0xda, 0x7a, 0xa3, 0x48, 0x29, 0xc6, 0xa9, 0x54, 0x84, 0x4f, 0xac, 0xa0, 0x96, 0x40, 0x02, - 0x7a, 0x89, 0xf3, 0x95, 0xdd, 0xdd, 0x8f, 0x41, 0x72, 0x90, 0xa1, 0x21, 0x0c, 0xb0, 0x94, 0x6f, - 0x10, 0x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, 0x69, 0x3a, 0xad, 0xca, 0xc9, 0x71, 0x60, 0x3b, 0x75, - 0x13, 0xa7, 0x5b, 0x12, 0xac, 0xbe, 0x6a, 0xaf, 0x6a, 0xd9, 0xd5, 0xcd, 0xc3, 0xef, 0x0e, 0xaa, - 0xdd, 0x36, 0x03, 0xb7, 0x86, 0x76, 0x06, 0x54, 0x00, 0xf7, 0x9c, 0xa6, 0xd3, 0x7a, 0xd8, 0x33, - 0xc0, 0x3d, 0x47, 0x95, 0x08, 0xc4, 0x20, 0xfc, 0x4a, 0x59, 0x32, 0x52, 0xde, 0x56, 0xce, 0x75, - 0x5f, 0xe7, 0xe7, 0xff, 0x73, 0xdd, 0x78, 0x9e, 0x30, 0x35, 0x9a, 0x45, 0x41, 0x0c, 0xdc, 0x96, - 0xdc, 0x7e, 0xda, 0x72, 0x30, 0xc6, 0xea, 0x62, 0x42, 0x65, 0x70, 0x4a, 0xe3, 0x5f, 0x3f, 0xdb, - 0xc8, 0x9e, 0xf7, 0x94, 0xc6, 0x3d, 0x94, 0x1b, 0x9e, 0x69, 0xbf, 0x6e, 0xff, 0x72, 0xee, 0x3b, - 0x57, 0x73, 0xdf, 0xf9, 0x3b, 0xf7, 0x9d, 0x1f, 0x0b, 0xbf, 0x74, 0xb5, 0xf0, 0x4b, 0xbf, 0x17, - 0x7e, 0xe9, 0xcb, 0xab, 0x15, 0xef, 0x29, 0x25, 0x29, 0x03, 0x45, 0xe3, 0x91, 0xe9, 0x79, 0x7b, - 0x59, 0xfc, 0x6f, 0x05, 0xac, 0x23, 0xa3, 0x07, 0xba, 0xe5, 0x2f, 0xff, 0x07, 0x00, 0x00, 0xff, - 0xff, 0xeb, 0x76, 0xfb, 0xb1, 0x08, 0x04, 0x00, 0x00, + // 507 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x41, 0x6b, 0xdb, 0x3e, + 0x18, 0xc6, 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b4, 0xff, + 0xef, 0x9b, 0xc2, 0xbd, 0x40, 0xb5, 0x08, 0xc4, 0x30, 0xfc, 0x4c, 0x59, 0x32, 0x56, 0xde, 0x56, + 0xae, 0xf5, 0x5e, 0xe6, 0xf8, 0x5f, 0x37, 0xcd, 0xa7, 0x09, 0x53, 0xe3, 0x79, 0x14, 0xc4, 0xc0, + 0xed, 0xa8, 0xdb, 0x4f, 0x47, 0x0e, 0x27, 0x58, 0x5d, 0x4e, 0xa9, 0x0c, 0xce, 0x68, 0xfc, 0xe3, + 0x7b, 0x07, 0xd9, 0x53, 0x9f, 0xd1, 0xb8, 0x8f, 0x72, 0xe0, 0xb9, 0xe6, 0xf5, 0x06, 0x57, 0x0b, + 0xdf, 0xb9, 0x5e, 0xf8, 0xce, 0xef, 0x85, 0xef, 0x7c, 0x5b, 0xfa, 0x95, 0xeb, 0xa5, 0x5f, 0xf9, + 0xb9, 0xf4, 0x2b, 0x1f, 0x5f, 0xac, 0xb0, 0x67, 0x94, 0xa4, 0x0c, 0x14, 0x8d, 0xc7, 0x66, 0xda, + 0x3b, 0xc5, 0xf8, 0x7f, 0x29, 0xd5, 0x3a, 0x32, 0xfa, 0x4f, 0xcf, 0xfa, 0xf3, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x01, 0x7b, 0xa1, 0x83, 0x0e, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -214,18 +214,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.StakingGenesisState != nil { - { - size, err := m.StakingGenesisState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + { + size, err := m.StakingGenesisState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if len(m.ValidatorMultiStakingCoins) > 0 { for iNdEx := len(m.ValidatorMultiStakingCoins) - 1; iNdEx >= 0; iNdEx-- { { @@ -366,10 +364,8 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if m.StakingGenesisState != nil { - l = m.StakingGenesisState.Size() - n += 1 + l + sovGenesis(uint64(l)) - } + l = m.StakingGenesisState.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -588,9 +584,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StakingGenesisState == nil { - m.StakingGenesisState = &types.GenesisState{} - } if err := m.StakingGenesisState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/multi-staking/types/lock.go b/x/multi-staking/types/lock.go index ae534de1..0549f867 100644 --- a/x/multi-staking/types/lock.go +++ b/x/multi-staking/types/lock.go @@ -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, diff --git a/x/multi-staking/types/multi_staking.pb.go b/x/multi-staking/types/multi_staking.pb.go index 7d94bb30..ad5eb4ea 100644 --- a/x/multi-staking/types/multi_staking.pb.go +++ b/x/multi-staking/types/multi_staking.pb.go @@ -126,7 +126,7 @@ func (m *LockID) GetValAddr() string { } type MultiStakingLock struct { - LockID *LockID `protobuf:"bytes,1,opt,name=lockID,proto3" json:"lockID,omitempty"` + LockID LockID `protobuf:"bytes,1,opt,name=lockID,proto3" json:"lockID"` LockedCoin MultiStakingCoin `protobuf:"bytes,2,opt,name=locked_coin,json=lockedCoin,proto3" json:"locked_coin"` } @@ -268,7 +268,7 @@ func (m *UnlockID) GetValAddr() string { } type MultiStakingUnlock struct { - UnlockID *UnlockID `protobuf:"bytes,1,opt,name=unlockID,proto3" json:"unlockID,omitempty"` + UnlockID UnlockID `protobuf:"bytes,1,opt,name=unlockID,proto3" json:"unlockID"` Entries []UnlockEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"` } @@ -371,44 +371,44 @@ func init() { } var fileDescriptor_c2c118bafa9b671a = []byte{ - // 583 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6b, 0x13, 0x4f, - 0x18, 0xce, 0xb6, 0xfd, 0xa5, 0xe9, 0xbb, 0xfc, 0x5a, 0x1d, 0x0a, 0x26, 0x45, 0x37, 0x35, 0x82, - 0x16, 0xa1, 0xbb, 0x24, 0xe2, 0xc1, 0xd2, 0x8b, 0x31, 0x42, 0x03, 0xfe, 0xc1, 0x8d, 0x55, 0x10, - 0x64, 0x99, 0xdd, 0x1d, 0x37, 0x43, 0x76, 0x67, 0xc2, 0xee, 0x24, 0xda, 0x6f, 0xe0, 0xc1, 0x83, - 0xe0, 0xc5, 0xa3, 0x1f, 0xc2, 0x0f, 0xd1, 0x63, 0xf1, 0x24, 0x82, 0x45, 0x92, 0x2f, 0x22, 0x33, - 0xb3, 0xa9, 0xdb, 0x04, 0x0f, 0x8a, 0xa7, 0xec, 0xfb, 0xef, 0x99, 0xe7, 0x7d, 0x9e, 0xcc, 0xc0, - 0xb5, 0x64, 0x14, 0x0b, 0x9a, 0x09, 0x3c, 0xa0, 0x2c, 0x72, 0xc6, 0x4d, 0x47, 0xc5, 0x5e, 0x9e, - 0xb0, 0x87, 0x29, 0x17, 0x1c, 0x6d, 0x14, 0x9b, 0xec, 0x71, 0x73, 0x6b, 0x33, 0xe2, 0x11, 0x57, - 0x35, 0x47, 0x7e, 0xe9, 0xb6, 0xad, 0x5a, 0xc0, 0xb3, 0x84, 0x67, 0x9e, 0x2e, 0xe8, 0x20, 0x2f, - 0x59, 0x3a, 0x72, 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0x2f, - 0xff, 0x3f, 0x1b, 0xd7, 0x76, 0x4a, 0x3a, 0xed, 0xde, 0xf1, 0xc4, 0x32, 0x4e, 0x26, 0x96, 0xf1, - 0x63, 0x62, 0x19, 0xef, 0xa7, 0x56, 0xe9, 0x64, 0x6a, 0x95, 0xbe, 0x4e, 0xad, 0xd2, 0x8b, 0x3b, - 0x85, 0x1b, 0x91, 0x12, 0x1c, 0x53, 0x2e, 0x48, 0xd0, 0xd7, 0xaf, 0xcb, 0xee, 0xec, 0xb9, 0x79, - 0x33, 0x17, 0xab, 0x8b, 0xe2, 0x97, 0xd5, 0x8d, 0xbf, 0xf5, 0x33, 0x00, 0x00, 0xff, 0xff, 0x22, - 0xba, 0xba, 0xa1, 0x9b, 0x04, 0x00, 0x00, + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xcf, 0xb6, 0x35, 0x4d, 0x67, 0xb1, 0xd5, 0xa1, 0x60, 0x52, 0x74, 0x53, 0x23, 0x68, 0x11, + 0xb2, 0x4b, 0x22, 0x1e, 0xac, 0xbd, 0x18, 0x23, 0x34, 0xe0, 0x1f, 0xdc, 0x58, 0x05, 0x41, 0x96, + 0xd9, 0xdd, 0x71, 0x33, 0x64, 0x77, 0x26, 0xec, 0x4e, 0x56, 0xfb, 0x0d, 0x3c, 0x78, 0xf0, 0xa8, + 0x37, 0x3f, 0x84, 0x1f, 0xa2, 0xc7, 0xe2, 0x49, 0x04, 0x8b, 0x24, 0x5f, 0x44, 0xe6, 0x4f, 0xea, + 0x36, 0xc1, 0x83, 0xe2, 0x29, 0xfb, 0x7e, 0xef, 0xbd, 0xdf, 0xfc, 0xde, 0xfb, 0x65, 0x06, 0x5c, + 0x4b, 0xc6, 0x31, 0x27, 0x19, 0x47, 0x43, 0x42, 0x23, 0x27, 0x6f, 0x39, 0x32, 0xf6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 0xa3, 0xd8, 0xe2, 0x7b, 0x03, + 0x98, 0x85, 0x42, 0x78, 0x03, 0x6c, 0x04, 0x29, 0x46, 0x9c, 0x30, 0xea, 0x0d, 0xd4, 0xbf, 0x54, + 0x68, 0x5b, 0x76, 0xd7, 0x67, 0xf0, 0xbe, 0x44, 0xe1, 0x63, 0xb0, 0xae, 0xc4, 0x10, 0x1a, 0xfd, + 0x93, 0xa3, 0xe7, 0x4f, 0xdb, 0x95, 0xa9, 0x42, 0x4e, 0xa7, 0x7f, 0x34, 0xb1, 0x8c, 0xe3, 0x89, + 0x65, 0xfc, 0x9c, 0x58, 0xc6, 0x87, 0xa9, 0x55, 0x3a, 0x9e, 0x5a, 0xa5, 0x6f, 0x53, 0xab, 0xf4, + 0xf2, 0x4e, 0xe1, 0x76, 0xa4, 0x18, 0xc5, 0x84, 0x71, 0x1c, 0x0c, 0xd4, 0x4b, 0xd3, 0x9c, 0x3d, + 0x3d, 0x6f, 0xe7, 0x62, 0x79, 0x69, 0xfc, 0xb2, 0xbc, 0xfd, 0xb7, 0x7e, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x24, 0xe8, 0x00, 0xe3, 0xa7, 0x04, 0x00, 0x00, } func (m *MultiStakingCoin) Marshal() (dAtA []byte, err error) { @@ -528,18 +528,16 @@ func (m *MultiStakingLock) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - if m.LockID != nil { - { - size, err := m.LockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + { + size, err := m.LockID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -651,18 +649,16 @@ func (m *MultiStakingUnlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if m.UnlockID != nil { - { - size, err := m.UnlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMultiStaking(dAtA, i, uint64(size)) + { + size, err := m.UnlockID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintMultiStaking(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -755,10 +751,8 @@ func (m *MultiStakingLock) Size() (n int) { } var l int _ = l - if m.LockID != nil { - l = m.LockID.Size() - n += 1 + l + sovMultiStaking(uint64(l)) - } + l = m.LockID.Size() + n += 1 + l + sovMultiStaking(uint64(l)) l = m.LockedCoin.Size() n += 1 + l + sovMultiStaking(uint64(l)) return n @@ -804,10 +798,8 @@ func (m *MultiStakingUnlock) Size() (n int) { } var l int _ = l - if m.UnlockID != nil { - l = m.UnlockID.Size() - n += 1 + l + sovMultiStaking(uint64(l)) - } + l = m.UnlockID.Size() + n += 1 + l + sovMultiStaking(uint64(l)) if len(m.Entries) > 0 { for _, e := range m.Entries { l = e.Size() @@ -1159,9 +1151,6 @@ func (m *MultiStakingLock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LockID == nil { - m.LockID = &LockID{} - } if err := m.LockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1506,9 +1495,6 @@ func (m *MultiStakingUnlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.UnlockID == nil { - m.UnlockID = &UnlockID{} - } if err := m.UnlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }