From c8b392d6abfa5aed3795458cc243b7a7867db473 Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Fri, 5 Nov 2021 17:55:58 +0900 Subject: [PATCH 1/2] fix: fix indentation --- x/farming/types/proposal.go | 6 +++--- x/farming/types/staking.go | 19 ------------------- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 x/farming/types/staking.go diff --git a/x/farming/types/proposal.go b/x/farming/types/proposal.go index 30a37ac3..c33e779f 100644 --- a/x/farming/types/proposal.go +++ b/x/farming/types/proposal.go @@ -74,9 +74,9 @@ func (p *PublicPlanProposal) ValidateBasic() error { func (p PublicPlanProposal) String() string { return fmt.Sprintf(`Public Plan Proposal: - Title: %s - Description: %s - AddPlanRequests: %s + Title: %s + Description: %s + AddPlanRequests: %s UpdatePlanRequests: %s DeletePlanRequests: %s `, p.Title, p.Description, p.AddPlanRequests, p.ModifyPlanRequests, p.DeletePlanRequests) diff --git a/x/farming/types/staking.go b/x/farming/types/staking.go deleted file mode 100644 index 03af3e4f..00000000 --- a/x/farming/types/staking.go +++ /dev/null @@ -1,19 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -func (s Staking) String() string { - out, _ := s.MarshalYAML() - return out.(string) -} - -func (s Staking) MarshalYAML() (interface{}, error) { - bz, err := codec.MarshalYAML(codec.NewProtoCodec(codectypes.NewInterfaceRegistry()), &s) - if err != nil { - return nil, err - } - return string(bz), err -} From 2691957fb0c738fcfc6934a657d6450f1052b4ce Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Fri, 5 Nov 2021 17:57:21 +0900 Subject: [PATCH 2/2] fix: use default String implementation also fix some typos --- .../tendermint/farming/v1beta1/farming.proto | 16 +- .../tendermint/farming/v1beta1/proposal.proto | 2 +- x/farming/spec/02_state.md | 2 - x/farming/types/farming.pb.go | 181 +++++++++--------- x/farming/types/plan.go | 17 -- x/farming/types/proposal.pb.go | 2 +- 6 files changed, 98 insertions(+), 122 deletions(-) diff --git a/proto/tendermint/farming/v1beta1/farming.proto b/proto/tendermint/farming/v1beta1/farming.proto index 7a1403f4..3b52d286 100644 --- a/proto/tendermint/farming/v1beta1/farming.proto +++ b/proto/tendermint/farming/v1beta1/farming.proto @@ -43,8 +43,7 @@ message Params { // extend this type for additional functionality (for example, fixed amount plan, ratio // plan). message BasePlan { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; option (cosmos_proto.implements_interface) = "PlanI"; @@ -100,8 +99,7 @@ message BasePlan { // FixedAmountPlan defines a fixed amount plan that distributes a fixed amount // of coins for every epoch. message FixedAmountPlan { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; BasePlan base_plan = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_plan\""]; @@ -116,8 +114,7 @@ message FixedAmountPlan { // RatioPlan defines a plan that distributes to farmers by ratio // distribution for every epoch day. message RatioPlan { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; BasePlan base_plan = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_plan\""]; @@ -143,8 +140,7 @@ enum PlanType { // Staking defines a farmer's staking information. message Staking { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; @@ -165,7 +161,7 @@ message TotalStakings { string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; } -// HistoricalRewards defines the culative unit rewards for a given staking coin denom and an epoch number. +// HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. message HistoricalRewards { option (gogoproto.goproto_getters) = false; @@ -179,6 +175,8 @@ message HistoricalRewards { // OutstandingRewards represents outstanding (un-withdrawn) rewards // for a staking coin denom. message OutstandingRewards { + option (gogoproto.goproto_getters) = false; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } diff --git a/proto/tendermint/farming/v1beta1/proposal.proto b/proto/tendermint/farming/v1beta1/proposal.proto index 9d649763..21b0050d 100644 --- a/proto/tendermint/farming/v1beta1/proposal.proto +++ b/proto/tendermint/farming/v1beta1/proposal.proto @@ -82,7 +82,7 @@ message ModifyPlanRequest { // plan_id specifies index of the farming plan uint64 plan_id = 1; - // name specifies the plan name for diplay + // name specifies the plan name for display string name = 2; // farming_pool_address defines the bech32-encoded address of the farming pool diff --git a/x/farming/spec/02_state.md b/x/farming/spec/02_state.md index c3d28a37..67991518 100644 --- a/x/farming/spec/02_state.md +++ b/x/farming/spec/02_state.md @@ -50,8 +50,6 @@ type PlanI interface { GetBasePlan() *BasePlan - String() string - Validate() error } ``` diff --git a/x/farming/types/farming.pb.go b/x/farming/types/farming.pb.go index 3b814ed0..e32bec9c 100644 --- a/x/farming/types/farming.pb.go +++ b/x/farming/types/farming.pb.go @@ -142,8 +142,9 @@ type BasePlan struct { DistributedCoins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,11,rep,name=distributed_coins,json=distributedCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"distributed_coins" yaml:"distributed_coins"` } -func (m *BasePlan) Reset() { *m = BasePlan{} } -func (*BasePlan) ProtoMessage() {} +func (m *BasePlan) Reset() { *m = BasePlan{} } +func (m *BasePlan) String() string { return proto.CompactTextString(m) } +func (*BasePlan) ProtoMessage() {} func (*BasePlan) Descriptor() ([]byte, []int) { return fileDescriptor_5b657e0809d9de86, []int{1} } @@ -182,8 +183,9 @@ type FixedAmountPlan struct { EpochAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=epoch_amount,json=epochAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"epoch_amount" yaml:"epoch_amount"` } -func (m *FixedAmountPlan) Reset() { *m = FixedAmountPlan{} } -func (*FixedAmountPlan) ProtoMessage() {} +func (m *FixedAmountPlan) Reset() { *m = FixedAmountPlan{} } +func (m *FixedAmountPlan) String() string { return proto.CompactTextString(m) } +func (*FixedAmountPlan) ProtoMessage() {} func (*FixedAmountPlan) Descriptor() ([]byte, []int) { return fileDescriptor_5b657e0809d9de86, []int{2} } @@ -222,8 +224,9 @@ type RatioPlan struct { EpochRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=epoch_ratio,json=epochRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"epoch_ratio" yaml:"epoch_ratio"` } -func (m *RatioPlan) Reset() { *m = RatioPlan{} } -func (*RatioPlan) ProtoMessage() {} +func (m *RatioPlan) Reset() { *m = RatioPlan{} } +func (m *RatioPlan) String() string { return proto.CompactTextString(m) } +func (*RatioPlan) ProtoMessage() {} func (*RatioPlan) Descriptor() ([]byte, []int) { return fileDescriptor_5b657e0809d9de86, []int{3} } @@ -260,8 +263,9 @@ type Staking struct { StartingEpoch uint64 `protobuf:"varint,2,opt,name=starting_epoch,json=startingEpoch,proto3" json:"starting_epoch,omitempty" yaml:"starting_epoch"` } -func (m *Staking) Reset() { *m = Staking{} } -func (*Staking) ProtoMessage() {} +func (m *Staking) Reset() { *m = Staking{} } +func (m *Staking) String() string { return proto.CompactTextString(m) } +func (*Staking) ProtoMessage() {} func (*Staking) Descriptor() ([]byte, []int) { return fileDescriptor_5b657e0809d9de86, []int{4} } @@ -368,7 +372,7 @@ func (m *TotalStakings) XXX_DiscardUnknown() { var xxx_messageInfo_TotalStakings proto.InternalMessageInfo -// HistoricalRewards defines the culative unit rewards for a given staking coin denom and an epoch number. +// HistoricalRewards defines the cumulative unit rewards for a given staking coin denom and an epoch number. type HistoricalRewards struct { CumulativeUnitRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_unit_rewards,json=cumulativeUnitRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_unit_rewards" yaml:"cumulative_unit_rewards"` } @@ -445,13 +449,6 @@ func (m *OutstandingRewards) XXX_DiscardUnknown() { var xxx_messageInfo_OutstandingRewards proto.InternalMessageInfo -func (m *OutstandingRewards) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Rewards - } - return nil -} - func init() { proto.RegisterEnum("cosmos.farming.v1beta1.PlanType", PlanType_name, PlanType_value) proto.RegisterType((*Params)(nil), "cosmos.farming.v1beta1.Params") @@ -470,82 +467,82 @@ func init() { } var fileDescriptor_5b657e0809d9de86 = []byte{ - // 1192 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x3f, 0x6f, 0xdb, 0x46, - 0x14, 0xd7, 0x39, 0x8a, 0x2d, 0x9d, 0x6a, 0x5b, 0x3e, 0xff, 0x89, 0xac, 0x24, 0x22, 0x41, 0xa0, - 0x85, 0x90, 0x22, 0x12, 0x92, 0x74, 0xf2, 0x54, 0xd3, 0xb2, 0x5c, 0x01, 0x81, 0xa3, 0x30, 0x72, - 0xd3, 0x16, 0x28, 0x88, 0x13, 0x79, 0x96, 0x09, 0x53, 0xa4, 0xc0, 0x3b, 0xd9, 0xd6, 0xd8, 0xa1, - 0xa8, 0xe1, 0x29, 0x28, 0x3a, 0x74, 0x71, 0x11, 0xb4, 0x5b, 0xba, 0xf6, 0x3b, 0x34, 0xa3, 0x51, - 0xa0, 0x40, 0xd1, 0x81, 0x29, 0xec, 0x6f, 0xa0, 0xb9, 0x43, 0xc1, 0xbb, 0xa3, 0xc2, 0x06, 0x72, - 0x1d, 0x01, 0xe9, 0x44, 0xde, 0xfb, 0xf3, 0x7b, 0xbf, 0xf7, 0x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f, 0xfa, 0x8c, 0x32, 0xec, - 0xd9, 0x8e, 0xd7, 0x89, 0x53, 0xd9, 0x87, 0x33, 0x93, 0x30, 0x7f, 0x10, 0x31, 0x9f, 0x94, 0x57, - 0x1c, 0xe1, 0xce, 0xb7, 0x00, 0x66, 0xe2, 0xfb, 0x1c, 0xdd, 0x81, 0xcb, 0xcd, 0x87, 0xeb, 0xdb, - 0x66, 0xeb, 0xf3, 0xe6, 0xa6, 0xb9, 0xb3, 0xfd, 0xa4, 0xb9, 0xb9, 0xd1, 0xa8, 0x37, 0x36, 0x6b, - 0xf9, 0x54, 0x71, 0xfe, 0xe4, 0x54, 0xcd, 0xc5, 0x86, 0xdb, 0x8e, 0x8b, 0xca, 0x30, 0xff, 0xda, - 0xb6, 0xb9, 0xa3, 0x3f, 0x6c, 0x6c, 0xe4, 0x41, 0x11, 0x9d, 0x9c, 0xaa, 0x73, 0xb1, 0x59, 0xb3, - 0xdf, 0x76, 0x1d, 0x0b, 0xdd, 0x81, 0x0b, 0x09, 0x4b, 0xa3, 0xf1, 0xe9, 0x7a, 0x6b, 0x33, 0x3f, - 0x55, 0x5c, 0x3c, 0x39, 0x55, 0xe7, 0x47, 0xa6, 0xe2, 0x7f, 0xaf, 0x98, 0x3e, 0xfe, 0xa9, 0x94, - 0xd2, 0xb7, 0x5e, 0x9e, 0x97, 0xc0, 0xd9, 0x79, 0x09, 0xfc, 0x75, 0x5e, 0x02, 0xcf, 0x2e, 0x4a, - 0xa9, 0xb3, 0x8b, 0x52, 0xea, 0x8f, 0x8b, 0x52, 0xea, 0x8b, 0xbb, 0x89, 0x24, 0xc7, 0xfc, 0x77, - 0x1f, 0x8d, 0xde, 0x78, 0xbe, 0xed, 0x69, 0x7e, 0xb7, 0x3c, 0xf8, 0x27, 0x00, 0x00, 0xff, 0xff, - 0xc5, 0xee, 0x6f, 0xb4, 0xa4, 0x0b, 0x00, 0x00, + // 1193 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x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 0x5e, 0x27, 0x64, 0x2b, 0x91, 0xa2, 0x67, 0x00, 0x5e, 0x71, 0x89, 0x8f, 0x07, 0xc4, + 0xb5, 0x29, 0xc3, 0x4f, 0xb9, 0x5f, 0x07, 0x53, 0x51, 0xc4, 0xb4, 0x0e, 0xca, 0x69, 0xb3, 0xc9, + 0x2b, 0xf5, 0x47, 0xac, 0x7d, 0xf0, 0x0e, 0x55, 0xd8, 0xc1, 0x74, 0x18, 0x6b, 0x25, 0x49, 0xe3, + 0x1c, 0x58, 0xc3, 0x5a, 0x51, 0x9a, 0x87, 0x52, 0xb1, 0x83, 0x69, 0x9d, 0x90, 0x8d, 0xcc, 0xf3, + 0x97, 0x5a, 0xea, 0xdb, 0x97, 0x5a, 0xca, 0xf8, 0x7e, 0x0e, 0x66, 0x4c, 0x4c, 0x45, 0x15, 0xd1, + 0x02, 0x9c, 0xf1, 0xdc, 0x02, 0xe0, 0x54, 0xac, 0x19, 0xcf, 0x45, 0x08, 0xa6, 0x03, 0xdc, 0x25, + 0xa2, 0x7e, 0x59, 0x4b, 0xbc, 0xa3, 0x8f, 0x60, 0x9a, 0xc7, 0x17, 0x95, 0x58, 0xb8, 0xad, 0x57, + 0x26, 0xf7, 0x6b, 0x85, 0xe3, 0xb5, 0x06, 0x3d, 0x62, 0x09, 0x6b, 0xf4, 0x00, 0xae, 0x24, 0x95, + 0xea, 0x85, 0xa1, 0x6f, 0x63, 0xd7, 0x8d, 0x08, 0xa5, 0x22, 0xed, 0xac, 0xa9, 0x0d, 0x63, 0xed, + 0xea, 0x3f, 0xeb, 0x39, 0x6e, 0x65, 0x58, 0x48, 0x89, 0x9b, 0x61, 0xe8, 0x6f, 0x4a, 0x21, 0xba, + 0x0f, 0x97, 0x99, 0x18, 0x29, 0xd9, 0x3f, 0x09, 0xe2, 0x65, 0x81, 0x58, 0x1a, 0xc6, 0x5a, 0x51, + 0x22, 0x4e, 0x30, 0x32, 0x2c, 0x34, 0x26, 0x4d, 0x00, 0x7f, 0x00, 0x70, 0x25, 0xa9, 0x1f, 0x1f, + 0x14, 0x7b, 0x9f, 0x78, 0x9d, 0x27, 0x8c, 0x16, 0x66, 0x45, 0x83, 0x5f, 0x9b, 0xd8, 0xe0, 0x35, + 0xe2, 0x88, 0x1e, 0xb7, 0x54, 0x8f, 0xab, 0x34, 0x26, 0xe1, 0xf0, 0xf6, 0xfe, 0xf0, 0x1d, 0x3e, + 0xac, 0x82, 0xa4, 0x16, 0x52, 0x28, 0xfc, 0xf4, 0x48, 0x62, 0xa0, 0xcf, 0x20, 0xa4, 0x0c, 0x47, + 0xcc, 0xe6, 0xe3, 0x5a, 0x98, 0xd3, 0x41, 0x39, 0x77, 0xbb, 0x58, 0x91, 0xb3, 0x5c, 0x49, 0x66, + 0xb9, 0xd2, 0x4a, 0x66, 0xd9, 0xbc, 0xae, 0x78, 0x2d, 0x8d, 0x78, 0x29, 0x5f, 0xe3, 0xc5, 0x1b, + 0x0d, 0x58, 0x59, 0x21, 0xe0, 0xe6, 0xc8, 0x82, 0x19, 0x12, 0xb8, 0x12, 0x37, 0x73, 0x21, 0xee, + 0x55, 0x85, 0xbb, 0x28, 0x71, 0x13, 0x4f, 0x89, 0x3a, 0x47, 0x02, 0x57, 0x60, 0x96, 0x20, 0x4c, + 0x0a, 0x4d, 0xdc, 0x42, 0x56, 0x07, 0xe5, 0x8c, 0x35, 0x26, 0x41, 0xfb, 0x70, 0xcd, 0xc7, 0x94, + 0xd9, 0xae, 0x47, 0x59, 0xe4, 0xb5, 0xfb, 0xe2, 0x23, 0x09, 0x06, 0xf0, 0x42, 0x06, 0xff, 0x1f, + 0xc6, 0xda, 0x75, 0x19, 0x7d, 0x32, 0x86, 0xe4, 0xb2, 0xc2, 0x95, 0xb5, 0x31, 0x9d, 0x20, 0xf6, + 0x0d, 0x80, 0x4b, 0x23, 0x07, 0xe2, 0x8a, 0xef, 0x44, 0x0b, 0xb9, 0x8b, 0x36, 0xd9, 0x5d, 0x95, + 0x75, 0x41, 0x4d, 0xdd, 0xdb, 0x08, 0xd3, 0x6d, 0xb0, 0xfc, 0x98, 0xbf, 0x90, 0x6c, 0xcc, 0xf3, + 0xb9, 0xfc, 0xed, 0xe7, 0x9b, 0x97, 0xf9, 0xf8, 0x34, 0x8c, 0xbf, 0x00, 0x5c, 0xac, 0x7b, 0x07, + 0xc4, 0xdd, 0xec, 0x86, 0xfd, 0x80, 0x89, 0x19, 0x7d, 0x04, 0xb3, 0x9c, 0x97, 0xd8, 0x9e, 0x62, + 0x54, 0x73, 0xe7, 0x0f, 0x61, 0x32, 0xd8, 0x66, 0xe1, 0x38, 0xd6, 0xc0, 0x30, 0xd6, 0xf2, 0x92, + 0xf7, 0x08, 0xc0, 0xb0, 0x32, 0xed, 0x64, 0xf8, 0xbf, 0x02, 0xf0, 0x7f, 0x72, 0x25, 0x62, 0x11, + 0xad, 0x30, 0x73, 0x51, 0x35, 0x76, 0x54, 0x35, 0x96, 0x55, 0x0f, 0x8c, 0x39, 0x4f, 0x57, 0x88, + 0x9c, 0x70, 0x95, 0x49, 0x6e, 0xa4, 0x79, 0x0d, 0x8c, 0x5f, 0x01, 0xcc, 0x5a, 0x7c, 0x3c, 0xff, + 0xdb, 0xa4, 0x09, 0x94, 0xb1, 0xed, 0x88, 0xc7, 0x92, 0x8b, 0xce, 0xac, 0x4d, 0xb1, 0x85, 0x6b, + 0xc4, 0x19, 0xc6, 0x1a, 0x1a, 0xaf, 0x80, 0x80, 0x32, 0x2c, 0x28, 0x4e, 0x22, 0x07, 0x95, 0xd3, + 0x77, 0x00, 0xce, 0xa9, 0x3d, 0x8c, 0xea, 0x70, 0x56, 0x95, 0x19, 0x88, 0x98, 0x95, 0x29, 0x62, + 0x36, 0x02, 0x66, 0x29, 0x6f, 0xf4, 0x31, 0x5c, 0x10, 0x23, 0xcc, 0x97, 0x8d, 0x08, 0x28, 0x72, + 0x48, 0x9b, 0xeb, 0xc3, 0x58, 0x5b, 0x1d, 0x9b, 0xf9, 0x91, 0xde, 0xb0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0xdb, 0xf7, 0x1c, 0x74, 0x03, 0x2e, 0x8d, 0x59, 0x5a, 0x8d, 0x4f, 0x37, 0x5b, 0xdb, 0xf9, + 0x99, 0xe2, 0xf2, 0xe1, 0x91, 0xbe, 0x38, 0x32, 0x95, 0x7f, 0x79, 0xc5, 0xf4, 0xf3, 0x1f, 0x4b, + 0x29, 0x73, 0xe7, 0xf5, 0x49, 0x09, 0x1c, 0x9f, 0x94, 0xc0, 0x9f, 0x27, 0x25, 0xf0, 0xe2, 0xb4, + 0x94, 0x3a, 0x3e, 0x2d, 0xa5, 0x7e, 0x3f, 0x2d, 0xa5, 0xbe, 0xb8, 0x39, 0x96, 0xea, 0x84, 0xbf, + 0xed, 0x83, 0xd1, 0x9b, 0xc8, 0xba, 0x3d, 0x2b, 0x6e, 0x94, 0x3b, 0x7f, 0x07, 0x00, 0x00, 0xff, + 0xff, 0x5d, 0xc4, 0xc0, 0x03, 0x9a, 0x0b, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/farming/types/plan.go b/x/farming/types/plan.go index 5d2f3d78..8ed5694f 100644 --- a/x/farming/types/plan.go +++ b/x/farming/types/plan.go @@ -5,7 +5,6 @@ import ( "strings" "time" - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" @@ -189,20 +188,6 @@ func (plan BasePlan) Validate() error { return nil } -func (plan BasePlan) String() string { - out, _ := plan.MarshalYAML() - return out.(string) -} - -// MarshalYAML returns the YAML representation of a Plan. -func (plan BasePlan) MarshalYAML() (interface{}, error) { - bz, err := codec.MarshalYAML(codec.NewProtoCodec(codectypes.NewInterfaceRegistry()), &plan) - if err != nil { - return nil, err - } - return string(bz), err -} - // NewFixedAmountPlan returns a new fixed amount plan. func NewFixedAmountPlan(basePlan *BasePlan, epochAmount sdk.Coins) *FixedAmountPlan { return &FixedAmountPlan{ @@ -258,8 +243,6 @@ type PlanI interface { GetBasePlan() *BasePlan - String() string - Validate() error } diff --git a/x/farming/types/proposal.pb.go b/x/farming/types/proposal.pb.go index e5b873fa..38acb949 100644 --- a/x/farming/types/proposal.pb.go +++ b/x/farming/types/proposal.pb.go @@ -187,7 +187,7 @@ func (m *AddPlanRequest) GetEpochAmount() github_com_cosmos_cosmos_sdk_types.Coi type ModifyPlanRequest struct { // plan_id specifies index of the farming plan PlanId uint64 `protobuf:"varint,1,opt,name=plan_id,json=planId,proto3" json:"plan_id,omitempty"` - // name specifies the plan name for diplay + // name specifies the plan name for display Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // farming_pool_address defines the bech32-encoded address of the farming pool FarmingPoolAddress string `protobuf:"bytes,3,opt,name=farming_pool_address,json=farmingPoolAddress,proto3" json:"farming_pool_address,omitempty" yaml:"farming_pool_address"`