From 164e4fd33d5fc6909ab6438cd0094f1ffcfc5079 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Fri, 27 Sep 2024 19:12:15 +0530 Subject: [PATCH] feat: update params proto to add inflation change percentage --- proto/arkeo/arkeo/params.proto | 7 +-- x/arkeo/types/params.go | 7 +-- x/arkeo/types/params.pb.go | 96 ++++++++++++++++++++++++++-------- 3 files changed, 81 insertions(+), 29 deletions(-) diff --git a/proto/arkeo/arkeo/params.proto b/proto/arkeo/arkeo/params.proto index b7a7de5f..d32d5a75 100644 --- a/proto/arkeo/arkeo/params.proto +++ b/proto/arkeo/arkeo/params.proto @@ -10,7 +10,8 @@ option go_package = "github.com/arkeonetwork/arkeo/x/arkeo/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - string CommunityPoolPercentage= 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; - string DevFundPercentage= 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; - string GrantFundPercentage= 3 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; + string community_pool_percentage= 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; + string dev_fund_percentage= 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; + string grant_fund_percentage= 3 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; + string inflation_change_percentage = 4 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } diff --git a/x/arkeo/types/params.go b/x/arkeo/types/params.go index ebfb1a91..cefc91c1 100644 --- a/x/arkeo/types/params.go +++ b/x/arkeo/types/params.go @@ -16,9 +16,10 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams() Params { return Params{ - CommunityPoolPercentage: math.NewInt(10), - DevFundPercentage: math.NewInt(20), - GrantFundPercentage: math.NewInt(20), + CommunityPoolPercentage: math.NewInt(10), + DevFundPercentage: math.NewInt(20), + GrantFundPercentage: math.NewInt(20), + InflationChangePercentage: math.NewInt(13), } } diff --git a/x/arkeo/types/params.pb.go b/x/arkeo/types/params.pb.go index 7bff56db..86facb70 100644 --- a/x/arkeo/types/params.pb.go +++ b/x/arkeo/types/params.pb.go @@ -29,9 +29,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - CommunityPoolPercentage cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=CommunityPoolPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"CommunityPoolPercentage"` - DevFundPercentage cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=DevFundPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"DevFundPercentage"` - GrantFundPercentage cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=GrantFundPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"GrantFundPercentage"` + CommunityPoolPercentage cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=community_pool_percentage,json=communityPoolPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"community_pool_percentage"` + DevFundPercentage cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=dev_fund_percentage,json=devFundPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"dev_fund_percentage"` + GrantFundPercentage cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=grant_fund_percentage,json=grantFundPercentage,proto3,customtype=cosmossdk.io/math.Int" json:"grant_fund_percentage"` + InflationChangePercentage cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=inflation_change_percentage,json=inflationChangePercentage,proto3,customtype=cosmossdk.io/math.Int" json:"inflation_change_percentage"` } func (m *Params) Reset() { *m = Params{} } @@ -73,26 +74,29 @@ func init() { func init() { proto.RegisterFile("arkeo/arkeo/params.proto", fileDescriptor_47c871f4fc73dfc5) } var fileDescriptor_47c871f4fc73dfc5 = []byte{ - // 290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0x2c, 0xca, 0x4e, - 0xcd, 0xd7, 0x87, 0x90, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, - 0x42, 0xdc, 0x60, 0x31, 0x3d, 0x30, 0x29, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x16, 0xd7, 0x07, - 0xb1, 0x20, 0x4a, 0xa4, 0xe4, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0x93, 0x12, 0x8b, 0x53, - 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, 0x12, 0x0d, 0xf5, 0x93, 0xf3, 0x33, 0xf3, 0xa0, 0xf2, 0x92, - 0x10, 0xf9, 0x78, 0x88, 0x46, 0x08, 0x07, 0x22, 0xa5, 0xb4, 0x9e, 0x89, 0x8b, 0x2d, 0x00, 0x6c, - 0x9d, 0x50, 0x2a, 0x97, 0xb8, 0x73, 0x7e, 0x6e, 0x6e, 0x69, 0x5e, 0x66, 0x49, 0x65, 0x40, 0x7e, - 0x7e, 0x4e, 0x40, 0x6a, 0x51, 0x72, 0x6a, 0x5e, 0x49, 0x62, 0x7a, 0xaa, 0x04, 0xa3, 0x02, 0xa3, - 0x06, 0xa7, 0x93, 0xf6, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0x8b, 0x42, 0x4c, 0x28, 0x4e, - 0xc9, 0xd6, 0xcb, 0xcc, 0xd7, 0xcf, 0x4d, 0x2c, 0xc9, 0xd0, 0xf3, 0xcc, 0x2b, 0xb9, 0xb4, 0x45, - 0x97, 0x0b, 0x6a, 0xb4, 0x67, 0x5e, 0x49, 0x10, 0x2e, 0xb3, 0x84, 0x22, 0xb9, 0x04, 0x5d, 0x52, - 0xcb, 0xdc, 0x4a, 0xf3, 0x52, 0x90, 0x2c, 0x60, 0x22, 0xdd, 0x02, 0x4c, 0x53, 0x84, 0x62, 0xb9, - 0x84, 0xdd, 0x8b, 0x12, 0xf3, 0x4a, 0xd0, 0x0c, 0x67, 0x26, 0xdd, 0x70, 0x6c, 0xe6, 0x58, 0xb1, - 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0xe4, 0x7a, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, - 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, - 0x51, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0x90, 0x88, 0xcc, 0x4b, - 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0x86, 0xc6, 0x6a, 0x05, 0x94, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, - 0x62, 0x03, 0x87, 0xbf, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xf8, 0x23, 0xd7, 0xf9, 0x01, - 0x00, 0x00, + // 340 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x4e, 0xf3, 0x30, + 0x10, 0xc7, 0x93, 0xaf, 0x55, 0xa5, 0xcf, 0x4c, 0xb4, 0x54, 0xb4, 0x45, 0x72, 0x11, 0x13, 0x52, + 0x45, 0xa2, 0x8a, 0x8d, 0xb1, 0x08, 0xa4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 0x62, 0x3f, + 0xe4, 0xb3, 0xeb, 0x5c, 0x86, 0x3b, 0x70, 0x8f, 0x34, 0x45, 0xc6, 0x24, 0xfe, 0xc1, 0x57, 0xca, + 0xe3, 0x1b, 0x9a, 0xf4, 0x4b, 0x10, 0x93, 0xa3, 0x48, 0x8e, 0xa7, 0x0c, 0x23, 0x90, 0x5e, 0x30, + 0x61, 0x52, 0xf0, 0x5d, 0x4d, 0xb5, 0xbc, 0xa6, 0xbd, 0xe5, 0x5d, 0x6a, 0xdc, 0x8f, 0xec, 0xa2, + 0xfa, 0xf4, 0xdc, 0xb5, 0x06, 0x57, 0x8b, 0x35, 0xb5, 0x97, 0x6b, 0x6a, 0x7f, 0xae, 0xa9, 0xfd, + 0xb8, 0xa1, 0xd6, 0x72, 0x43, 0xad, 0xf7, 0x0d, 0xb5, 0x6e, 0x7b, 0x22, 0xc2, 0x49, 0xee, 0x3b, + 0x01, 0x24, 0x66, 0x76, 0x24, 0xc7, 0x7b, 0xc8, 0xe2, 0x62, 0x90, 0x1e, 0x8a, 0x15, 0xe7, 0x29, + 0x57, 0x7e, 0x4d, 0x7f, 0xf9, 0xf9, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x6d, 0xf0, 0xe5, + 0x6c, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -115,6 +119,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.InflationChangePercentage.Size() + i -= size + if _, err := m.InflationChangePercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 { size := m.GrantFundPercentage.Size() i -= size @@ -171,6 +185,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) l = m.GrantFundPercentage.Size() n += 1 + l + sovParams(uint64(l)) + l = m.InflationChangePercentage.Size() + n += 1 + l + sovParams(uint64(l)) return n } @@ -311,6 +327,40 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflationChangePercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflationChangePercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:])