diff --git a/scripts/commands/governance/upgrade-plan.sh b/scripts/commands/governance/upgrade-plan.sh index 343268fd..12e163b0 100644 --- a/scripts/commands/governance/upgrade-plan.sh +++ b/scripts/commands/governance/upgrade-plan.sh @@ -46,6 +46,7 @@ sekaid query customgov proposals # upgrade to new json for hard-fork case sekaid export > exported-genesis.json sekaid new-genesis-from-exported exported-genesis.json new-genesis.json --json-minimize=true +sekaid new-genesis-from-exported exported-genesis.json new-genesis.json --json-minimize=false # manual minize if required sekaid export-minimized-genesis exported-genesis.json minimized.json \ No newline at end of file diff --git a/x/genutil/client/cli/upgrade_genesis.go b/x/genutil/client/cli/upgrade_genesis.go index ed4fda0d..f2fbd53f 100644 --- a/x/genutil/client/cli/upgrade_genesis.go +++ b/x/genutil/client/cli/upgrade_genesis.go @@ -5,9 +5,14 @@ import ( "fmt" "strings" + "cosmossdk.io/math" appparams "github.com/KiraCore/sekai/app/params" "github.com/KiraCore/sekai/x/genutil" govtypes "github.com/KiraCore/sekai/x/gov/types" + v0345tokenstypes "github.com/KiraCore/sekai/x/tokens/legacy/v0345" + + // "github.com/KiraCore/sekai/x/tokens/types" + tokenstypes "github.com/KiraCore/sekai/x/tokens/types" v0317upgradetypes "github.com/KiraCore/sekai/x/upgrade/legacy/v0317" upgradetypes "github.com/KiraCore/sekai/x/upgrade/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -17,6 +22,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -112,7 +118,7 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json err = cdc.UnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesisV03123) if err == nil { // which means old upgrade genesis upgradeGenesis := upgradetypes.GenesisState{ - Version: "v0.3.45", + Version: "v0.4.1", CurrentPlan: upgradedPlan(upgradeGenesisV03123.CurrentPlan), NextPlan: upgradedPlan(upgradeGenesisV03123.NextPlan), } @@ -124,8 +130,8 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json upgradeGenesis := upgradetypes.GenesisState{} cdc.MustUnmarshalJSON(genesisState[upgradetypes.ModuleName], &upgradeGenesis) if upgradeGenesis.Version == "" { - upgradeGenesis.Version = "v0.3.45" - fmt.Println("upgraded the upgrade module genesis to v0.3.45") + upgradeGenesis.Version = "v0.4.1" + fmt.Println("upgraded the upgrade module genesis to v0.4.1") } // if upgradeGenesis.NextPlan == nil { @@ -178,6 +184,68 @@ $ %s new-genesis-from-exported exported-genesis.json new-genesis.json genesisState[govtypes.ModuleName] = bz } + bankGenesis := banktypes.GenesisState{} + err = cdc.UnmarshalJSON(genesisState[banktypes.ModuleName], &bankGenesis) + + holders := make(map[string]uint64) + for _, balance := range bankGenesis.Balances { + for _, coin := range balance.Coins { + holders[coin.Denom]++ + } + } + + // upgrade gov genesis for more role permissions + tokensGenesisV0345 := v0345tokenstypes.GenesisStateV0345{} + err = cdc.UnmarshalJSON(genesisState[tokenstypes.ModuleName], &tokensGenesisV0345) + if err == nil { // which means old tokens genesis + aliasMap := make(map[string]*v0345tokenstypes.TokenAlias) + for _, alias := range tokensGenesisV0345.Aliases { + for _, denom := range alias.Denoms { + aliasMap[denom] = alias + } + } + tokenInfos := []tokenstypes.TokenInfo{} + for _, rate := range tokensGenesisV0345.Rates { + alias := aliasMap[rate.Denom] + if alias == nil { + alias = &v0345tokenstypes.TokenAlias{} + } + tokenInfos = append(tokenInfos, tokenstypes.TokenInfo{ + Denom: rate.Denom, + TokenType: "adr20", + FeeRate: rate.FeeRate, + FeeEnabled: rate.FeePayments, + Supply: bankGenesis.Supply.AmountOf(rate.Denom), + SupplyCap: math.ZeroInt(), + StakeCap: rate.StakeCap, + StakeMin: rate.StakeMin, + StakeEnabled: rate.StakeToken, + Inactive: rate.Invalidated, + Symbol: alias.Symbol, + Name: alias.Name, + Icon: alias.Icon, + Decimals: alias.Decimals, + Description: "", + Website: "", + Social: "", + Holders: holders[rate.Denom], + MintingFee: math.ZeroInt(), + Owner: "", + OwnerEditDisabled: true, + NftMetadata: "", + NftHash: "", + }) + } + tokensGenesis := tokenstypes.GenesisState{ + TokenInfos: tokenInfos, + TokenBlackWhites: tokenstypes.TokensWhiteBlack{ + Whitelisted: tokensGenesisV0345.TokenBlackWhites.Whitelisted, + Blacklisted: tokensGenesisV0345.TokenBlackWhites.Blacklisted, + }, + } + genesisState[tokenstypes.ModuleName] = cdc.MustMarshalJSON(&tokensGenesis) + } + appState, err := json.MarshalIndent(genesisState, "", " ") if err != nil { return errors.Wrap(err, "Failed to marshal default genesis state") diff --git a/x/tokens/legacy/v0345/alias.pb.go b/x/tokens/legacy/v0345/alias.pb.go new file mode 100644 index 00000000..0b22c441 --- /dev/null +++ b/x/tokens/legacy/v0345/alias.pb.go @@ -0,0 +1,564 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/alias.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type TokenAlias struct { + Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` + Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` + Denoms []string `protobuf:"bytes,5,rep,name=denoms,proto3" json:"denoms,omitempty"` + Invalidated bool `protobuf:"varint,6,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +} + +func (m *TokenAlias) Reset() { *m = TokenAlias{} } +func (m *TokenAlias) String() string { return proto.CompactTextString(m) } +func (*TokenAlias) ProtoMessage() {} +func (*TokenAlias) Descriptor() ([]byte, []int) { + return fileDescriptor_e5f7b26b3e48e5a6, []int{0} +} +func (m *TokenAlias) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenAlias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenAlias.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TokenAlias) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenAlias.Merge(m, src) +} +func (m *TokenAlias) XXX_Size() int { + return m.Size() +} +func (m *TokenAlias) XXX_DiscardUnknown() { + xxx_messageInfo_TokenAlias.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenAlias proto.InternalMessageInfo + +func (m *TokenAlias) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *TokenAlias) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TokenAlias) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *TokenAlias) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + +func (m *TokenAlias) GetDenoms() []string { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *TokenAlias) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + return false +} + + + +func init() { + proto.RegisterType((*TokenAlias)(nil), "kira.tokens.TokenAlias") +} + +func init() { proto.RegisterFile("kira/tokens/alias.proto", fileDescriptor_e5f7b26b3e48e5a6) } + +var fileDescriptor_e5f7b26b3e48e5a6 = []byte{ + // 330 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x92, 0xbd, 0x4e, 0xeb, 0x30, + 0x14, 0xc7, 0xeb, 0xb6, 0xb7, 0xb7, 0xd7, 0xbd, 0x08, 0x29, 0x20, 0x88, 0x3a, 0xa4, 0x51, 0xa6, + 0x2c, 0x8d, 0x07, 0x36, 0xb6, 0x16, 0x36, 0xc4, 0x12, 0xc1, 0xc2, 0x84, 0x1b, 0x5b, 0xc1, 0x4a, + 0x9c, 0x13, 0xf9, 0x04, 0x44, 0x1f, 0x02, 0x89, 0x67, 0xe0, 0x69, 0x18, 0x3b, 0x32, 0x55, 0xa8, + 0x7d, 0x03, 0x46, 0x26, 0xe4, 0xa4, 0xad, 0xfa, 0x08, 0x4c, 0xfe, 0x7f, 0x1c, 0xff, 0x64, 0xc9, + 0x87, 0x9e, 0x66, 0xca, 0x70, 0x56, 0x41, 0x26, 0x0b, 0x64, 0x3c, 0x57, 0x1c, 0xa3, 0xd2, 0x40, + 0x05, 0xce, 0xc0, 0x16, 0x51, 0x53, 0x0c, 0x8f, 0x53, 0x48, 0xa1, 0xce, 0x99, 0x55, 0xcd, 0x48, + 0xf0, 0x46, 0x28, 0xbd, 0xb1, 0x03, 0x13, 0x7b, 0xcf, 0x39, 0xa1, 0x3d, 0x9c, 0xeb, 0x19, 0xe4, + 0x2e, 0xf1, 0x49, 0xf8, 0x2f, 0xde, 0x38, 0xc7, 0xa1, 0xdd, 0x82, 0x6b, 0xe9, 0xb6, 0xeb, 0xb4, + 0xd6, 0x36, 0x53, 0x09, 0x14, 0x6e, 0xa7, 0xc9, 0xac, 0x76, 0x86, 0xb4, 0x2f, 0x64, 0xa2, 0x34, + 0xcf, 0xd1, 0xed, 0xfa, 0x24, 0x3c, 0x88, 0x77, 0xde, 0xb2, 0x85, 0x2c, 0x40, 0xa3, 0xfb, 0xc7, + 0xef, 0x58, 0x76, 0xe3, 0x1c, 0x9f, 0x0e, 0x54, 0xf1, 0xc4, 0x73, 0x25, 0x78, 0x25, 0x85, 0xdb, + 0xf3, 0x49, 0xd8, 0x8f, 0xf7, 0xa3, 0xe0, 0xa5, 0x4d, 0x8f, 0xae, 0x31, 0xbd, 0x2d, 0x51, 0x9a, + 0xea, 0xb7, 0xbf, 0xd6, 0xb9, 0xa7, 0xfd, 0xd2, 0x40, 0x09, 0x28, 0x8d, 0xfb, 0xd7, 0x27, 0xe1, + 0xff, 0xe9, 0xe5, 0xd7, 0x72, 0x74, 0x38, 0xe7, 0x3a, 0x3f, 0x0f, 0xb6, 0x4d, 0xf0, 0xbd, 0x1c, + 0x8d, 0x53, 0x55, 0x3d, 0x3c, 0xce, 0xa2, 0x04, 0x34, 0x4b, 0x00, 0x35, 0xe0, 0xe6, 0x18, 0xa3, + 0xc8, 0x58, 0x35, 0x2f, 0x25, 0x46, 0x93, 0x24, 0x99, 0x08, 0x61, 0x24, 0x62, 0xbc, 0xa3, 0x4e, + 0xa7, 0xef, 0x2b, 0x8f, 0x2c, 0x56, 0x1e, 0xf9, 0x5c, 0x79, 0xe4, 0x75, 0xed, 0xb5, 0x16, 0x6b, + 0xaf, 0xf5, 0xb1, 0xf6, 0x5a, 0x77, 0xe1, 0x1e, 0xf2, 0x4a, 0x19, 0x7e, 0x01, 0x46, 0x32, 0x94, + 0x19, 0x57, 0xec, 0x79, 0xbb, 0x21, 0x35, 0x78, 0xd6, 0xab, 0xff, 0xff, 0xec, 0x27, 0x00, 0x00, + 0xff, 0xff, 0x6f, 0x5b, 0xa6, 0x08, 0x3d, 0x02, 0x00, 0x00, +} + +func (m *TokenAlias) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenAlias) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenAlias) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Invalidated { + i-- + if m.Invalidated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintAlias(dAtA, i, uint64(len(m.Denoms[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.Decimals != 0 { + i = encodeVarintAlias(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x20 + } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintAlias(dAtA, i, uint64(len(m.Icon))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAlias(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintAlias(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAlias(dAtA []byte, offset int, v uint64) int { + offset -= sovAlias(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TokenAlias) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovAlias(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAlias(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + sovAlias(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovAlias(uint64(m.Decimals)) + } + if len(m.Denoms) > 0 { + for _, s := range m.Denoms { + l = len(s) + n += 1 + l + sovAlias(uint64(l)) + } + } + if m.Invalidated { + n += 2 + } + return n +} + + + +func sovAlias(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAlias(x uint64) (n int) { + return sovAlias(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TokenAlias) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenAlias: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenAlias: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAlias + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlias + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAlias + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlias + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAlias + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlias + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Icon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAlias + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlias + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlias + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Invalidated = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipAlias(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAlias + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skipAlias(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAlias + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAlias + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAlias + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAlias + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAlias + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAlias + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAlias = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAlias = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAlias = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/tokens/legacy/v0345/freeze.pb.go b/x/tokens/legacy/v0345/freeze.pb.go new file mode 100644 index 00000000..5a26caf7 --- /dev/null +++ b/x/tokens/legacy/v0345/freeze.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/freeze.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type TokensWhiteBlackV0345 struct { + Whitelisted []string `protobuf:"bytes,1,rep,name=whitelisted,proto3" json:"whitelisted,omitempty"` + Blacklisted []string `protobuf:"bytes,2,rep,name=blacklisted,proto3" json:"blacklisted,omitempty"` +} + +func (m *TokensWhiteBlackV0345) Reset() { *m = TokensWhiteBlackV0345{} } +func (m *TokensWhiteBlackV0345) String() string { return proto.CompactTextString(m) } +func (*TokensWhiteBlackV0345) ProtoMessage() {} +func (*TokensWhiteBlackV0345) Descriptor() ([]byte, []int) { + return fileDescriptor_e495d9dec16a732a, []int{0} +} +func (m *TokensWhiteBlackV0345) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokensWhiteBlackV0345) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokensWhiteBlackV0345.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TokensWhiteBlackV0345) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokensWhiteBlackV0345.Merge(m, src) +} +func (m *TokensWhiteBlackV0345) XXX_Size() int { + return m.Size() +} +func (m *TokensWhiteBlackV0345) XXX_DiscardUnknown() { + xxx_messageInfo_TokensWhiteBlackV0345.DiscardUnknown(m) +} + +var xxx_messageInfo_TokensWhiteBlackV0345 proto.InternalMessageInfo + +func (m *TokensWhiteBlackV0345) GetWhitelisted() []string { + if m != nil { + return m.Whitelisted + } + return nil +} + +func (m *TokensWhiteBlackV0345) GetBlacklisted() []string { + if m != nil { + return m.Blacklisted + } + return nil +} + + + +func init() { + proto.RegisterType((*TokensWhiteBlackV0345)(nil), "kira.tokens.TokensWhiteBlackV0345") +} + +func init() { proto.RegisterFile("kira/tokens/freeze.proto", fileDescriptor_e495d9dec16a732a) } + +var fileDescriptor_e495d9dec16a732a = []byte{ + // 262 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0xc6, 0x63, 0x2a, 0x22, 0x70, 0x18, 0x50, 0x04, 0x28, 0x62, 0xb0, 0x42, 0xa7, 0x4c, 0xf1, + 0xc0, 0x13, 0x90, 0x8e, 0x2c, 0xa8, 0x42, 0x20, 0xb1, 0x54, 0x4e, 0x73, 0x24, 0xa7, 0x84, 0x3a, + 0xf2, 0x19, 0xf1, 0xe7, 0x29, 0x78, 0x2c, 0xc6, 0x8e, 0x8c, 0x28, 0x79, 0x11, 0xe4, 0xa4, 0x45, + 0x55, 0x37, 0xdf, 0xf7, 0xfb, 0xd9, 0x27, 0x7f, 0x3c, 0xaa, 0xd1, 0x28, 0x69, 0x75, 0x0d, 0x2b, + 0x92, 0xcf, 0x06, 0xe0, 0x13, 0xd2, 0xd6, 0x68, 0xab, 0xc3, 0xc0, 0x91, 0x74, 0x24, 0x97, 0x67, + 0xa5, 0x2e, 0xf5, 0x90, 0x4b, 0x77, 0x1a, 0x95, 0xe9, 0x03, 0x3f, 0xbd, 0x1f, 0xf8, 0x63, 0x85, + 0x16, 0xb2, 0x46, 0x2d, 0xeb, 0x30, 0xe6, 0xc1, 0x9b, 0x9b, 0x1a, 0x24, 0x0b, 0x45, 0xc4, 0xe2, + 0x49, 0x72, 0x3c, 0xdf, 0x8d, 0x9c, 0x91, 0x3b, 0x75, 0x63, 0x1c, 0x8c, 0xc6, 0x4e, 0x34, 0x35, + 0x5c, 0xdc, 0x19, 0xdd, 0x6a, 0x52, 0xcd, 0xfe, 0xfb, 0xb3, 0x4a, 0xad, 0x4a, 0x08, 0xaf, 0xf8, + 0x09, 0xd2, 0xe2, 0xff, 0x4e, 0xc4, 0x62, 0x96, 0x1c, 0xcd, 0x03, 0xa4, 0x6c, 0x1b, 0x85, 0xe7, + 0xdc, 0x47, 0x5a, 0xa8, 0xc2, 0x6d, 0x70, 0xf0, 0x10, 0xe9, 0xa6, 0x28, 0xc2, 0x0b, 0xee, 0x8f, + 0x7f, 0x8a, 0x26, 0xc3, 0xe2, 0xcd, 0x94, 0x65, 0xdf, 0x9d, 0x60, 0xeb, 0x4e, 0xb0, 0xdf, 0x4e, + 0xb0, 0xaf, 0x5e, 0x78, 0xeb, 0x5e, 0x78, 0x3f, 0xbd, 0xf0, 0x9e, 0x92, 0x12, 0x6d, 0xf5, 0x9a, + 0xa7, 0x4b, 0xfd, 0x22, 0x6f, 0xd1, 0xa8, 0x99, 0x36, 0x20, 0x09, 0x6a, 0x85, 0xf2, 0x7d, 0xdb, + 0x9c, 0xfd, 0x68, 0x81, 0x72, 0x7f, 0xa8, 0xe5, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xd2, + 0x35, 0x59, 0x55, 0x01, 0x00, 0x00, +} + +func (m *TokensWhiteBlackV0345) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokensWhiteBlackV0345) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokensWhiteBlackV0345) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blacklisted) > 0 { + for iNdEx := len(m.Blacklisted) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Blacklisted[iNdEx]) + copy(dAtA[i:], m.Blacklisted[iNdEx]) + i = encodeVarintFreeze(dAtA, i, uint64(len(m.Blacklisted[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Whitelisted) > 0 { + for iNdEx := len(m.Whitelisted) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Whitelisted[iNdEx]) + copy(dAtA[i:], m.Whitelisted[iNdEx]) + i = encodeVarintFreeze(dAtA, i, uint64(len(m.Whitelisted[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + + +func encodeVarintFreeze(dAtA []byte, offset int, v uint64) int { + offset -= sovFreeze(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TokensWhiteBlackV0345) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Whitelisted) > 0 { + for _, s := range m.Whitelisted { + l = len(s) + n += 1 + l + sovFreeze(uint64(l)) + } + } + if len(m.Blacklisted) > 0 { + for _, s := range m.Blacklisted { + l = len(s) + n += 1 + l + sovFreeze(uint64(l)) + } + } + return n +} + + +func sovFreeze(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFreeze(x uint64) (n int) { + return sovFreeze(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TokensWhiteBlackV0345) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFreeze + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokensWhiteBlackV0345: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokensWhiteBlackV0345: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Whitelisted", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFreeze + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFreeze + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFreeze + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Whitelisted = append(m.Whitelisted, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklisted", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFreeze + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFreeze + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFreeze + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blacklisted = append(m.Blacklisted, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFreeze(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFreeze + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skipFreeze(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFreeze + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFreeze + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFreeze + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFreeze + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFreeze + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFreeze + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFreeze = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFreeze = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFreeze = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/tokens/legacy/v0345/genesis.pb.go b/x/tokens/legacy/v0345/genesis.pb.go new file mode 100644 index 00000000..16971df1 --- /dev/null +++ b/x/tokens/legacy/v0345/genesis.pb.go @@ -0,0 +1,453 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/genesis.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisStateV0345 struct { + Aliases []*TokenAlias `protobuf:"bytes,1,rep,name=aliases,proto3" json:"aliases,omitempty"` + Rates []*TokenRate `protobuf:"bytes,2,rep,name=rates,proto3" json:"rates,omitempty"` + TokenBlackWhites *TokensWhiteBlackV0345 `protobuf:"bytes,3,opt,name=tokenBlackWhites,proto3" json:"tokenBlackWhites,omitempty"` +} + +func (m *GenesisStateV0345) Reset() { *m = GenesisStateV0345{} } +func (m *GenesisStateV0345) String() string { return proto.CompactTextString(m) } +func (*GenesisStateV0345) ProtoMessage() {} +func (*GenesisStateV0345) Descriptor() ([]byte, []int) { + return fileDescriptor_d3cbd9121e22d5d1, []int{0} +} +func (m *GenesisStateV0345) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisStateV0345) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisStateV0345.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisStateV0345) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisStateV0345.Merge(m, src) +} +func (m *GenesisStateV0345) XXX_Size() int { + return m.Size() +} +func (m *GenesisStateV0345) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisStateV0345.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisStateV0345 proto.InternalMessageInfo + +func (m *GenesisStateV0345) GetAliases() []*TokenAlias { + if m != nil { + return m.Aliases + } + return nil +} + +func (m *GenesisStateV0345) GetRates() []*TokenRate { + if m != nil { + return m.Rates + } + return nil +} + +func (m *GenesisStateV0345) GetTokenBlackWhites() *TokensWhiteBlackV0345 { + if m != nil { + return m.TokenBlackWhites + } + return nil +} + +func init() { + proto.RegisterType((*GenesisStateV0345)(nil), "kira.tokens.GenesisStateV0345") +} + +func init() { proto.RegisterFile("kira/tokens/genesis.proto", fileDescriptor_d3cbd9121e22d5d1) } + +var fileDescriptor_d3cbd9121e22d5d1 = []byte{ + // 254 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xce, 0x2c, 0x4a, + 0xd4, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x2b, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x06, 0x49, 0xe9, 0x41, 0xa4, 0xa4, 0xc4, 0x91, 0xd5, + 0x25, 0xe6, 0x64, 0x26, 0x42, 0x55, 0x49, 0x89, 0x21, 0x4b, 0x14, 0x25, 0x96, 0xa4, 0x42, 0xc5, + 0x25, 0x90, 0xc5, 0xd3, 0x8a, 0x52, 0x53, 0xab, 0xa0, 0x32, 0x4a, 0xbb, 0x18, 0xb9, 0x78, 0xdc, + 0x21, 0x36, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x19, 0x72, 0xb1, 0x83, 0x4d, 0x4c, 0x2d, 0x96, + 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0x43, 0xb2, 0x5a, 0x2f, 0x04, 0x44, 0x39, 0x82, + 0x14, 0x04, 0xc1, 0xd4, 0x09, 0xe9, 0x70, 0xb1, 0x82, 0xec, 0x2a, 0x96, 0x60, 0x02, 0x6b, 0x10, + 0xc3, 0xd4, 0x10, 0x94, 0x58, 0x92, 0x1a, 0x04, 0x51, 0x24, 0xe4, 0xc9, 0x25, 0x00, 0x96, 0x72, + 0xca, 0x49, 0x4c, 0xce, 0x0e, 0xcf, 0xc8, 0x04, 0x69, 0x64, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x92, + 0xc5, 0xd4, 0x58, 0x0c, 0x56, 0x00, 0x56, 0x1a, 0x84, 0xa1, 0xcd, 0xc9, 0xe9, 0xc4, 0x23, 0x39, + 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, + 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, + 0xf3, 0x73, 0xf5, 0xbd, 0x33, 0x8b, 0x12, 0x9d, 0xf3, 0x8b, 0x52, 0xf5, 0x8b, 0x53, 0xb3, 0x13, + 0x33, 0xf5, 0x2b, 0x60, 0xe1, 0x50, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x07, 0x63, + 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0xea, 0x38, 0x58, 0x7c, 0x01, 0x00, 0x00, +} + +func (m *GenesisStateV0345) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisStateV0345) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisStateV0345) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TokenBlackWhites != nil { + { + size, err := m.TokenBlackWhites.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Rates) > 0 { + for iNdEx := len(m.Rates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisStateV0345) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Aliases) > 0 { + for _, e := range m.Aliases { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Rates) > 0 { + for _, e := range m.Rates { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.TokenBlackWhites != nil { + l = m.TokenBlackWhites.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisStateV0345) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisStateV0345: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisStateV0345: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aliases = append(m.Aliases, &TokenAlias{}) + if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rates = append(m.Rates, &TokenRate{}) + if err := m.Rates[len(m.Rates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenBlackWhites", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TokenBlackWhites == nil { + m.TokenBlackWhites = &TokensWhiteBlackV0345{} + } + if err := m.TokenBlackWhites.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/tokens/legacy/v0345/rate.pb.go b/x/tokens/legacy/v0345/rate.pb.go new file mode 100644 index 00000000..efcb4db1 --- /dev/null +++ b/x/tokens/legacy/v0345/rate.pb.go @@ -0,0 +1,601 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kira/tokens/rate.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type TokenRate struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + FeeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fee_rate,json=feeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_rate" yaml:"fee_rate"` + FeePayments bool `protobuf:"varint,3,opt,name=fee_payments,json=feePayments,proto3" json:"fee_payments,omitempty"` + StakeCap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stake_cap,json=stakeCap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake_cap" yaml:"stake_cap"` + StakeMin github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=stake_min,json=stakeMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"stake_min" yaml:"stake_min"` + StakeToken bool `protobuf:"varint,6,opt,name=stake_token,json=stakeToken,proto3" json:"stake_token,omitempty"` + Invalidated bool `protobuf:"varint,7,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +} + +func (m *TokenRate) Reset() { *m = TokenRate{} } +func (m *TokenRate) String() string { return proto.CompactTextString(m) } +func (*TokenRate) ProtoMessage() {} +func (*TokenRate) Descriptor() ([]byte, []int) { + return fileDescriptor_d415c64b17c96dda, []int{0} +} +func (m *TokenRate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenRate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TokenRate) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenRate.Merge(m, src) +} +func (m *TokenRate) XXX_Size() int { + return m.Size() +} +func (m *TokenRate) XXX_DiscardUnknown() { + xxx_messageInfo_TokenRate.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenRate proto.InternalMessageInfo + +func (m *TokenRate) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *TokenRate) GetFeePayments() bool { + if m != nil { + return m.FeePayments + } + return false +} + +func (m *TokenRate) GetStakeToken() bool { + if m != nil { + return m.StakeToken + } + return false +} + +func (m *TokenRate) GetInvalidated() bool { + if m != nil { + return m.Invalidated + } + return false +} + + +func init() { + proto.RegisterType((*TokenRate)(nil), "kira.tokens.TokenRate") +} + +func init() { proto.RegisterFile("kira/tokens/rate.proto", fileDescriptor_d415c64b17c96dda) } + +var fileDescriptor_d415c64b17c96dda = []byte{ + // 430 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0xb1, 0x6e, 0xd4, 0x30, + 0x18, 0xc7, 0x2f, 0xf4, 0xda, 0xe6, 0x9c, 0x4a, 0x20, 0xab, 0x42, 0x16, 0x43, 0x72, 0x64, 0x40, + 0x59, 0x9a, 0x0c, 0x6c, 0x48, 0x0c, 0x97, 0x76, 0x41, 0xa8, 0x12, 0x44, 0xb0, 0x20, 0xa4, 0xc3, + 0x4d, 0xbe, 0x0b, 0x56, 0x1a, 0xdb, 0xb2, 0x0d, 0xe2, 0x9e, 0x80, 0x95, 0xb7, 0xe0, 0x55, 0x3a, + 0x76, 0x44, 0x0c, 0x11, 0xba, 0x7b, 0x03, 0x46, 0x26, 0x14, 0xbb, 0x69, 0x4f, 0x2c, 0xf4, 0xf6, + 0x4e, 0x71, 0x7e, 0xb6, 0xfe, 0xff, 0xef, 0xfb, 0xfe, 0x89, 0xd1, 0xc3, 0x86, 0x29, 0x9a, 0x19, + 0xd1, 0x00, 0xd7, 0x99, 0xa2, 0x06, 0x52, 0xa9, 0x84, 0x11, 0x38, 0xe8, 0x79, 0xea, 0xf8, 0xa3, + 0xc3, 0x5a, 0xd4, 0xc2, 0xf2, 0xac, 0x5f, 0xb9, 0x23, 0xf1, 0xf7, 0x1d, 0x34, 0x79, 0xd3, 0x1f, + 0x28, 0xa8, 0x01, 0x7c, 0x88, 0x76, 0x2b, 0xe0, 0xa2, 0x25, 0xde, 0xd4, 0x4b, 0x26, 0x85, 0x7b, + 0xc1, 0xef, 0x91, 0xbf, 0x00, 0x98, 0xf7, 0xc2, 0xe4, 0x5e, 0xbf, 0x91, 0xcf, 0x2e, 0xba, 0x68, + 0xf4, 0xb3, 0x8b, 0x9e, 0xd4, 0xcc, 0x7c, 0xfc, 0x74, 0x96, 0x96, 0xa2, 0xcd, 0x4a, 0xa1, 0x5b, + 0xa1, 0xaf, 0x1e, 0x47, 0xba, 0x6a, 0x32, 0xb3, 0x94, 0xa0, 0xd3, 0x13, 0x28, 0x7f, 0x77, 0xd1, + 0xfd, 0x25, 0x6d, 0xcf, 0x9f, 0xc5, 0x83, 0x4e, 0x5c, 0xec, 0x2f, 0x00, 0xac, 0xe7, 0x63, 0x74, + 0xd0, 0x53, 0x49, 0x97, 0x2d, 0x70, 0xa3, 0xc9, 0xce, 0xd4, 0x4b, 0xfc, 0x22, 0x58, 0x00, 0xbc, + 0xba, 0x42, 0x78, 0x8e, 0x26, 0xda, 0xd0, 0x06, 0xe6, 0x25, 0x95, 0x64, 0x6c, 0x2b, 0xc8, 0xb7, + 0xae, 0xe0, 0x81, 0xab, 0xe0, 0x5a, 0x28, 0x2e, 0x7c, 0xbb, 0x3e, 0xa6, 0xf2, 0xc6, 0xa0, 0x65, + 0x9c, 0xec, 0x6e, 0x6d, 0xf0, 0x82, 0x9b, 0x7f, 0x0d, 0x5a, 0xc6, 0x07, 0x83, 0x53, 0xc6, 0x71, + 0x84, 0x02, 0xc7, 0x6d, 0x18, 0x64, 0xcf, 0xf6, 0x88, 0x2c, 0xb2, 0xd3, 0xc7, 0x53, 0x14, 0x30, + 0xfe, 0x99, 0x9e, 0xb3, 0x8a, 0x1a, 0xa8, 0xc8, 0xbe, 0x1b, 0xc2, 0x06, 0x8a, 0xbf, 0x8e, 0x11, + 0x3e, 0xd5, 0xf5, 0x5b, 0xa9, 0x41, 0x99, 0xff, 0x45, 0xf6, 0x1a, 0x8d, 0x37, 0xe2, 0x7a, 0xbe, + 0xf5, 0xb0, 0x02, 0xd7, 0x8b, 0x8b, 0xca, 0x4a, 0xdd, 0xe5, 0x74, 0xbb, 0x9c, 0xf0, 0x07, 0xe4, + 0x4b, 0x25, 0xa4, 0xd0, 0xa0, 0x88, 0x3f, 0xf5, 0x92, 0x83, 0xfc, 0xe4, 0xe6, 0xfb, 0x1f, 0x76, + 0xe2, 0x3f, 0x5d, 0x74, 0x74, 0x8b, 0x8a, 0x67, 0x65, 0x39, 0xab, 0x2a, 0x05, 0x5a, 0x17, 0xd7, + 0xaa, 0x79, 0x7e, 0xb1, 0x0a, 0xbd, 0xcb, 0x55, 0xe8, 0xfd, 0x5a, 0x85, 0xde, 0xb7, 0x75, 0x38, + 0xba, 0x5c, 0x87, 0xa3, 0x1f, 0xeb, 0x70, 0xf4, 0x2e, 0xd9, 0x90, 0x7c, 0xc9, 0x14, 0x3d, 0x16, + 0x0a, 0x32, 0x0d, 0x0d, 0x65, 0xd9, 0x97, 0xe1, 0x7e, 0xb0, 0xc2, 0x67, 0x7b, 0xf6, 0xf7, 0x7f, + 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xd1, 0xe1, 0x89, 0x3b, 0x04, 0x00, 0x00, +} + +func (m *TokenRate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TokenRate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Invalidated { + i-- + if m.Invalidated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.StakeToken { + i-- + if m.StakeToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + { + size := m.StakeMin.Size() + i -= size + if _, err := m.StakeMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.StakeCap.Size() + i -= size + if _, err := m.StakeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.FeePayments { + i-- + if m.FeePayments { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + { + size := m.FeeRate.Size() + i -= size + if _, err := m.FeeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintRate(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + + +func encodeVarintRate(dAtA []byte, offset int, v uint64) int { + offset -= sovRate(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TokenRate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovRate(uint64(l)) + } + l = m.FeeRate.Size() + n += 1 + l + sovRate(uint64(l)) + if m.FeePayments { + n += 2 + } + l = m.StakeCap.Size() + n += 1 + l + sovRate(uint64(l)) + l = m.StakeMin.Size() + n += 1 + l + sovRate(uint64(l)) + if m.StakeToken { + n += 2 + } + if m.Invalidated { + n += 2 + } + return n +} + + +func sovRate(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRate(x uint64) (n int) { + return sovRate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TokenRate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TokenRate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenRate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayments", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FeePayments = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeToken", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StakeToken = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Invalidated = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skipRate(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRate + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRate + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRate + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRate = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRate = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRate = fmt.Errorf("proto: unexpected end of group") +) \ No newline at end of file diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 45c0b872..5318e63f 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -124,7 +124,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw panic(err) } genesisState := types.GenesisState{ - Version: "v0.1.22.11", + Version: "v0.4.1", CurrentPlan: currentPlan, NextPlan: nextPlan, }