diff --git a/README.md b/README.md
index 06cb11dc..c22874dc 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,7 @@
·
Integration Guide
·
- Code Audit
-
+ Code Audit
diff --git a/audit/alliance-audit-v1.0.pdf b/audit/alliance-audit-v1.0.pdf
new file mode 100644
index 00000000..06b15436
Binary files /dev/null and b/audit/alliance-audit-v1.0.pdf differ
diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md
index 2912e7ab..8640ca0f 100644
--- a/docs/proto/proto-docs.md
+++ b/docs/proto/proto-docs.md
@@ -644,6 +644,7 @@ GenesisState defines the module's genesis state.
| `take_rate` | [string](#string) | | |
| `reward_change_rate` | [string](#string) | | |
| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | |
+| `reward_weight_range` | [RewardWeightRange](#alliance.alliance.RewardWeightRange) | | set a bound of weight range to limit how much reward weights can scale. |
@@ -1368,6 +1369,7 @@ Params
| `take_rate` | [string](#string) | | |
| `reward_change_rate` | [string](#string) | | |
| `reward_change_interval` | [google.protobuf.Duration](#google.protobuf.Duration) | | |
+| `reward_weight_range` | [RewardWeightRange](#alliance.alliance.RewardWeightRange) | | set a bound of weight range to limit how much reward weights can scale. |
diff --git a/proto/alliance/alliance/gov.proto b/proto/alliance/alliance/gov.proto
index 9317582c..541ded98 100644
--- a/proto/alliance/alliance/gov.proto
+++ b/proto/alliance/alliance/gov.proto
@@ -80,6 +80,10 @@ message MsgUpdateAllianceProposal {
(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 {
diff --git a/proto/alliance/alliance/tx.proto b/proto/alliance/alliance/tx.proto
index 01d18761..611b5287 100644
--- a/proto/alliance/alliance/tx.proto
+++ b/proto/alliance/alliance/tx.proto
@@ -157,6 +157,11 @@ message MsgUpdateAlliance {
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true
];
+
+ // set a bound of weight range to limit how much reward weights can scale.
+ RewardWeightRange reward_weight_range = 7 [
+ (gogoproto.nullable) = false
+ ];
}
message MsgUpdateAllianceResponse {}
diff --git a/x/alliance/client/cli/gov.go b/x/alliance/client/cli/gov.go
index af7917dc..06160085 100644
--- a/x/alliance/client/cli/gov.go
+++ b/x/alliance/client/cli/gov.go
@@ -118,7 +118,7 @@ func CreateAlliance() *cobra.Command {
func UpdateAlliance() *cobra.Command {
cmd := &cobra.Command{
- Use: "update-alliance denom reward-weight take-rate reward-change-rate reward-change-interval",
+ Use: "update-alliance denom reward-weight reward-weight-min reward-weight-max take-rate reward-change-rate reward-change-interval",
Args: cobra.ExactArgs(5),
Short: "Update an alliance with the specified parameters",
RunE: func(cmd *cobra.Command, args []string) error {
@@ -143,6 +143,16 @@ func UpdateAlliance() *cobra.Command {
return err
}
+ rewardWeightMin, err := sdk.NewDecFromStr(args[2])
+ if err != nil {
+ return err
+ }
+
+ rewardWeightMax, err := sdk.NewDecFromStr(args[3])
+ if err != nil {
+ return err
+ }
+
takeRate, err := sdk.NewDecFromStr(args[2])
if err != nil {
return err
@@ -175,6 +185,10 @@ func UpdateAlliance() *cobra.Command {
description,
denom,
rewardWeight,
+ types.RewardWeightRange{
+ Min: rewardWeightMin,
+ Max: rewardWeightMax,
+ },
takeRate,
rewardChangeRate,
rewardChangeInterval,
diff --git a/x/alliance/keeper/asset.go b/x/alliance/keeper/asset.go
index a2cd662c..a8ccbcec 100644
--- a/x/alliance/keeper/asset.go
+++ b/x/alliance/keeper/asset.go
@@ -82,6 +82,7 @@ func (k Keeper) UpdateAllianceAsset(ctx sdk.Context, newAsset types.AllianceAsse
asset.RewardChangeRate = newAsset.RewardChangeRate
asset.RewardChangeInterval = newAsset.RewardChangeInterval
asset.LastRewardChangeTime = newAsset.LastRewardChangeTime
+ asset.RewardWeightRange = newAsset.RewardWeightRange
k.SetAsset(ctx, asset)
return nil
diff --git a/x/alliance/keeper/msg_server.go b/x/alliance/keeper/msg_server.go
index cb1484e3..52b2f4e9 100644
--- a/x/alliance/keeper/msg_server.go
+++ b/x/alliance/keeper/msg_server.go
@@ -189,6 +189,7 @@ func (m MsgServer) UpdateAlliance(ctx context.Context, msg *types.MsgUpdateAllia
if !found {
return nil, types.ErrUnknownAsset
}
+ asset.RewardWeightRange = msg.RewardWeightRange
if asset.RewardWeightRange.Min.GT(msg.RewardWeight) || asset.RewardWeightRange.Max.LT(msg.RewardWeight) {
return nil, types.ErrRewardWeightOutOfBound
}
diff --git a/x/alliance/keeper/proposal.go b/x/alliance/keeper/proposal.go
index 25f0cdf2..c99ab900 100644
--- a/x/alliance/keeper/proposal.go
+++ b/x/alliance/keeper/proposal.go
@@ -28,6 +28,7 @@ func (k Keeper) UpdateAlliance(ctx context.Context, req *types.MsgUpdateAlliance
RewardWeight: req.RewardWeight,
TakeRate: req.TakeRate,
RewardChangeRate: req.RewardChangeRate,
+ RewardWeightRange: req.RewardWeightRange,
RewardChangeInterval: req.RewardChangeInterval,
})
return err
diff --git a/x/alliance/keeper/tests/asset_test.go b/x/alliance/keeper/tests/asset_test.go
index 1d8130e8..4e4269f3 100644
--- a/x/alliance/keeper/tests/asset_test.go
+++ b/x/alliance/keeper/tests/asset_test.go
@@ -741,6 +741,7 @@ func TestRewardWeightDecay(t *testing.T) {
Description: "",
Denom: AllianceDenom,
RewardWeight: sdk.MustNewDecFromStr("0.5"),
+ RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)},
TakeRate: sdk.ZeroDec(),
RewardChangeRate: sdk.ZeroDec(),
RewardChangeInterval: 0,
@@ -753,6 +754,7 @@ func TestRewardWeightDecay(t *testing.T) {
Description: "",
Denom: AllianceDenom,
RewardWeight: sdk.MustNewDecFromStr("0.5"),
+ RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)},
TakeRate: sdk.ZeroDec(),
RewardChangeRate: sdk.MustNewDecFromStr("0.1"),
RewardChangeInterval: decayInterval,
@@ -779,6 +781,7 @@ func TestRewardWeightDecay(t *testing.T) {
Description: "",
Denom: AllianceDenomTwo,
RewardWeight: sdk.MustNewDecFromStr("0.5"),
+ RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)},
TakeRate: sdk.ZeroDec(),
RewardChangeRate: sdk.MustNewDecFromStr("0.1"),
RewardChangeInterval: decayInterval,
@@ -1113,6 +1116,7 @@ func TestRewardWeightRateChange(t *testing.T) {
Description: "",
Denom: alliance.Denom,
RewardWeight: alliance.RewardWeight,
+ RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)},
TakeRate: alliance.TakeRate,
RewardChangeRate: sdk.MustNewDecFromStr("1.001"),
RewardChangeInterval: time.Minute * 5,
diff --git a/x/alliance/keeper/tests/proposal_test.go b/x/alliance/keeper/tests/proposal_test.go
index 15148739..8d5a7324 100644
--- a/x/alliance/keeper/tests/proposal_test.go
+++ b/x/alliance/keeper/tests/proposal_test.go
@@ -106,10 +106,14 @@ func TestUpdateAlliance(t *testing.T) {
// WHEN
updateErr := app.AllianceKeeper.UpdateAlliance(ctx, &types.MsgUpdateAllianceProposal{
- Title: "",
- Description: "",
- Denom: "uluna",
- RewardWeight: sdk.NewDec(6),
+ Title: "",
+ Description: "",
+ Denom: "uluna",
+ RewardWeight: sdk.NewDec(11),
+ RewardWeightRange: types.RewardWeightRange{
+ Min: sdk.NewDec(0),
+ Max: sdk.NewDec(11),
+ },
TakeRate: sdk.NewDec(7),
RewardChangeInterval: 0,
RewardChangeRate: sdk.ZeroDec(),
@@ -123,8 +127,8 @@ func TestUpdateAlliance(t *testing.T) {
Alliances: []types.AllianceAsset{
{
Denom: "uluna",
- RewardWeight: sdk.NewDec(6),
- RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(10)},
+ RewardWeight: sdk.NewDec(11),
+ RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(11)},
TakeRate: sdk.NewDec(7),
TotalTokens: sdk.ZeroInt(),
TotalValidatorShares: sdk.NewDec(0),
diff --git a/x/alliance/types/gov.go b/x/alliance/types/gov.go
index 1f87dc94..18387845 100644
--- a/x/alliance/types/gov.go
+++ b/x/alliance/types/gov.go
@@ -85,7 +85,7 @@ func (m *MsgCreateAllianceProposal) ValidateBasic() error {
return nil
}
-func NewMsgUpdateAllianceProposal(title, description, denom string, rewardWeight, takeRate sdk.Dec, rewardChangeRate sdk.Dec, rewardChangeInterval time.Duration) govtypes.Content {
+func NewMsgUpdateAllianceProposal(title, description, denom string, rewardWeight sdk.Dec, rewardWeightRange RewardWeightRange, takeRate sdk.Dec, rewardChangeRate sdk.Dec, rewardChangeInterval time.Duration) govtypes.Content {
return &MsgUpdateAllianceProposal{
Title: title,
Description: description,
@@ -94,6 +94,7 @@ func NewMsgUpdateAllianceProposal(title, description, denom string, rewardWeight
TakeRate: takeRate,
RewardChangeRate: rewardChangeRate,
RewardChangeInterval: rewardChangeInterval,
+ RewardWeightRange: rewardWeightRange,
}
}
func (m *MsgUpdateAllianceProposal) GetTitle() string { return m.Title }
@@ -122,6 +123,19 @@ func (m *MsgUpdateAllianceProposal) ValidateBasic() error {
return status.Errorf(codes.InvalidArgument, "Alliance rewardChangeInterval must be strictly a positive number")
}
+ if m.RewardWeightRange.Min.IsNil() || m.RewardWeightRange.Min.LT(sdk.ZeroDec()) ||
+ m.RewardWeightRange.Max.IsNil() || m.RewardWeightRange.Max.LT(sdk.ZeroDec()) {
+ 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
}
diff --git a/x/alliance/types/gov.pb.go b/x/alliance/types/gov.pb.go
index 21b3892b..3d0610e6 100644
--- a/x/alliance/types/gov.pb.go
+++ b/x/alliance/types/gov.pb.go
@@ -95,6 +95,8 @@ type MsgUpdateAllianceProposal struct {
TakeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=take_rate,json=takeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"take_rate"`
RewardChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" 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{} }
@@ -180,38 +182,37 @@ func init() {
func init() { proto.RegisterFile("alliance/alliance/gov.proto", fileDescriptor_c66988d3be8665d9) }
var fileDescriptor_c66988d3be8665d9 = []byte{
- // 483 bytes of a gzipped FileDescriptorProto
+ // 480 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0x31, 0x6f, 0xd3, 0x40,
- 0x14, 0xc7, 0x6d, 0x9a, 0x94, 0xf4, 0x5a, 0xa4, 0xf6, 0x88, 0x90, 0x5b, 0x24, 0x3b, 0x8a, 0x50,
- 0xd5, 0xa5, 0x67, 0x04, 0x5b, 0x37, 0xdc, 0x2c, 0x80, 0x90, 0x90, 0x11, 0x42, 0x54, 0x48, 0xd1,
+ 0x14, 0xc7, 0x6d, 0x48, 0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a6, 0x27, 0x99, 0x06, 0x75, 0xcc, 0x84, 0x77, 0xa7, 0xe5, 0xee, 0xae, 0x3d, 0xde, 0x22, 0xa5,
+ 0x7d, 0x64, 0x66, 0x1f, 0xe9, 0x56, 0xf6, 0x75, 0x1a, 0xe6, 0xf2, 0xaf, 0x3f, 0x03, 0x97, 0x36,
+ 0x17, 0xb1, 0xcf, 0x2a, 0x00, 0x3e, 0x44, 0xf7, 0x2e, 0xad, 0xb6, 0xa7, 0x8c, 0xec, 0x35, 0x2c,
+ 0xf7, 0x21, 0xb9, 0x92, 0x30, 0x42, 0x17, 0x76, 0x48, 0xcd, 0x6c, 0xa7, 0x66, 0xae, 0xa0, 0x9b,
+ 0xea, 0x5f, 0x61, 0xbf, 0xf1, 0xf9, 0x34, 0x70, 0x7e, 0x9f, 0x06, 0xce, 0x2c, 0x3e, 0x6f, 0xf2,
+ 0x78, 0x19, 0x9f, 0x65, 0x7c, 0xfe, 0x3b, 0x3e, 0x9f, 0x5c, 0x1b, 0x9f, 0x2e, 0x08, 0xb8, 0xf9,
+ 0xf8, 0xcc, 0xdf, 0xd1, 0x79, 0x7e, 0x36, 0xf1, 0xdd, 0xf3, 0x89, 0xef, 0xfe, 0x9a, 0xf8, 0xee,
+ 0x97, 0xa9, 0xef, 0x9c, 0x4f, 0x7d, 0xe7, 0xfb, 0xd4, 0x77, 0x0e, 0x1f, 0x2d, 0x98, 0xa3, 0x41,
+ 0x29, 0xb6, 0x97, 0xca, 0x0c, 0x46, 0xf3, 0xaf, 0xf0, 0xc7, 0x79, 0x69, 0xad, 0xea, 0xaf, 0xd8,
+ 0x65, 0x3f, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xec, 0xc4, 0xec, 0x59, 0xe2, 0x05, 0x00, 0x00,
}
func (m *MsgCreateAllianceProposal) Marshal() (dAtA []byte, err error) {
@@ -326,12 +327,22 @@ func (m *MsgUpdateAllianceProposal) MarshalToSizedBuffer(dAtA []byte) (int, erro
_ = i
var l int
_ = l
- 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
+ {
+ 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 -= n3
- i = encodeVarintGov(dAtA, i, uint64(n3))
+ i -= n4
+ i = encodeVarintGov(dAtA, i, uint64(n4))
i--
dAtA[i] = 0x3a
{
@@ -500,6 +511,8 @@ func (m *MsgUpdateAllianceProposal) Size() (n int) {
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
}
@@ -1104,6 +1117,39 @@ func (m *MsgUpdateAllianceProposal) Unmarshal(dAtA []byte) error {
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:])
diff --git a/x/alliance/types/tests/types_test.go b/x/alliance/types/tests/types_test.go
index 03281623..42943b05 100644
--- a/x/alliance/types/tests/types_test.go
+++ b/x/alliance/types/tests/types_test.go
@@ -62,11 +62,11 @@ func TestProposalsContent(t *testing.T) {
str: "title:\"Alliance1\" description:\"Alliance with 1\" denom:\"ibc/denom1\" reward_weight:\"1000000000000000000\" take_rate:\"1000000000000000000\" reward_change_rate:\"1000000000000000000\" reward_change_interval: reward_weight_range: ",
},
"msg_update_alliance_proposal": {
- p: types.NewMsgUpdateAllianceProposal("Alliance2", "Alliance with 2", "ibc/denom2", sdk.NewDec(2), sdk.NewDec(2), sdk.NewDec(2), time.Hour),
+ p: types.NewMsgUpdateAllianceProposal("Alliance2", "Alliance with 2", "ibc/denom2", sdk.NewDec(2), types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, sdk.NewDec(2), sdk.NewDec(2), time.Hour),
title: "Alliance2",
desc: "Alliance with 2",
typ: "msg_update_alliance_proposal",
- str: "title:\"Alliance2\" description:\"Alliance with 2\" denom:\"ibc/denom2\" reward_weight:\"2000000000000000000\" take_rate:\"2000000000000000000\" reward_change_rate:\"2000000000000000000\" reward_change_interval: ",
+ str: "title:\"Alliance2\" description:\"Alliance with 2\" denom:\"ibc/denom2\" reward_weight:\"2000000000000000000\" take_rate:\"2000000000000000000\" reward_change_rate:\"2000000000000000000\" reward_change_interval: reward_weight_range: ",
},
"msg_delete_alliance_proposal": {
p: types.NewMsgDeleteAllianceProposal("test", "abcd", "ibc/denom"),
@@ -130,7 +130,7 @@ func TestInvalidProposalsContent(t *testing.T) {
typ: "msg_create_alliance_proposal",
},
"msg_update_alliance_proposal": {
- p: types.NewMsgUpdateAllianceProposal("Alliance2", "Alliance with 2", "ibc/denom2", sdk.NewDec(2), sdk.NewDec(2), sdk.NewDec(2), -time.Hour),
+ p: types.NewMsgUpdateAllianceProposal("Alliance2", "Alliance with 2", "ibc/denom2", sdk.NewDec(2), types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, sdk.NewDec(2), sdk.NewDec(2), -time.Hour),
title: "Alliance2",
desc: "Alliance with 2",
typ: "msg_update_alliance_proposal",
diff --git a/x/alliance/types/tx.pb.go b/x/alliance/types/tx.pb.go
index 3417d71d..a82b5f96 100644
--- a/x/alliance/types/tx.pb.go
+++ b/x/alliance/types/tx.pb.go
@@ -550,6 +550,8 @@ type MsgUpdateAlliance struct {
TakeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=take_rate,json=takeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"take_rate"`
RewardChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=reward_change_rate,json=rewardChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_change_rate"`
RewardChangeInterval time.Duration `protobuf:"bytes,6,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,7,opt,name=reward_weight_range,json=rewardWeightRange,proto3" json:"reward_weight_range"`
}
func (m *MsgUpdateAlliance) Reset() { *m = MsgUpdateAlliance{} }
@@ -606,6 +608,13 @@ func (m *MsgUpdateAlliance) GetRewardChangeInterval() time.Duration {
return 0
}
+func (m *MsgUpdateAlliance) GetRewardWeightRange() RewardWeightRange {
+ if m != nil {
+ return m.RewardWeightRange
+ }
+ return RewardWeightRange{}
+}
+
type MsgUpdateAllianceResponse struct {
}
@@ -752,66 +761,66 @@ func init() {
func init() { proto.RegisterFile("alliance/alliance/tx.proto", fileDescriptor_caddd4794042022d) }
var fileDescriptor_caddd4794042022d = []byte{
- // 941 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x97, 0xcf, 0x6f, 0xe3, 0x44,
- 0x14, 0xc7, 0xe3, 0xb6, 0x1b, 0xda, 0xd9, 0xee, 0xd2, 0xba, 0xed, 0x36, 0x35, 0x92, 0x13, 0x42,
- 0x54, 0xaa, 0xd5, 0xd6, 0xa6, 0x0b, 0x02, 0xa9, 0xb7, 0x4d, 0xc3, 0x81, 0x1f, 0x91, 0x90, 0x2b,
- 0x04, 0xac, 0x10, 0xd1, 0xc4, 0x1e, 0x1c, 0x6b, 0x6d, 0x4f, 0x34, 0x33, 0xc9, 0x6e, 0x24, 0x4e,
- 0x70, 0xe1, 0x88, 0x38, 0x71, 0x41, 0x2c, 0xff, 0x01, 0x07, 0x4e, 0xfc, 0x05, 0x7b, 0x5c, 0x71,
- 0x42, 0x1c, 0xb2, 0xa8, 0x3d, 0xc0, 0x99, 0x03, 0x67, 0x34, 0x9e, 0xb1, 0x63, 0x27, 0xf6, 0x26,
- 0xbb, 0x42, 0xc0, 0x4a, 0x3d, 0xc5, 0xf6, 0x7b, 0xf3, 0x99, 0x37, 0xdf, 0xf7, 0xe6, 0xcd, 0x04,
- 0x68, 0xd0, 0xf7, 0x3d, 0x18, 0xda, 0xc8, 0x4c, 0x1e, 0xd8, 0x3d, 0xa3, 0x4f, 0x30, 0xc3, 0xea,
- 0x66, 0xfc, 0xc9, 0x88, 0x1f, 0xb4, 0x6d, 0x17, 0xbb, 0x38, 0xb2, 0x9a, 0xfc, 0x49, 0x38, 0x6a,
- 0x7b, 0x36, 0xa6, 0x01, 0xa6, 0x1d, 0x61, 0x10, 0x2f, 0xd2, 0xb4, 0x2b, 0xde, 0xcc, 0x80, 0xba,
- 0xe6, 0xf0, 0x88, 0xff, 0x48, 0x83, 0x2e, 0x0d, 0x5d, 0x48, 0x91, 0x39, 0x3c, 0xea, 0x22, 0x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 0x74, 0xfb, 0x95, 0x54, 0x7b, 0x62, 0x88, 0x10, 0x78, 0x18, 0xe0, 0x10, 0x8d,
- 0x26, 0xff, 0x21, 0xef, 0xa5, 0xfe, 0x07, 0xf3, 0x66, 0xd5, 0x2d, 0x47, 0xed, 0xe6, 0xd5, 0xbf,
- 0x03, 0x00, 0x00, 0xff, 0xff, 0xed, 0xcc, 0xf1, 0x5b, 0x29, 0x0f, 0x00, 0x00,
+ // 935 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0xe3, 0x44,
+ 0x14, 0x8e, 0xdb, 0x6e, 0x68, 0x67, 0xbb, 0x4b, 0xeb, 0xb6, 0xdb, 0xc4, 0x48, 0x4e, 0x08, 0x51,
+ 0xa9, 0x56, 0x5b, 0x9b, 0x2e, 0x08, 0xa4, 0xde, 0x36, 0x0d, 0x07, 0x7e, 0x44, 0x42, 0xae, 0x10,
+ 0xb0, 0x42, 0x44, 0x13, 0x7b, 0x70, 0xac, 0xb5, 0x3d, 0xd1, 0xcc, 0x24, 0xbb, 0x91, 0x38, 0xc1,
+ 0x85, 0x23, 0xe2, 0xc4, 0x05, 0xb1, 0xfc, 0x07, 0x1c, 0x38, 0xf1, 0x17, 0xec, 0x71, 0xc5, 0x09,
+ 0x71, 0xe8, 0xa2, 0xf6, 0x00, 0x67, 0x0e, 0x9c, 0xd1, 0x78, 0xc6, 0x8e, 0x9d, 0xd8, 0x9b, 0x74,
+ 0x85, 0x80, 0x43, 0x4f, 0xb1, 0xfd, 0xde, 0x7c, 0xef, 0xbd, 0xef, 0x7d, 0xf3, 0x66, 0x02, 0x34,
+ 0xe8, 0xfb, 0x1e, 0x0c, 0x6d, 0x64, 0x26, 0x0f, 0xec, 0x81, 0x31, 0x20, 0x98, 0x61, 0x75, 0x33,
+ 0xfe, 0x64, 0xc4, 0x0f, 0xda, 0xb6, 0x8b, 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xcb, 0x71, 0x5e, 0x94, 0xfc, 0xcd, 0xc5, 0xa3, 0x4c, 0x6d, 0xac, 0x66, 0xb1, 0x2e,
+ 0xe7, 0x47, 0xc9, 0xdf, 0x1f, 0xad, 0xb7, 0x1f, 0x9d, 0xe9, 0xca, 0xe3, 0x33, 0x5d, 0xf9, 0xed,
+ 0x4c, 0x57, 0xbe, 0x3a, 0xd7, 0x4b, 0x8f, 0xcf, 0xf5, 0xd2, 0x2f, 0xe7, 0x7a, 0xe9, 0xee, 0x2b,
+ 0xa9, 0xd1, 0xc7, 0x10, 0x21, 0xf0, 0x20, 0xc0, 0x21, 0x1a, 0x4f, 0xfe, 0x9f, 0x3e, 0x48, 0xfd,
+ 0xc7, 0xe6, 0x83, 0xb0, 0x57, 0x8e, 0x46, 0xd9, 0xab, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xf3,
+ 0x0f, 0x3f, 0x52, 0x85, 0x0f, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1621,12 +1630,22 @@ func (m *MsgUpdateAlliance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
- n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):])
- if err7 != nil {
- return 0, err7
+ {
+ size, err := m.RewardWeightRange.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintTx(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x3a
+ n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RewardChangeInterval, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval):])
+ if err8 != nil {
+ return 0, err8
}
- i -= n7
- i = encodeVarintTx(dAtA, i, uint64(n7))
+ i -= n8
+ i = encodeVarintTx(dAtA, i, uint64(n8))
i--
dAtA[i] = 0x32
{
@@ -1970,6 +1989,8 @@ func (m *MsgUpdateAlliance) Size() (n int) {
n += 1 + l + sovTx(uint64(l))
l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RewardChangeInterval)
n += 1 + l + sovTx(uint64(l))
+ l = m.RewardWeightRange.Size()
+ n += 1 + l + sovTx(uint64(l))
return n
}
@@ -3558,6 +3579,39 @@ func (m *MsgUpdateAlliance) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
+ case 7:
+ 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 ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ 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 := skipTx(dAtA[iNdEx:])