From ac8125c1bd4c18762c3dff2b8666728eab5eec3f Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Tue, 30 Jul 2024 23:20:19 +0800 Subject: [PATCH 1/4] add legacy proposals back --- proto/kujira/scheduler/legacy_proposal.proto | 59 + x/scheduler/types/codec.go | 13 + x/scheduler/types/legacy_proposal.go | 211 +++ x/scheduler/types/legacy_proposal.pb.go | 1411 ++++++++++++++++++ 4 files changed, 1694 insertions(+) create mode 100644 proto/kujira/scheduler/legacy_proposal.proto create mode 100644 x/scheduler/types/legacy_proposal.go create mode 100644 x/scheduler/types/legacy_proposal.pb.go diff --git a/proto/kujira/scheduler/legacy_proposal.proto b/proto/kujira/scheduler/legacy_proposal.proto new file mode 100644 index 00000000..d5265a1c --- /dev/null +++ b/proto/kujira/scheduler/legacy_proposal.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; +import "kujira/scheduler/hook.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; +option (gogoproto.goproto_stringer_all) = false; + + +message CreateHookProposal { + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + + // The account that will execute the msg on the schedule + string executor = 3; + + // The contract that the msg is called on + string contract = 4; + + bytes msg = 5 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" ]; + int64 frequency = 6; + repeated cosmos.base.v1beta1.Coin funds = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + +} + +message UpdateHookProposal { + // Title is a short summary + string title = 1; + + // Description is a human readable text + string description = 2; + + uint64 id = 3; + string executor = 4; + string contract = 5; + bytes msg = 6 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" ]; + int64 frequency = 7; + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message DeleteHookProposal { + // Title is a short summary + string title = 1; + + // Description is a human readable text + string description = 2; + + uint64 id = 3; +} diff --git a/x/scheduler/types/codec.go b/x/scheduler/types/codec.go index ea54340a..fdb6c951 100644 --- a/x/scheduler/types/codec.go +++ b/x/scheduler/types/codec.go @@ -5,6 +5,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/oracle interfaces and concrete types @@ -16,12 +17,24 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } func RegisterCodec(cdc *codec.LegacyAmino) { + // legacy proposals + cdc.RegisterConcrete(&CreateHookProposal{}, "scheduler/CreateHookProposal", nil) + cdc.RegisterConcrete(&UpdateHookProposal{}, "scheduler/UpdateHookProposal", nil) + cdc.RegisterConcrete(&DeleteHookProposal{}, "scheduler/DeleteHookProposal", nil) + cdc.RegisterConcrete(&MsgCreateHook{}, "scheduler/MsgCreateHook", nil) cdc.RegisterConcrete(&MsgUpdateHook{}, "scheduler/MsgUpdateHook", nil) cdc.RegisterConcrete(&MsgDeleteHook{}, "scheduler/MsgDeleteHook", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // legacy proposals + registry.RegisterImplementations((*govtypes.Content)(nil), + &CreateHookProposal{}, + &UpdateHookProposal{}, + &DeleteHookProposal{}, + ) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateHook{}, &MsgUpdateHook{}, diff --git a/x/scheduler/types/legacy_proposal.go b/x/scheduler/types/legacy_proposal.go new file mode 100644 index 00000000..a46bfe0d --- /dev/null +++ b/x/scheduler/types/legacy_proposal.go @@ -0,0 +1,211 @@ +package types + +import ( + "fmt" + "strings" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypesv1beta "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +const ( + ProposalTypeCreateHook ProposalType = "CreateHook" + ProposalTypeUpdateHook ProposalType = "UpdateHook" + ProposalTypeDeleteHook ProposalType = "DeleteHook" +) + +func init() { // register new content types with the sdk + govtypesv1beta.RegisterProposalType(string(ProposalTypeCreateHook)) + govtypesv1beta.RegisterProposalType(string(ProposalTypeUpdateHook)) + govtypesv1beta.RegisterProposalType(string(ProposalTypeDeleteHook)) +} + +var ( + _ govtypesv1beta.Content = &CreateHookProposal{} + _ govtypesv1beta.Content = &UpdateHookProposal{} + _ govtypesv1beta.Content = &DeleteHookProposal{} +) + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p CreateHookProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type +func (p CreateHookProposal) ProposalType() string { return string(ProposalTypeCreateHook) } + +// ValidateBasic validates the proposal +func (p CreateHookProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if _, err := sdk.AccAddressFromBech32(p.Executor); err != nil { + return errorsmod.Wrap(err, "executor") + } + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p CreateHookProposal) String() string { + return fmt.Sprintf(`Create Hook Proposal: + Title: %s + Description: %s + Contract: %s + Executor: %s + Msg: %q + Funds: %s +`, p.Title, p.Description, p.Contract, p.Executor, p.Msg, p.Funds) +} + +// MarshalYAML pretty prints the wasm byte code +func (p CreateHookProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + Contract string `yaml:"contract"` + Executor string `yaml:"executor"` + Msg string `yaml:"msg"` + Funds sdk.Coins `yaml:"funds"` + }{ + Title: p.Title, + Description: p.Description, + Contract: p.Contract, + Executor: p.Executor, + Msg: string(p.Msg), + Funds: p.Funds, + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p UpdateHookProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type +func (p UpdateHookProposal) ProposalType() string { + return string(ProposalTypeUpdateHook) +} + +// ValidateBasic validates the proposal +func (p UpdateHookProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + + if p.Id == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "ID is required") + } + + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if _, err := sdk.AccAddressFromBech32(p.Executor); err != nil { + return errorsmod.Wrap(err, "executor") + } + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p UpdateHookProposal) String() string { + return fmt.Sprintf(`Update Hook Proposal: + Title: %s + Description: %s + ID: %d + Contract: %s + Executor: %s + Msg: %q + Funds: %s + `, p.Title, p.Description, p.Id, p.Contract, p.Executor, p.Msg, p.Funds) +} + +// MarshalYAML pretty prints the init message +// +//nolint:revive +func (p UpdateHookProposal) MarshalYAML() (interface{}, error) { + return struct { + Id uint64 `yaml:"id"` //nolint:stylecheck + Title string `yaml:"title"` + Description string `yaml:"description"` + Contract string `yaml:"contract"` + Executor string `yaml:"executor"` + Msg string `yaml:"msg"` + Funds sdk.Coins `yaml:"funds"` + }{ + Id: p.Id, + Title: p.Title, + Description: p.Description, + Contract: p.Contract, + Executor: p.Executor, + Msg: string(p.Msg), + Funds: p.Funds, + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p DeleteHookProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type +func (p DeleteHookProposal) ProposalType() string { return string(ProposalTypeDeleteHook) } + +// ValidateBasic validates the proposal +func (p DeleteHookProposal) ValidateBasic() error { + return validateProposalCommons(p.Title, p.Description) +} + +// String implements the Stringer interface. +func (p DeleteHookProposal) String() string { + return fmt.Sprintf(`Migrate Contract Proposal: + Title: %s + Description: %s + ID: %d +`, p.Title, p.Description, p.Id) +} + +// MarshalYAML pretty prints the migrate message +func (p DeleteHookProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + Id uint64 `yaml:"id"` //nolint:revive,stylecheck + }{ + Title: p.Title, + Description: p.Description, + Id: p.Id, + }, nil +} + +func validateProposalCommons(title, description string) error { + if strings.TrimSpace(title) != title { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal title must not start/end with white spaces") + } + if len(title) == 0 { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal title cannot be blank") + } + if len(title) > govtypesv1beta.MaxTitleLength { + return errorsmod.Wrapf(govtypes.ErrInvalidProposalContent, "proposal title is longer than max length of %d", govtypesv1beta.MaxTitleLength) + } + if strings.TrimSpace(description) != description { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal description must not start/end with white spaces") + } + if len(description) == 0 { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal description cannot be blank") + } + if len(description) > govtypesv1beta.MaxDescriptionLength { + return errorsmod.Wrapf(govtypes.ErrInvalidProposalContent, "proposal description is longer than max length of %d", govtypesv1beta.MaxDescriptionLength) + } + return nil +} diff --git a/x/scheduler/types/legacy_proposal.pb.go b/x/scheduler/types/legacy_proposal.pb.go new file mode 100644 index 00000000..433c2f3e --- /dev/null +++ b/x/scheduler/types/legacy_proposal.pb.go @@ -0,0 +1,1411 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kujira/scheduler/legacy_proposal.proto + +package types + +import ( + fmt "fmt" + github_com_CosmWasm_wasmd_x_wasm_types "github.com/CosmWasm/wasmd/x/wasm/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + 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 CreateHookProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The account that will execute the msg on the schedule + Executor string `protobuf:"bytes,3,opt,name=executor,proto3" json:"executor,omitempty"` + // The contract that the msg is called on + Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` + Msg github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage `protobuf:"bytes,5,opt,name=msg,proto3,casttype=github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" json:"msg,omitempty"` + Frequency int64 `protobuf:"varint,6,opt,name=frequency,proto3" json:"frequency,omitempty"` + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` +} + +func (m *CreateHookProposal) Reset() { *m = CreateHookProposal{} } +func (*CreateHookProposal) ProtoMessage() {} +func (*CreateHookProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_388a0119cb7ba3a9, []int{0} +} +func (m *CreateHookProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateHookProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateHookProposal.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 *CreateHookProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateHookProposal.Merge(m, src) +} +func (m *CreateHookProposal) XXX_Size() int { + return m.Size() +} +func (m *CreateHookProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CreateHookProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateHookProposal proto.InternalMessageInfo + +func (m *CreateHookProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CreateHookProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *CreateHookProposal) GetExecutor() string { + if m != nil { + return m.Executor + } + return "" +} + +func (m *CreateHookProposal) GetContract() string { + if m != nil { + return m.Contract + } + return "" +} + +func (m *CreateHookProposal) GetMsg() github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage { + if m != nil { + return m.Msg + } + return nil +} + +func (m *CreateHookProposal) GetFrequency() int64 { + if m != nil { + return m.Frequency + } + return 0 +} + +func (m *CreateHookProposal) GetFunds() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Funds + } + return nil +} + +type UpdateHookProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + Executor string `protobuf:"bytes,4,opt,name=executor,proto3" json:"executor,omitempty"` + Contract string `protobuf:"bytes,5,opt,name=contract,proto3" json:"contract,omitempty"` + Msg github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage `protobuf:"bytes,6,opt,name=msg,proto3,casttype=github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" json:"msg,omitempty"` + Frequency int64 `protobuf:"varint,7,opt,name=frequency,proto3" json:"frequency,omitempty"` + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` +} + +func (m *UpdateHookProposal) Reset() { *m = UpdateHookProposal{} } +func (*UpdateHookProposal) ProtoMessage() {} +func (*UpdateHookProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_388a0119cb7ba3a9, []int{1} +} +func (m *UpdateHookProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateHookProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateHookProposal.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 *UpdateHookProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateHookProposal.Merge(m, src) +} +func (m *UpdateHookProposal) XXX_Size() int { + return m.Size() +} +func (m *UpdateHookProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateHookProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateHookProposal proto.InternalMessageInfo + +func (m *UpdateHookProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *UpdateHookProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *UpdateHookProposal) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *UpdateHookProposal) GetExecutor() string { + if m != nil { + return m.Executor + } + return "" +} + +func (m *UpdateHookProposal) GetContract() string { + if m != nil { + return m.Contract + } + return "" +} + +func (m *UpdateHookProposal) GetMsg() github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage { + if m != nil { + return m.Msg + } + return nil +} + +func (m *UpdateHookProposal) GetFrequency() int64 { + if m != nil { + return m.Frequency + } + return 0 +} + +func (m *UpdateHookProposal) GetFunds() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Funds + } + return nil +} + +type DeleteHookProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *DeleteHookProposal) Reset() { *m = DeleteHookProposal{} } +func (*DeleteHookProposal) ProtoMessage() {} +func (*DeleteHookProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_388a0119cb7ba3a9, []int{2} +} +func (m *DeleteHookProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteHookProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteHookProposal.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 *DeleteHookProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteHookProposal.Merge(m, src) +} +func (m *DeleteHookProposal) XXX_Size() int { + return m.Size() +} +func (m *DeleteHookProposal) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteHookProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteHookProposal proto.InternalMessageInfo + +func (m *DeleteHookProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *DeleteHookProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DeleteHookProposal) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func init() { + proto.RegisterType((*CreateHookProposal)(nil), "kujira.scheduler.CreateHookProposal") + proto.RegisterType((*UpdateHookProposal)(nil), "kujira.scheduler.UpdateHookProposal") + proto.RegisterType((*DeleteHookProposal)(nil), "kujira.scheduler.DeleteHookProposal") +} + +func init() { + proto.RegisterFile("kujira/scheduler/legacy_proposal.proto", fileDescriptor_388a0119cb7ba3a9) +} + +var fileDescriptor_388a0119cb7ba3a9 = []byte{ + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4d, 0x6f, 0xd3, 0x4e, + 0x10, 0xc6, 0x6d, 0xe7, 0xa5, 0xed, 0xf6, 0xaf, 0xbf, 0xd0, 0xaa, 0x07, 0x13, 0x90, 0x63, 0xf5, + 0x80, 0x7c, 0x89, 0x97, 0xc2, 0x89, 0x03, 0x97, 0x84, 0x03, 0x52, 0x85, 0x40, 0x16, 0x08, 0x09, + 0x21, 0xa1, 0xcd, 0x7a, 0xea, 0x98, 0xd8, 0x1e, 0xb3, 0xbb, 0xa6, 0xc9, 0xb7, 0xe0, 0x73, 0xf0, + 0x49, 0x7a, 0xec, 0x09, 0xf5, 0x54, 0x20, 0x91, 0xf8, 0x10, 0x9c, 0x90, 0xbd, 0xa6, 0x04, 0xf1, + 0x72, 0x22, 0xa7, 0xd9, 0x99, 0x67, 0xf6, 0xd1, 0xa3, 0x9f, 0x34, 0xe4, 0xd6, 0xbc, 0x7a, 0x9d, + 0x4a, 0xce, 0x94, 0x98, 0x41, 0x5c, 0x65, 0x20, 0x59, 0x06, 0x09, 0x17, 0xcb, 0x57, 0xa5, 0xc4, + 0x12, 0x15, 0xcf, 0xc2, 0x52, 0xa2, 0x46, 0x7a, 0xcd, 0xec, 0x85, 0x57, 0x7b, 0x83, 0x83, 0x04, + 0x13, 0x6c, 0x44, 0x56, 0xbf, 0xcc, 0xde, 0xe0, 0xc6, 0x2f, 0x7e, 0x33, 0xc4, 0x79, 0x2b, 0x7a, + 0x02, 0x55, 0x8e, 0x8a, 0x4d, 0xb9, 0x02, 0xf6, 0xf6, 0x68, 0x0a, 0x9a, 0x1f, 0x31, 0x81, 0x69, + 0x61, 0xf4, 0xc3, 0x0f, 0x0e, 0xa1, 0x13, 0x09, 0x5c, 0xc3, 0x43, 0xc4, 0xf9, 0x93, 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x65, 0xfc, 0xaf, 0xc0, 0xfe, 0x4f, 0x9c, 0x34, 0x6e, 0x90, 0x76, 0x23, + 0x27, 0x8d, 0x7f, 0x02, 0xdd, 0xfd, 0x0b, 0xe8, 0xde, 0xef, 0x41, 0xf7, 0xb7, 0x03, 0x7a, 0xe7, + 0x8f, 0xa0, 0x77, 0xb7, 0x06, 0xfa, 0x25, 0xa1, 0x0f, 0x20, 0x83, 0xed, 0x70, 0x1e, 0x1f, 0x5f, + 0x7c, 0xf6, 0xac, 0xb3, 0x95, 0x67, 0x9f, 0xaf, 0x3c, 0xfb, 0xd3, 0xca, 0xb3, 0xdf, 0xad, 0x3d, + 0xeb, 0x7c, 0xed, 0x59, 0x17, 0x6b, 0xcf, 0x7a, 0x31, 0xda, 0x08, 0xfb, 0x14, 0x78, 0x3e, 0x3a, + 0x36, 0xa7, 0x28, 0x50, 0x02, 0x5b, 0x6c, 0x5c, 0x64, 0x93, 0x7b, 0xda, 0x6f, 0x6e, 0xee, 0xee, + 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x40, 0x4a, 0x79, 0x02, 0x04, 0x00, 0x00, +} + +func (m *CreateHookProposal) 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 *CreateHookProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateHookProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacyProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.Frequency != 0 { + i = encodeVarintLegacyProposal(dAtA, i, uint64(m.Frequency)) + i-- + dAtA[i] = 0x30 + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x2a + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x22 + } + if len(m.Executor) > 0 { + i -= len(m.Executor) + copy(dAtA[i:], m.Executor) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Executor))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateHookProposal) 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 *UpdateHookProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateHookProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacyProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Frequency != 0 { + i = encodeVarintLegacyProposal(dAtA, i, uint64(m.Frequency)) + i-- + dAtA[i] = 0x38 + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x32 + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x2a + } + if len(m.Executor) > 0 { + i -= len(m.Executor) + copy(dAtA[i:], m.Executor) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Executor))) + i-- + dAtA[i] = 0x22 + } + if m.Id != 0 { + i = encodeVarintLegacyProposal(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteHookProposal) 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 *DeleteHookProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteHookProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintLegacyProposal(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintLegacyProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintLegacyProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovLegacyProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CreateHookProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Executor) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + if m.Frequency != 0 { + n += 1 + sovLegacyProposal(uint64(m.Frequency)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovLegacyProposal(uint64(l)) + } + } + return n +} + +func (m *UpdateHookProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovLegacyProposal(uint64(m.Id)) + } + l = len(m.Executor) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + if m.Frequency != 0 { + n += 1 + sovLegacyProposal(uint64(m.Frequency)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovLegacyProposal(uint64(l)) + } + } + return n +} + +func (m *DeleteHookProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovLegacyProposal(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovLegacyProposal(uint64(m.Id)) + } + return n +} + +func sovLegacyProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLegacyProposal(x uint64) (n int) { + return sovLegacyProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CreateHookProposal) 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 ErrIntOverflowLegacyProposal + } + 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: CreateHookProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateHookProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Executor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Frequency", wireType) + } + m.Frequency = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Frequency |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacyProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacyProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateHookProposal) 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 ErrIntOverflowLegacyProposal + } + 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: UpdateHookProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateHookProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Executor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Frequency", wireType) + } + m.Frequency = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Frequency |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacyProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacyProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteHookProposal) 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 ErrIntOverflowLegacyProposal + } + 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: DeleteHookProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteHookProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + 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 ErrInvalidLengthLegacyProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacyProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacyProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipLegacyProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacyProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLegacyProposal(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, ErrIntOverflowLegacyProposal + } + 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, ErrIntOverflowLegacyProposal + } + 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, ErrIntOverflowLegacyProposal + } + 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, ErrInvalidLengthLegacyProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLegacyProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLegacyProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLegacyProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLegacyProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLegacyProposal = fmt.Errorf("proto: unexpected end of group") +) From a1cd823d472ad872567bc7f5d4b25efb41e2933c Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 31 Jul 2024 00:14:02 +0800 Subject: [PATCH 2/4] legacygov registration for alliance --- app/app.go | 4 + legacygov/alliance/alliance.pb.go | 1013 ++++++++++++ legacygov/alliance/codec.go | 14 + legacygov/alliance/gov.go | 163 ++ legacygov/alliance/gov.pb.go | 1404 +++++++++++++++++ legacygov/scheduler/codec.go | 15 + .../scheduler}/legacy_proposal.go | 10 +- .../scheduler}/legacy_proposal.pb.go | 63 +- proto/alliance/alliance/alliance.proto | 73 + proto/alliance/alliance/gov.proto | 98 ++ proto/kujira/scheduler/legacy_proposal.proto | 2 +- x/scheduler/types/codec.go | 13 - 12 files changed, 2823 insertions(+), 49 deletions(-) create mode 100644 legacygov/alliance/alliance.pb.go create mode 100644 legacygov/alliance/codec.go create mode 100644 legacygov/alliance/gov.go create mode 100644 legacygov/alliance/gov.pb.go create mode 100644 legacygov/scheduler/codec.go rename {x/scheduler/types => legacygov/scheduler}/legacy_proposal.go (97%) rename {x/scheduler/types => legacygov/scheduler}/legacy_proposal.pb.go (92%) create mode 100644 proto/alliance/alliance/alliance.proto create mode 100644 proto/alliance/alliance/gov.proto diff --git a/app/app.go b/app/app.go index 6e226e7c..f7ec67fd 100644 --- a/app/app.go +++ b/app/app.go @@ -9,6 +9,8 @@ import ( "path/filepath" appparams "github.com/Team-Kujira/core/app/params" + legacygovalliance "github.com/Team-Kujira/core/legacygov/alliance" + legacygovscheduler "github.com/Team-Kujira/core/legacygov/scheduler" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/gogoproto/proto" @@ -298,6 +300,8 @@ func New( std.RegisterInterfaces(interfaceRegistry) kujiracryptocodec.RegisterCrypto(legacyAmino) kujiracryptocodec.RegisterInterfaces(interfaceRegistry) + legacygovalliance.RegisterInterfaces(interfaceRegistry) + legacygovscheduler.RegisterInterfaces(interfaceRegistry) bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) diff --git a/legacygov/alliance/alliance.pb.go b/legacygov/alliance/alliance.pb.go new file mode 100644 index 00000000..a19aff45 --- /dev/null +++ b/legacygov/alliance/alliance.pb.go @@ -0,0 +1,1013 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: alliance/alliance/alliance.proto + +package alliance + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 RewardWeightRange struct { + Min cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=min,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min"` + Max cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=max,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max"` +} + +func (m *RewardWeightRange) Reset() { *m = RewardWeightRange{} } +func (m *RewardWeightRange) String() string { return proto.CompactTextString(m) } +func (*RewardWeightRange) ProtoMessage() {} +func (*RewardWeightRange) Descriptor() ([]byte, []int) { + return fileDescriptor_ae357bc0eb0c4178, []int{0} +} +func (m *RewardWeightRange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RewardWeightRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RewardWeightRange.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 *RewardWeightRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_RewardWeightRange.Merge(m, src) +} +func (m *RewardWeightRange) XXX_Size() int { + return m.Size() +} +func (m *RewardWeightRange) XXX_DiscardUnknown() { + xxx_messageInfo_RewardWeightRange.DiscardUnknown(m) +} + +var xxx_messageInfo_RewardWeightRange proto.InternalMessageInfo + +// key: denom value: AllianceAsset +type AllianceAsset struct { + // Denom of the asset. It could either be a native token or an IBC token + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1.s + RewardWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=reward_weight,json=rewardWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_weight"` + // A positive take rate is used for liquid staking derivatives. It defines an rate that is applied per take_rate_interval + // that will be redirected to the distribution rewards pool + TakeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=take_rate,json=takeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"take_rate"` + TotalTokens cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=total_tokens,json=totalTokens,proto3,customtype=cosmossdk.io/math.Int" json:"total_tokens"` + TotalValidatorShares cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=total_validator_shares,json=totalValidatorShares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_validator_shares"` + RewardStartTime time.Time `protobuf:"bytes,6,opt,name=reward_start_time,json=rewardStartTime,proto3,stdtime" json:"reward_start_time"` + RewardChangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_change_rate"` + RewardChangeInterval time.Duration `protobuf:"bytes,8,opt,name=reward_change_interval,json=rewardChangeInterval,proto3,stdduration" json:"reward_change_interval"` + LastRewardChangeTime time.Time `protobuf:"bytes,9,opt,name=last_reward_change_time,json=lastRewardChangeTime,proto3,stdtime" json:"last_reward_change_time"` + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange RewardWeightRange `protobuf:"bytes,10,opt,name=reward_weight_range,json=rewardWeightRange,proto3" json:"reward_weight_range"` + // flag to check if an asset has completed the initialization process after the reward delay + IsInitialized bool `protobuf:"varint,11,opt,name=is_initialized,json=isInitialized,proto3" json:"is_initialized,omitempty"` +} + +func (m *AllianceAsset) Reset() { *m = AllianceAsset{} } +func (m *AllianceAsset) String() string { return proto.CompactTextString(m) } +func (*AllianceAsset) ProtoMessage() {} +func (*AllianceAsset) Descriptor() ([]byte, []int) { + return fileDescriptor_ae357bc0eb0c4178, []int{1} +} +func (m *AllianceAsset) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllianceAsset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllianceAsset.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 *AllianceAsset) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllianceAsset.Merge(m, src) +} +func (m *AllianceAsset) XXX_Size() int { + return m.Size() +} +func (m *AllianceAsset) XXX_DiscardUnknown() { + xxx_messageInfo_AllianceAsset.DiscardUnknown(m) +} + +var xxx_messageInfo_AllianceAsset proto.InternalMessageInfo + +func init() { + proto.RegisterType((*RewardWeightRange)(nil), "alliance.alliance.RewardWeightRange") + proto.RegisterType((*AllianceAsset)(nil), "alliance.alliance.AllianceAsset") +} + +func init() { proto.RegisterFile("alliance/alliance/alliance.proto", fileDescriptor_ae357bc0eb0c4178) } + +var fileDescriptor_ae357bc0eb0c4178 = []byte{ + // 615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x4f, 0xd4, 0x4e, + 0x18, 0xc7, 0xdb, 0x1f, 0x7f, 0x7e, 0xcb, 0x00, 0xca, 0xd6, 0x15, 0x0b, 0x26, 0xed, 0x66, 0xfd, + 0x13, 0x12, 0x43, 0x9b, 0x68, 0xbc, 0x70, 0x92, 0x95, 0x03, 0x1b, 0x8d, 0xd1, 0x42, 0x34, 0xe0, + 0xa1, 0x79, 0x68, 0xc7, 0xee, 0x48, 0xdb, 0x21, 0x33, 0xb3, 0xfc, 0xf1, 0x15, 0x98, 0x78, 0xe1, + 0xe8, 0x91, 0x17, 0xe1, 0x8b, 0xe0, 0x48, 0x3c, 0x11, 0x0f, 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x6e, 0xa1, 0xf9, 0x41, 0x24, 0xc9, 0x05, 0x66, 0xfb, 0x90, + 0xda, 0x15, 0xe5, 0x74, 0xa1, 0xe4, 0x74, 0xad, 0x98, 0x02, 0x6d, 0xf4, 0xab, 0x34, 0x5a, 0xeb, + 0xc7, 0xb6, 0x0a, 0x80, 0xf5, 0x1e, 0xdd, 0x49, 0x81, 0x8b, 0x70, 0x90, 0xaf, 0x52, 0x98, 0x1a, + 0x21, 0x85, 0x9a, 0x84, 0x04, 0x7d, 0x17, 0xa8, 0x28, 0xb6, 0xd1, 0xad, 0x81, 0x9e, 0x0c, 0x99, + 0x2c, 0xd9, 0x48, 0x81, 0xef, 0x7b, 0xa5, 0xf1, 0xf7, 0x4a, 0x83, 0xd8, 0x1c, 0x97, 0x57, 0x04, + 0x55, 0x56, 0x9a, 0xd0, 0x07, 0xe8, 0x06, 0xe1, 0x21, 0xc9, 0x89, 0x20, 0x90, 0x92, 0x4f, 0x38, + 0xb6, 0xa7, 0xeb, 0xe6, 0x52, 0x25, 0x98, 0x25, 0xbc, 0x75, 0xfd, 0xf0, 0x7a, 0xb4, 0x9a, 0xeb, + 0xa7, 0x97, 0x8e, 0x79, 0x76, 0xe9, 0x98, 0xbf, 0x2e, 0x1d, 0xf3, 0xb8, 0xeb, 0x18, 0x67, 0x5d, + 0xc7, 0x38, 0xef, 0x3a, 0xc6, 0xb6, 0x97, 0x10, 0xd1, 0xee, 0xec, 0x78, 0x11, 0xcd, 0xfc, 0x4d, + 0x0c, 0xd9, 0xf2, 0x8b, 0xce, 0x47, 0xc2, 0xc0, 0x8f, 0x28, 0xc3, 0x7e, 0xaa, 0xbe, 0x4b, 0x42, + 0xf7, 0xaf, 0xfe, 0x5e, 0x3b, 0x93, 0x2a, 0x8a, 0x27, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6b, + 0xe1, 0xd4, 0x21, 0xe2, 0x04, 0x00, 0x00, +} + +func (m *RewardWeightRange) 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 *RewardWeightRange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RewardWeightRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Max.Size() + i -= size + if _, err := m.Max.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Min.Size() + i -= size + if _, err := m.Min.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AllianceAsset) 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 *AllianceAsset) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllianceAsset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsInitialized { + i-- + if m.IsInitialized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + { + size, err := m.RewardWeightRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastRewardChangeTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastRewardChangeTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintAlliance(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x4a + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintAlliance(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x42 + { + size := m.RewardChangeRate.Size() + i -= size + if _, err := m.RewardChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RewardStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RewardStartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintAlliance(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x32 + { + size := m.TotalValidatorShares.Size() + i -= size + if _, err := m.TotalValidatorShares.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.TotalTokens.Size() + i -= size + if _, err := m.TotalTokens.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.TakeRate.Size() + i -= size + if _, err := m.TakeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.RewardWeight.Size() + i -= size + if _, err := m.RewardWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAlliance(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintAlliance(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAlliance(dAtA []byte, offset int, v uint64) int { + offset -= sovAlliance(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RewardWeightRange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Min.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = m.Max.Size() + n += 1 + l + sovAlliance(uint64(l)) + return n +} + +func (m *AllianceAsset) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovAlliance(uint64(l)) + } + l = m.RewardWeight.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = m.TakeRate.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = m.TotalTokens.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = m.TotalValidatorShares.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RewardStartTime) + n += 1 + l + sovAlliance(uint64(l)) + l = m.RewardChangeRate.Size() + n += 1 + l + sovAlliance(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval) + n += 1 + l + sovAlliance(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastRewardChangeTime) + n += 1 + l + sovAlliance(uint64(l)) + l = m.RewardWeightRange.Size() + n += 1 + l + sovAlliance(uint64(l)) + if m.IsInitialized { + n += 2 + } + return n +} + +func sovAlliance(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAlliance(x uint64) (n int) { + return sovAlliance(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RewardWeightRange) 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 ErrIntOverflowAlliance + } + 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: RewardWeightRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RewardWeightRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Min.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAlliance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAlliance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllianceAsset) 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 ErrIntOverflowAlliance + } + 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: AllianceAsset: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllianceAsset: 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 ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + 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 RewardWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalValidatorShares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalValidatorShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAlliance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.RewardStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + 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 ErrInvalidLengthAlliance + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAlliance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RewardChangeInterval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastRewardChangeTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAlliance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastRewardChangeTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeightRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAlliance + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAlliance + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeightRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsInitialized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAlliance + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsInitialized = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipAlliance(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAlliance + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAlliance(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, ErrIntOverflowAlliance + } + 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, ErrIntOverflowAlliance + } + 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, ErrIntOverflowAlliance + } + 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, ErrInvalidLengthAlliance + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAlliance + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAlliance + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAlliance = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAlliance = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAlliance = fmt.Errorf("proto: unexpected end of group") +) diff --git a/legacygov/alliance/codec.go b/legacygov/alliance/codec.go new file mode 100644 index 00000000..4490d740 --- /dev/null +++ b/legacygov/alliance/codec.go @@ -0,0 +1,14 @@ +package alliance + +import ( + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*govtypes.Content)(nil), + &MsgCreateAllianceProposal{}, + &MsgUpdateAllianceProposal{}, + &MsgDeleteAllianceProposal{}, + ) +} diff --git a/legacygov/alliance/gov.go b/legacygov/alliance/gov.go new file mode 100644 index 00000000..fe2ba9a0 --- /dev/null +++ b/legacygov/alliance/gov.go @@ -0,0 +1,163 @@ +package alliance + +import ( + "time" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +const RouterKey = "alliance" + +const ( + ProposalTypeCreateAlliance = "msg_create_alliance_proposal" + ProposalTypeUpdateAlliance = "msg_update_alliance_proposal" + ProposalTypeDeleteAlliance = "msg_delete_alliance_proposal" +) + +var ( + _ govtypes.Content = &MsgCreateAllianceProposal{} + _ govtypes.Content = &MsgUpdateAllianceProposal{} + _ govtypes.Content = &MsgDeleteAllianceProposal{} +) + +func init() { + govtypes.RegisterProposalType(ProposalTypeCreateAlliance) + govtypes.RegisterProposalType(ProposalTypeUpdateAlliance) + govtypes.RegisterProposalType(ProposalTypeDeleteAlliance) +} + +func NewMsgCreateAllianceProposal(title, description, denom string, rewardWeight math.LegacyDec, rewardWeightRange RewardWeightRange, takeRate math.LegacyDec, rewardChangeRate math.LegacyDec, rewardChangeInterval time.Duration) govtypes.Content { + return &MsgCreateAllianceProposal{ + Title: title, + Description: description, + Denom: denom, + RewardWeight: rewardWeight, + RewardWeightRange: rewardWeightRange, + TakeRate: takeRate, + RewardChangeRate: rewardChangeRate, + RewardChangeInterval: rewardChangeInterval, + } +} +func (m *MsgCreateAllianceProposal) GetTitle() string { return m.Title } +func (m *MsgCreateAllianceProposal) GetDescription() string { return m.Description } +func (m *MsgCreateAllianceProposal) ProposalRoute() string { return RouterKey } +func (m *MsgCreateAllianceProposal) ProposalType() string { return ProposalTypeCreateAlliance } + +func (m *MsgCreateAllianceProposal) ValidateBasic() error { + if m.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + + if err := sdk.ValidateDenom(m.Denom); err != nil { + return err + } + + if m.RewardWeight.IsNil() || m.RewardWeight.LT(math.LegacyZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be zero or a positive number") + } + + if m.RewardWeightRange.Min.IsNil() || m.RewardWeightRange.Min.LT(math.LegacyZeroDec()) || + m.RewardWeightRange.Max.IsNil() || m.RewardWeightRange.Max.LT(math.LegacyZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min and max must be zero or a positive number") + } + + if m.RewardWeightRange.Min.GT(m.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min must be less or equal to rewardWeight max") + } + + if m.RewardWeight.LT(m.RewardWeightRange.Min) || m.RewardWeight.GT(m.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be bounded in RewardWeightRange") + } + + if m.TakeRate.IsNil() || m.TakeRate.IsNegative() || m.TakeRate.GTE(math.LegacyOneDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance takeRate must be more or equals to 0 but strictly less than 1") + } + + if m.RewardChangeRate.IsZero() || m.RewardChangeRate.IsNegative() { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeRate must be strictly a positive number") + } + + if m.RewardChangeInterval < 0 { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeInterval must be strictly a positive number") + } + + return nil +} + +func NewMsgUpdateAllianceProposal(title, description, denom string, rewardWeight math.LegacyDec, rewardWeightRange RewardWeightRange, takeRate math.LegacyDec, rewardChangeRate math.LegacyDec, rewardChangeInterval time.Duration) govtypes.Content { + return &MsgUpdateAllianceProposal{ + Title: title, + Description: description, + Denom: denom, + RewardWeight: rewardWeight, + TakeRate: takeRate, + RewardChangeRate: rewardChangeRate, + RewardChangeInterval: rewardChangeInterval, + RewardWeightRange: rewardWeightRange, + } +} +func (m *MsgUpdateAllianceProposal) GetTitle() string { return m.Title } +func (m *MsgUpdateAllianceProposal) GetDescription() string { return m.Description } +func (m *MsgUpdateAllianceProposal) ProposalRoute() string { return RouterKey } +func (m *MsgUpdateAllianceProposal) ProposalType() string { return ProposalTypeUpdateAlliance } + +func (m *MsgUpdateAllianceProposal) ValidateBasic() error { + if m.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + + if m.RewardWeight.IsNil() || m.RewardWeight.LT(math.LegacyZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be zero or a positive number") + } + + if m.TakeRate.IsNil() || m.TakeRate.IsNegative() || m.TakeRate.GTE(math.LegacyOneDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance takeRate must be more or equals to 0 but strictly less than 1") + } + + if m.RewardChangeRate.IsZero() || m.RewardChangeRate.IsNegative() { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeRate must be strictly a positive number") + } + + if m.RewardChangeInterval < 0 { + return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeInterval must be strictly a positive number") + } + + if m.RewardWeightRange.Min.IsNil() || m.RewardWeightRange.Min.LT(math.LegacyZeroDec()) || + m.RewardWeightRange.Max.IsNil() || m.RewardWeightRange.Max.LT(math.LegacyZeroDec()) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min and max must be zero or a positive number") + } + + if m.RewardWeightRange.Min.GT(m.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight min must be less or equal to rewardWeight max") + } + + if m.RewardWeight.LT(m.RewardWeightRange.Min) || m.RewardWeight.GT(m.RewardWeightRange.Max) { + return status.Errorf(codes.InvalidArgument, "Alliance rewardWeight must be bounded in RewardWeightRange") + } + + return nil +} + +func NewMsgDeleteAllianceProposal(title, description, denom string) govtypes.Content { + return &MsgDeleteAllianceProposal{ + Title: title, + Description: description, + Denom: denom, + } +} +func (m *MsgDeleteAllianceProposal) GetTitle() string { return m.Title } +func (m *MsgDeleteAllianceProposal) GetDescription() string { return m.Description } +func (m *MsgDeleteAllianceProposal) ProposalRoute() string { return RouterKey } +func (m *MsgDeleteAllianceProposal) ProposalType() string { return ProposalTypeDeleteAlliance } + +func (m *MsgDeleteAllianceProposal) ValidateBasic() error { + if m.Denom == "" { + return status.Errorf(codes.InvalidArgument, "Alliance denom must have a value") + } + return nil +} diff --git a/legacygov/alliance/gov.pb.go b/legacygov/alliance/gov.pb.go new file mode 100644 index 00000000..4d656bdb --- /dev/null +++ b/legacygov/alliance/gov.pb.go @@ -0,0 +1,1404 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: alliance/alliance/gov.proto + +package alliance + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 MsgCreateAllianceProposal struct { + // the title of the update proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Denom of the asset. It could either be a native token or an IBC token + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + RewardWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=reward_weight,json=rewardWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_weight"` + // A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that + // will be redirected to the distribution rewards pool + TakeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=take_rate,json=takeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"take_rate"` + RewardChangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_change_rate"` + RewardChangeInterval time.Duration `protobuf:"bytes,7,opt,name=reward_change_interval,json=rewardChangeInterval,proto3,stdduration" json:"reward_change_interval"` + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange RewardWeightRange `protobuf:"bytes,8,opt,name=reward_weight_range,json=rewardWeightRange,proto3" json:"reward_weight_range"` +} + +func (m *MsgCreateAllianceProposal) Reset() { *m = MsgCreateAllianceProposal{} } +func (m *MsgCreateAllianceProposal) String() string { return proto.CompactTextString(m) } +func (*MsgCreateAllianceProposal) ProtoMessage() {} +func (*MsgCreateAllianceProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_c66988d3be8665d9, []int{0} +} +func (m *MsgCreateAllianceProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateAllianceProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateAllianceProposal.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 *MsgCreateAllianceProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateAllianceProposal.Merge(m, src) +} +func (m *MsgCreateAllianceProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateAllianceProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateAllianceProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateAllianceProposal proto.InternalMessageInfo + +type MsgUpdateAllianceProposal struct { + // the title of the update proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Denom of the asset. It could either be a native token or an IBC token + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + RewardWeight cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=reward_weight,json=rewardWeight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_weight"` + TakeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=take_rate,json=takeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"take_rate"` + RewardChangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_change_rate"` + RewardChangeInterval time.Duration `protobuf:"bytes,7,opt,name=reward_change_interval,json=rewardChangeInterval,proto3,stdduration" json:"reward_change_interval"` + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange RewardWeightRange `protobuf:"bytes,8,opt,name=reward_weight_range,json=rewardWeightRange,proto3" json:"reward_weight_range"` +} + +func (m *MsgUpdateAllianceProposal) Reset() { *m = MsgUpdateAllianceProposal{} } +func (m *MsgUpdateAllianceProposal) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateAllianceProposal) ProtoMessage() {} +func (*MsgUpdateAllianceProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_c66988d3be8665d9, []int{1} +} +func (m *MsgUpdateAllianceProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateAllianceProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateAllianceProposal.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 *MsgUpdateAllianceProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateAllianceProposal.Merge(m, src) +} +func (m *MsgUpdateAllianceProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateAllianceProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateAllianceProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateAllianceProposal proto.InternalMessageInfo + +type MsgDeleteAllianceProposal struct { + // the title of the update proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` +} + +func (m *MsgDeleteAllianceProposal) Reset() { *m = MsgDeleteAllianceProposal{} } +func (m *MsgDeleteAllianceProposal) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAllianceProposal) ProtoMessage() {} +func (*MsgDeleteAllianceProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_c66988d3be8665d9, []int{2} +} +func (m *MsgDeleteAllianceProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAllianceProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAllianceProposal.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 *MsgDeleteAllianceProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAllianceProposal.Merge(m, src) +} +func (m *MsgDeleteAllianceProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAllianceProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAllianceProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteAllianceProposal proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateAllianceProposal)(nil), "alliance.alliance.MsgCreateAllianceProposal") + proto.RegisterType((*MsgUpdateAllianceProposal)(nil), "alliance.alliance.MsgUpdateAllianceProposal") + proto.RegisterType((*MsgDeleteAllianceProposal)(nil), "alliance.alliance.MsgDeleteAllianceProposal") +} + +func init() { proto.RegisterFile("alliance/alliance/gov.proto", fileDescriptor_c66988d3be8665d9) } + +var fileDescriptor_c66988d3be8665d9 = []byte{ + // 485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x6d, 0x68, 0x4a, 0x7a, 0x2d, 0x52, 0x7b, 0x44, 0xc8, 0x6d, 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0xb9, 0x4e, 0xc7, 0x75, 0x3a, 0x2e, + 0xa6, 0xe3, 0x93, 0x6b, 0xd3, 0xd1, 0x01, 0x05, 0xff, 0x3f, 0x1d, 0xff, 0xee, 0xd1, 0xde, 0x3f, + 0x9d, 0xf8, 0xee, 0xd9, 0xc4, 0x77, 0x7f, 0x4d, 0x7c, 0xf7, 0xcb, 0xd4, 0x77, 0xce, 0xa6, 0xbe, + 0xf3, 0x7d, 0xea, 0x3b, 0x07, 0x4c, 0x48, 0xd3, 0x1f, 0xf6, 0x58, 0x8c, 0x69, 0xf8, 0x06, 0x78, + 0xfa, 0xf0, 0xf9, 0xf0, 0xa3, 0xd4, 0x3c, 0x8c, 0x51, 0x43, 0xa8, 0xec, 0x6e, 0x04, 0x8e, 0xe6, + 0x7f, 0xd2, 0xde, 0xb2, 0x7d, 0xea, 0xc7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x3d, 0x68, + 0xc4, 0x9e, 0x05, 0x00, 0x00, +} + +func (m *MsgCreateAllianceProposal) 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 *MsgCreateAllianceProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateAllianceProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RewardWeightRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGov(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x3a + { + size := m.RewardChangeRate.Size() + i -= size + if _, err := m.RewardChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.TakeRate.Size() + i -= size + if _, err := m.TakeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.RewardWeight.Size() + i -= size + if _, err := m.RewardWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintGov(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateAllianceProposal) 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 *MsgUpdateAllianceProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateAllianceProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RewardWeightRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintGov(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + { + size := m.RewardChangeRate.Size() + i -= size + if _, err := m.RewardChangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.TakeRate.Size() + i -= size + if _, err := m.TakeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.RewardWeight.Size() + i -= size + if _, err := m.RewardWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintGov(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAllianceProposal) 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 *MsgDeleteAllianceProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAllianceProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintGov(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateAllianceProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.RewardWeight.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.TakeRate.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.RewardChangeRate.Size() + n += 1 + l + sovGov(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval) + n += 1 + l + sovGov(uint64(l)) + l = m.RewardWeightRange.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *MsgUpdateAllianceProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.RewardWeight.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.TakeRate.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.RewardChangeRate.Size() + n += 1 + l + sovGov(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval) + n += 1 + l + sovGov(uint64(l)) + l = m.RewardWeightRange.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *MsgDeleteAllianceProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateAllianceProposal) 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 ErrIntOverflowGov + } + 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: MsgCreateAllianceProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateAllianceProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RewardChangeInterval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeightRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeightRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateAllianceProposal) 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 ErrIntOverflowGov + } + 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: MsgUpdateAllianceProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateAllianceProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TakeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardChangeRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardChangeInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RewardChangeInterval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardWeightRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RewardWeightRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteAllianceProposal) 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 ErrIntOverflowGov + } + 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: MsgDeleteAllianceProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteAllianceProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/legacygov/scheduler/codec.go b/legacygov/scheduler/codec.go new file mode 100644 index 00000000..b6523c3c --- /dev/null +++ b/legacygov/scheduler/codec.go @@ -0,0 +1,15 @@ +package scheduler + +import ( + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // legacy proposals + registry.RegisterImplementations((*govtypes.Content)(nil), + &CreateHookProposal{}, + &UpdateHookProposal{}, + &DeleteHookProposal{}, + ) +} diff --git a/x/scheduler/types/legacy_proposal.go b/legacygov/scheduler/legacy_proposal.go similarity index 97% rename from x/scheduler/types/legacy_proposal.go rename to legacygov/scheduler/legacy_proposal.go index a46bfe0d..e718a04b 100644 --- a/x/scheduler/types/legacy_proposal.go +++ b/legacygov/scheduler/legacy_proposal.go @@ -1,4 +1,4 @@ -package types +package scheduler import ( "fmt" @@ -11,10 +11,12 @@ import ( govtypesv1beta "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) +const RouterKey = "scheduler" + const ( - ProposalTypeCreateHook ProposalType = "CreateHook" - ProposalTypeUpdateHook ProposalType = "UpdateHook" - ProposalTypeDeleteHook ProposalType = "DeleteHook" + ProposalTypeCreateHook string = "CreateHook" + ProposalTypeUpdateHook string = "UpdateHook" + ProposalTypeDeleteHook string = "DeleteHook" ) func init() { // register new content types with the sdk diff --git a/x/scheduler/types/legacy_proposal.pb.go b/legacygov/scheduler/legacy_proposal.pb.go similarity index 92% rename from x/scheduler/types/legacy_proposal.pb.go rename to legacygov/scheduler/legacy_proposal.pb.go index 433c2f3e..fd9a4dcb 100644 --- a/x/scheduler/types/legacy_proposal.pb.go +++ b/legacygov/scheduler/legacy_proposal.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: kujira/scheduler/legacy_proposal.proto -package types +package scheduler import ( fmt "fmt" github_com_CosmWasm_wasmd_x_wasm_types "github.com/CosmWasm/wasmd/x/wasm/types" + _ "github.com/Team-Kujira/core/x/scheduler/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -294,36 +295,36 @@ func init() { } var fileDescriptor_388a0119cb7ba3a9 = []byte{ - // 462 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4d, 0x6f, 0xd3, 0x4e, - 0x10, 0xc6, 0x6d, 0xe7, 0xa5, 0xed, 0xf6, 0xaf, 0xbf, 0xd0, 0xaa, 0x07, 0x13, 0x90, 0x63, 0xf5, - 0x80, 0x7c, 0x89, 0x97, 0xc2, 0x89, 0x03, 0x97, 0x84, 0x03, 0x52, 0x85, 0x40, 0x16, 0x08, 0x09, - 0x21, 0xa1, 0xcd, 0x7a, 0xea, 0x98, 0xd8, 0x1e, 0xb3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0x6b, 0xcf, 0x7a, 0x31, 0xda, 0x08, 0xfb, 0x14, 0x78, 0x3e, 0x3a, - 0x36, 0xa7, 0x28, 0x50, 0x02, 0x5b, 0x6c, 0x5c, 0x64, 0x93, 0x7b, 0xda, 0x6f, 0x6e, 0xee, 0xee, - 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x40, 0x4a, 0x79, 0x02, 0x04, 0x00, 0x00, + // 461 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x93, 0xec, 0x9f, 0xb6, 0x53, 0x11, 0x19, 0x7a, 0x88, 0xab, 0x64, 0x43, 0x0f, 0x92, + 0x4b, 0x33, 0x56, 0x4f, 0x1e, 0xbc, 0xec, 0x7a, 0x10, 0xa4, 0x28, 0x41, 0x11, 0x44, 0x90, 0xd9, + 0xc9, 0xdb, 0x6c, 0xdc, 0x24, 0x6f, 0x9c, 0x99, 0xb4, 0xdd, 0x6f, 0xe1, 0xe7, 0xf0, 0x93, 0xf4, + 0xd8, 0x93, 0xf4, 0x54, 0x75, 0x17, 0xfc, 0x10, 0x9e, 0x24, 0x99, 0xd8, 0xae, 0xf8, 0xe7, 0xd4, + 0x3d, 0x4d, 0xde, 0xf7, 0x79, 0xf3, 0xf0, 0xf0, 0x83, 0x87, 0xdc, 0x9b, 0x55, 0xef, 0x53, 0xc9, + 0x99, 0x12, 0x53, 0x88, 0xab, 0x0c, 0x24, 0xcb, 0x20, 0xe1, 0x62, 0xfe, 0xae, 0x94, 0x58, 0xa2, + 0xe2, 0x59, 0x58, 0x4a, 0xd4, 0x48, 0x6f, 0x99, 0xbb, 0xf0, 0xf2, 0x6e, 0xb0, 0x93, 0x60, 0x82, + 0x8d, 0xc8, 0xea, 0x2f, 0x73, 0x37, 0xb8, 0xf3, 0x87, 0xdf, 0x14, 0x71, 0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0xa6, 0xc5, 0xe8, 0xfe, 0xe9, 0xc5, 0xd0, 0xfa, 0xf4, 0x65, 0x18, 0xac, 0xe4, + 0x69, 0x91, 0x9a, 0x67, 0x4f, 0xc5, 0xb3, 0x36, 0x4b, 0xfd, 0x83, 0x8a, 0x8c, 0xf3, 0xee, 0x77, + 0x87, 0xd0, 0x57, 0x65, 0x7c, 0x5d, 0x60, 0x6f, 0x12, 0x27, 0x8d, 0x1b, 0xa4, 0xdd, 0xc8, 0x49, + 0xe3, 0xdf, 0x40, 0x77, 0xff, 0x03, 0xba, 0xf7, 0x77, 0xd0, 0xfd, 0xf5, 0x80, 0xde, 0xf8, 0x27, + 0xe8, 0xcd, 0xb5, 0x81, 0x7e, 0x4b, 0xe8, 0x13, 0xc8, 0x60, 0x3d, 0x9c, 0x47, 0x07, 0xe7, 0xdf, + 0x3c, 0xeb, 0x74, 0xe1, 0xd9, 0x67, 0x0b, 0xcf, 0xfe, 0xba, 0xf0, 0xec, 0x8f, 0x4b, 0xcf, 0x3a, + 0x5b, 0x7a, 0xd6, 0xf9, 0xd2, 0xb3, 0xde, 0xb0, 0x95, 0xb0, 0x2f, 0x81, 0xe7, 0x7b, 0xcf, 0x4c, + 0x15, 0x05, 0x4a, 0x68, 0x5b, 0x9d, 0xe0, 0xd1, 0x55, 0x33, 0x27, 0xfd, 0xa6, 0x75, 0x0f, 0x7f, + 0x06, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x07, 0xef, 0x6e, 0x04, 0x04, 0x00, 0x00, } func (m *CreateHookProposal) Marshal() (dAtA []byte, err error) { diff --git a/proto/alliance/alliance/alliance.proto b/proto/alliance/alliance/alliance.proto new file mode 100644 index 00000000..49765446 --- /dev/null +++ b/proto/alliance/alliance/alliance.proto @@ -0,0 +1,73 @@ +syntax = "proto3"; +package alliance.alliance; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/Team-Kujira/core/legacygov/alliance"; + +message RewardWeightRange { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string min = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string max = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} +// key: denom value: AllianceAsset +message AllianceAsset { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // Denom of the asset. It could either be a native token or an IBC token + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1.s + string reward_weight = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // A positive take rate is used for liquid staking derivatives. It defines an rate that is applied per take_rate_interval + // that will be redirected to the distribution rewards pool + string take_rate = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total_tokens = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string total_validator_shares = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp reward_start_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + string reward_change_rate = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + google.protobuf.Duration reward_change_interval = 8 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + google.protobuf.Timestamp last_reward_change_time = 9 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange reward_weight_range = 10 [(gogoproto.nullable) = false]; + // flag to check if an asset has completed the initialization process after the reward delay + bool is_initialized = 11; +} \ No newline at end of file diff --git a/proto/alliance/alliance/gov.proto b/proto/alliance/alliance/gov.proto new file mode 100644 index 00000000..ea99901d --- /dev/null +++ b/proto/alliance/alliance/gov.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +package alliance.alliance; + +import "alliance/alliance/alliance.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/Team-Kujira/core/legacygov/alliance"; + +message MsgCreateAllianceProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // Denom of the asset. It could either be a native token or an IBC token + string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""]; + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + string reward_weight = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // A positive take rate is used for liquid staking derivatives. It defines an annualized reward rate that + // will be redirected to the distribution rewards pool + string take_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string reward_change_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + google.protobuf.Duration reward_change_interval = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange reward_weight_range = 8 [ + (gogoproto.nullable) = false + ]; +} + +message MsgUpdateAllianceProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // Denom of the asset. It could either be a native token or an IBC token + string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""]; + // The reward weight specifies the ratio of rewards that will be given to each alliance asset + // It does not need to sum to 1. rate = weight / total_weight + // Native asset is always assumed to have a weight of 1. + string reward_weight = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string take_rate = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + string reward_change_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + google.protobuf.Duration reward_change_interval = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + + // set a bound of weight range to limit how much reward weights can scale. + RewardWeightRange reward_weight_range = 8 [ + (gogoproto.nullable) = false + ]; +} + +message MsgDeleteAllianceProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""]; +} \ No newline at end of file diff --git a/proto/kujira/scheduler/legacy_proposal.proto b/proto/kujira/scheduler/legacy_proposal.proto index d5265a1c..b427b6a6 100644 --- a/proto/kujira/scheduler/legacy_proposal.proto +++ b/proto/kujira/scheduler/legacy_proposal.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "kujira/scheduler/hook.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; +option go_package = "github.com/Team-Kujira/core/legacygov/scheduler"; option (gogoproto.goproto_stringer_all) = false; diff --git a/x/scheduler/types/codec.go b/x/scheduler/types/codec.go index fdb6c951..ea54340a 100644 --- a/x/scheduler/types/codec.go +++ b/x/scheduler/types/codec.go @@ -5,7 +5,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/oracle interfaces and concrete types @@ -17,24 +16,12 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } func RegisterCodec(cdc *codec.LegacyAmino) { - // legacy proposals - cdc.RegisterConcrete(&CreateHookProposal{}, "scheduler/CreateHookProposal", nil) - cdc.RegisterConcrete(&UpdateHookProposal{}, "scheduler/UpdateHookProposal", nil) - cdc.RegisterConcrete(&DeleteHookProposal{}, "scheduler/DeleteHookProposal", nil) - cdc.RegisterConcrete(&MsgCreateHook{}, "scheduler/MsgCreateHook", nil) cdc.RegisterConcrete(&MsgUpdateHook{}, "scheduler/MsgUpdateHook", nil) cdc.RegisterConcrete(&MsgDeleteHook{}, "scheduler/MsgDeleteHook", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // legacy proposals - registry.RegisterImplementations((*govtypes.Content)(nil), - &CreateHookProposal{}, - &UpdateHookProposal{}, - &DeleteHookProposal{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateHook{}, &MsgUpdateHook{}, From fddec0dcf337c43c94bf9460cda31a1a2a3a29f1 Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 31 Jul 2024 20:40:57 +0800 Subject: [PATCH 3/4] lint --- go.mod | 2 +- legacygov/scheduler/legacy_proposal.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index c92678c3..142e5d5a 100644 --- a/go.mod +++ b/go.mod @@ -43,6 +43,7 @@ require ( github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/rosetta v0.50.4 github.com/hashicorp/go-metrics v0.5.3 + google.golang.org/protobuf v1.33.0 ) require ( @@ -202,7 +203,6 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/legacygov/scheduler/legacy_proposal.go b/legacygov/scheduler/legacy_proposal.go index e718a04b..7f80b583 100644 --- a/legacygov/scheduler/legacy_proposal.go +++ b/legacygov/scheduler/legacy_proposal.go @@ -20,9 +20,9 @@ const ( ) func init() { // register new content types with the sdk - govtypesv1beta.RegisterProposalType(string(ProposalTypeCreateHook)) - govtypesv1beta.RegisterProposalType(string(ProposalTypeUpdateHook)) - govtypesv1beta.RegisterProposalType(string(ProposalTypeDeleteHook)) + govtypesv1beta.RegisterProposalType(ProposalTypeCreateHook) + govtypesv1beta.RegisterProposalType(ProposalTypeUpdateHook) + govtypesv1beta.RegisterProposalType(ProposalTypeDeleteHook) } var ( From f07ffbb0e675727e534e28d804e019bfa8668667 Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 31 Jul 2024 20:48:07 +0800 Subject: [PATCH 4/4] lint --- legacygov/scheduler/legacy_proposal.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/legacygov/scheduler/legacy_proposal.go b/legacygov/scheduler/legacy_proposal.go index 7f80b583..02d77125 100644 --- a/legacygov/scheduler/legacy_proposal.go +++ b/legacygov/scheduler/legacy_proposal.go @@ -35,7 +35,7 @@ var ( func (p CreateHookProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type -func (p CreateHookProposal) ProposalType() string { return string(ProposalTypeCreateHook) } +func (p CreateHookProposal) ProposalType() string { return ProposalTypeCreateHook } // ValidateBasic validates the proposal func (p CreateHookProposal) ValidateBasic() error { @@ -93,7 +93,7 @@ func (p UpdateHookProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type func (p UpdateHookProposal) ProposalType() string { - return string(ProposalTypeUpdateHook) + return ProposalTypeUpdateHook } // ValidateBasic validates the proposal @@ -161,7 +161,7 @@ func (p UpdateHookProposal) MarshalYAML() (interface{}, error) { func (p DeleteHookProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type -func (p DeleteHookProposal) ProposalType() string { return string(ProposalTypeDeleteHook) } +func (p DeleteHookProposal) ProposalType() string { return ProposalTypeDeleteHook } // ValidateBasic validates the proposal func (p DeleteHookProposal) ValidateBasic() error {