diff --git a/go.mod b/go.mod index 9da09f09a..68bc48b5d 100644 --- a/go.mod +++ b/go.mod @@ -178,7 +178,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.3 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230830024916-258a09e84d27 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230906051413-bab493b93970 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 0389e931a..20bc85165 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v0.0.3 h1:tv8NMy3bzX/1urqXGQIIAZSLy83lo github.com/bnb-chain/greenfield-cometbft v0.0.3/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230830024916-258a09e84d27 h1:sqmAIC7IRqptGrwNPGQZuqDhcNQYpX1iUADGKMwa9RQ= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230830024916-258a09e84d27/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230906051413-bab493b93970 h1:ulx0NMVthyQaO2OBkV2Y1yFLqplitN2a7aHyL8PsUlk= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230906051413-bab493b93970/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= diff --git a/proto/greenfield/payment/v1/genesis.proto b/proto/greenfield/payment/v1/genesis.proto new file mode 100644 index 000000000..27a033580 --- /dev/null +++ b/proto/greenfield/payment/v1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package greenfield.payment.v1; + +import "gogoproto/gogo.proto"; +import "greenfield/payment/auto_settle_record.proto"; +import "greenfield/payment/payment_account.proto"; +import "greenfield/payment/payment_account_count.proto"; +import "greenfield/payment/stream_record.proto"; +import "greenfield/payment/v1/params.proto"; + +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/bnb-chain/greenfield/x/payment/types/v1"; + +// GenesisState defines the payment module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated StreamRecord stream_record_list = 2 [(gogoproto.nullable) = false]; + repeated PaymentAccountCount payment_account_count_list = 3 [(gogoproto.nullable) = false]; + repeated PaymentAccount payment_account_list = 4 [(gogoproto.nullable) = false]; + repeated AutoSettleRecord auto_settle_record_list = 5 [(gogoproto.nullable) = false]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/greenfield/payment/v1/params.proto b/proto/greenfield/payment/v1/params.proto new file mode 100644 index 000000000..5afe699cd --- /dev/null +++ b/proto/greenfield/payment/v1/params.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package greenfield.payment.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bnb-chain/greenfield/x/payment/types/v1"; + +// Params defines the parameters for the module. +message Params { + VersionedParams versioned_params = 1 [(gogoproto.nullable) = false]; + // The maximum number of payment accounts that can be created by one user + uint64 payment_account_count_limit = 2 [(gogoproto.moretags) = "yaml:\"payment_account_count_limit\""]; + // Time duration threshold of forced settlement. + // If dynamic balance is less than NetOutFlowRate * forcedSettleTime, the account can be forced settled. + uint64 forced_settle_time = 3 [(gogoproto.moretags) = "yaml:\"forced_settle_time\""]; + // the maximum number of flows that will be auto forced settled in one block + uint64 max_auto_settle_flow_count = 4 [(gogoproto.moretags) = "yaml:\"max_auto_settle_flow_count\""]; + // the maximum number of flows that will be auto resumed in one block + uint64 max_auto_resume_flow_count = 5 [(gogoproto.moretags) = "yaml:\"max_auto_resume_flow_count\""]; + // The denom of fee charged in payment module + string fee_denom = 6 [(gogoproto.moretags) = "yaml:\"fee_denom\""]; +} + +// VersionedParams defines the parameters with multiple versions, each version is stored with different timestamp. +message VersionedParams { + // Time duration which the buffer balance need to be reserved for NetOutFlow e.g. 6 month + uint64 reserve_time = 1 [(gogoproto.moretags) = "yaml:\"reserve_time\""]; + // The tax rate to pay for validators in storage payment. The default value is 1%(0.01) + string validator_tax_rate = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} diff --git a/x/payment/genesis.go b/x/payment/genesis.go index 6594c2349..bcfc0b203 100644 --- a/x/payment/genesis.go +++ b/x/payment/genesis.go @@ -4,11 +4,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bnb-chain/greenfield/x/payment/keeper" - "github.com/bnb-chain/greenfield/x/payment/types" + v1 "github.com/bnb-chain/greenfield/x/payment/types/v1" ) // InitGenesis initializes the module's state from a provided genesis state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState v1.GenesisState) { // Set all the streamRecord for _, elem := range genState.StreamRecordList { k.SetStreamRecord(ctx, &elem) @@ -25,16 +25,16 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.AutoSettleRecordList { k.SetAutoSettleRecord(ctx, &elem) } - err := k.SetParams(ctx, genState.Params) + err := k.SetV1Params(ctx, genState.Params) if err != nil { panic(err) } } // ExportGenesis returns the module's exported genesis -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *v1.GenesisState { + genesis := v1.DefaultGenesis() + genesis.Params = k.GetV1Params(ctx) genesis.StreamRecordList = k.GetAllStreamRecord(ctx) genesis.PaymentAccountCountList = k.GetAllPaymentAccountCount(ctx) diff --git a/x/payment/keeper/params.go b/x/payment/keeper/params.go index 0567c46e2..57849b5e6 100644 --- a/x/payment/keeper/params.go +++ b/x/payment/keeper/params.go @@ -7,8 +7,49 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bnb-chain/greenfield/x/payment/types" + v1 "github.com/bnb-chain/greenfield/x/payment/types/v1" ) +// GetV1Params get all parameters as v1.Params +func (k Keeper) GetV1Params(ctx sdk.Context) (p v1.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return p + } + k.cdc.MustUnmarshal(bz, &p) + return p +} + +// SetV1Params set the params +func (k Keeper) SetV1Params(ctx sdk.Context, params v1.Params) error { + if err := params.Validate(); err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(¶ms) + store.Set(types.ParamsKey, bz) + + // store versioned params + err := k.SetV1VersionedParamsWithTs(ctx, params.VersionedParams) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) SetV1VersionedParamsWithTs(ctx sdk.Context, verParams v1.VersionedParams) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.VersionedParamsKeyPrefix) + key := types.VersionedParamsKey(ctx.BlockTime().Unix()) + + b := k.cdc.MustMarshal(&verParams) + store.Set(key, b) + + return nil +} + // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx sdk.Context) (p types.Params) { store := ctx.KVStore(k.storeKey) diff --git a/x/payment/keeper/v2/migrations.go b/x/payment/keeper/v2/migrations.go index c96e794dc..6bc990da6 100644 --- a/x/payment/keeper/v2/migrations.go +++ b/x/payment/keeper/v2/migrations.go @@ -5,8 +5,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - v1 "github.com/bnb-chain/greenfield/x/payment/keeper/v1" "github.com/bnb-chain/greenfield/x/payment/types" + v1 "github.com/bnb-chain/greenfield/x/payment/types/v1" ) func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { diff --git a/x/payment/module.go b/x/payment/module.go index 5ffe86eae..97407655e 100644 --- a/x/payment/module.go +++ b/x/payment/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + v1 "github.com/bnb-chain/greenfield/x/payment/types/v1" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -54,7 +56,7 @@ func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { // DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) + return cdc.MustMarshalJSON(v1.DefaultGenesis()) } // ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form @@ -127,7 +129,7 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs the module's genesis initialization. It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState + var genState v1.GenesisState // Initialize global index to index in genesis state cdc.MustUnmarshalJSON(gs, &genState) diff --git a/x/payment/types/v1/genesis.go b/x/payment/types/v1/genesis.go new file mode 100644 index 000000000..d10db0450 --- /dev/null +++ b/x/payment/types/v1/genesis.go @@ -0,0 +1,72 @@ +package v1 + +import ( + "fmt" + + "github.com/bnb-chain/greenfield/x/payment/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + StreamRecordList: []types.StreamRecord{}, + PaymentAccountCountList: []types.PaymentAccountCount{}, + PaymentAccountList: []types.PaymentAccount{}, + AutoSettleRecordList: []types.AutoSettleRecord{}, + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // Check for duplicated index in streamRecord + streamRecordIndexMap := make(map[string]struct{}) + + for _, elem := range gs.StreamRecordList { + index := string(types.StreamRecordKey(sdk.MustAccAddressFromHex(elem.Account))) + if _, ok := streamRecordIndexMap[index]; ok { + return fmt.Errorf("duplicated index for streamRecord") + } + streamRecordIndexMap[index] = struct{}{} + } + // Check for duplicated index in paymentAccountCount + paymentAccountCountIndexMap := make(map[string]struct{}) + + for _, elem := range gs.PaymentAccountCountList { + index := string(types.PaymentAccountCountKey(sdk.MustAccAddressFromHex(elem.Owner))) + if _, ok := paymentAccountCountIndexMap[index]; ok { + return fmt.Errorf("duplicated index for paymentAccountCount") + } + paymentAccountCountIndexMap[index] = struct{}{} + } + // Check for duplicated index in paymentAccount + paymentAccountIndexMap := make(map[string]struct{}) + + for _, elem := range gs.PaymentAccountList { + index := string(types.PaymentAccountKey(sdk.MustAccAddressFromHex(elem.Addr))) + if _, ok := paymentAccountIndexMap[index]; ok { + return fmt.Errorf("duplicated index for paymentAccount") + } + paymentAccountIndexMap[index] = struct{}{} + } + + // Check for duplicated index in autoSettleRecord + autoSettleRecordIndexMap := make(map[string]struct{}) + + for _, elem := range gs.AutoSettleRecordList { + index := string(types.AutoSettleRecordKey(elem.Timestamp, sdk.MustAccAddressFromHex(elem.Addr))) + if _, ok := autoSettleRecordIndexMap[index]; ok { + return fmt.Errorf("duplicated index for autoSettleRecord") + } + autoSettleRecordIndexMap[index] = struct{}{} + } + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/payment/types/v1/genesis.pb.go b/x/payment/types/v1/genesis.pb.go new file mode 100644 index 000000000..c55836d83 --- /dev/null +++ b/x/payment/types/v1/genesis.pb.go @@ -0,0 +1,583 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: greenfield/payment/v1/genesis.proto + +package v1 + +import ( + fmt "fmt" + types "github.com/bnb-chain/greenfield/x/payment/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 + +// GenesisState defines the payment module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + StreamRecordList []types.StreamRecord `protobuf:"bytes,2,rep,name=stream_record_list,json=streamRecordList,proto3" json:"stream_record_list"` + PaymentAccountCountList []types.PaymentAccountCount `protobuf:"bytes,3,rep,name=payment_account_count_list,json=paymentAccountCountList,proto3" json:"payment_account_count_list"` + PaymentAccountList []types.PaymentAccount `protobuf:"bytes,4,rep,name=payment_account_list,json=paymentAccountList,proto3" json:"payment_account_list"` + AutoSettleRecordList []types.AutoSettleRecord `protobuf:"bytes,5,rep,name=auto_settle_record_list,json=autoSettleRecordList,proto3" json:"auto_settle_record_list"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_2ea8a10191b57aee, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetStreamRecordList() []types.StreamRecord { + if m != nil { + return m.StreamRecordList + } + return nil +} + +func (m *GenesisState) GetPaymentAccountCountList() []types.PaymentAccountCount { + if m != nil { + return m.PaymentAccountCountList + } + return nil +} + +func (m *GenesisState) GetPaymentAccountList() []types.PaymentAccount { + if m != nil { + return m.PaymentAccountList + } + return nil +} + +func (m *GenesisState) GetAutoSettleRecordList() []types.AutoSettleRecord { + if m != nil { + return m.AutoSettleRecordList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "greenfield.payment.v1.GenesisState") +} + +func init() { + proto.RegisterFile("greenfield/payment/v1/genesis.proto", fileDescriptor_2ea8a10191b57aee) +} + +var fileDescriptor_2ea8a10191b57aee = []byte{ + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x4f, 0xf2, 0x40, + 0x18, 0xc7, 0xdb, 0x17, 0x5e, 0x86, 0xe2, 0x60, 0x1a, 0x0c, 0x84, 0xc4, 0x4a, 0xd0, 0x28, 0x89, + 0xf1, 0x2e, 0xe0, 0xe8, 0x04, 0x0e, 0x2e, 0x0c, 0x04, 0x9c, 0x58, 0x9a, 0x6b, 0x39, 0x4b, 0x0d, + 0xed, 0x35, 0xbd, 0xa7, 0x44, 0xbe, 0x85, 0x1f, 0x8b, 0xc1, 0x81, 0xd1, 0xc9, 0x18, 0xf8, 0x22, + 0x86, 0xbb, 0x8b, 0x52, 0xb8, 0x84, 0xa5, 0xd7, 0x5c, 0x7f, 0xf7, 0xfb, 0x5f, 0xff, 0x79, 0xac, + 0xcb, 0x20, 0xa5, 0x34, 0x7e, 0x09, 0xe9, 0x6c, 0x82, 0x13, 0xb2, 0x88, 0x68, 0x0c, 0x78, 0xde, + 0xc6, 0x01, 0x8d, 0x29, 0x0f, 0x39, 0x4a, 0x52, 0x06, 0xcc, 0x3e, 0xfb, 0x83, 0x90, 0x82, 0xd0, + 0xbc, 0x5d, 0xaf, 0x04, 0x2c, 0x60, 0x82, 0xc0, 0xdb, 0x37, 0x09, 0xd7, 0x6f, 0x35, 0x46, 0x92, + 0x01, 0x73, 0x39, 0x05, 0x98, 0x51, 0x37, 0xa5, 0x3e, 0x4b, 0x27, 0x0a, 0x6e, 0x69, 0x60, 0xb5, + 0xba, 0xc4, 0xf7, 0x59, 0x16, 0x83, 0x22, 0xd1, 0x71, 0xd2, 0xdd, 0xe5, 0xaf, 0x35, 0x3c, 0x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ce, 0x9f, 0x92, 0x30, 0xc6, 0x3b, 0x13, 0xf2, 0xf6, 0x3b, + 0x23, 0xb0, 0x48, 0x28, 0xc7, 0xf3, 0xb6, 0x57, 0x12, 0x33, 0x72, 0xff, 0x13, 0x00, 0x00, 0xff, + 0xff, 0x2f, 0x92, 0xf9, 0x0a, 0x4a, 0x03, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AutoSettleRecordList) > 0 { + for iNdEx := len(m.AutoSettleRecordList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AutoSettleRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.PaymentAccountList) > 0 { + for iNdEx := len(m.PaymentAccountList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PaymentAccountList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.PaymentAccountCountList) > 0 { + for iNdEx := len(m.PaymentAccountCountList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PaymentAccountCountList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.StreamRecordList) > 0 { + for iNdEx := len(m.StreamRecordList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StreamRecordList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.StreamRecordList) > 0 { + for _, e := range m.StreamRecordList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PaymentAccountCountList) > 0 { + for _, e := range m.PaymentAccountCountList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PaymentAccountList) > 0 { + for _, e := range m.PaymentAccountList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AutoSettleRecordList) > 0 { + for _, e := range m.AutoSettleRecordList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamRecordList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StreamRecordList = append(m.StreamRecordList, types.StreamRecord{}) + if err := m.StreamRecordList[len(m.StreamRecordList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PaymentAccountCountList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PaymentAccountCountList = append(m.PaymentAccountCountList, types.PaymentAccountCount{}) + if err := m.PaymentAccountCountList[len(m.PaymentAccountCountList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PaymentAccountList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PaymentAccountList = append(m.PaymentAccountList, types.PaymentAccount{}) + if err := m.PaymentAccountList[len(m.PaymentAccountList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoSettleRecordList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AutoSettleRecordList = append(m.AutoSettleRecordList, types.AutoSettleRecord{}) + if err := m.AutoSettleRecordList[len(m.AutoSettleRecordList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/payment/types/v1/params.go b/x/payment/types/v1/params.go new file mode 100644 index 000000000..8c90bbfb1 --- /dev/null +++ b/x/payment/types/v1/params.go @@ -0,0 +1,212 @@ +package v1 + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +var ( + KeyReserveTime = []byte("ReserveTime") + KeyForcedSettleTime = []byte("ForcedSettleTime") + KeyPaymentAccountCountLimit = []byte("PaymentAccountCountLimit") + KeyMaxAutoSettleFlowCount = []byte("MaxAutoSettleFlowCount") + KeyMaxAutoResumeFlowCount = []byte("MaxAutoResumeFlowCount") + KeyFeeDenom = []byte("FeeDenom") + KeyValidatorTaxRate = []byte("ValidatorTaxRate") + + DefaultReserveTime uint64 = 180 * 24 * 60 * 60 // 180 days + DefaultValidatorTaxRate sdk.Dec = sdk.NewDecWithPrec(1, 2) // 1% + + DefaultForcedSettleTime uint64 = 24 * 60 * 60 // 1 day + DefaultPaymentAccountCountLimit uint64 = 200 + DefaultMaxAutoSettleFlowCount uint64 = 100 + DefaultMaxAutoResumeFlowCount uint64 = 100 + DefaultFeeDenom string = "BNB" +) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams( + reserveTime uint64, + validatorTaxRate sdk.Dec, + forcedSettleTime uint64, + paymentAccountCountLimit uint64, + MaxAutoSettleFlowCount uint64, + maxAutoResumeFlowCount uint64, + feeDenom string, +) Params { + return Params{ + VersionedParams: VersionedParams{ReserveTime: reserveTime, ValidatorTaxRate: validatorTaxRate}, + ForcedSettleTime: forcedSettleTime, + PaymentAccountCountLimit: paymentAccountCountLimit, + MaxAutoSettleFlowCount: MaxAutoSettleFlowCount, + MaxAutoResumeFlowCount: maxAutoResumeFlowCount, + FeeDenom: feeDenom, + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + DefaultReserveTime, + DefaultValidatorTaxRate, + DefaultForcedSettleTime, + DefaultPaymentAccountCountLimit, + DefaultMaxAutoSettleFlowCount, + DefaultMaxAutoResumeFlowCount, + DefaultFeeDenom, + ) +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyReserveTime, &p.VersionedParams.ReserveTime, validateReserveTime), + paramtypes.NewParamSetPair(KeyValidatorTaxRate, &p.VersionedParams.ValidatorTaxRate, validateValidatorTaxRate), + paramtypes.NewParamSetPair(KeyForcedSettleTime, &p.ForcedSettleTime, validateForcedSettleTime), + paramtypes.NewParamSetPair(KeyPaymentAccountCountLimit, &p.PaymentAccountCountLimit, validatePaymentAccountCountLimit), + paramtypes.NewParamSetPair(KeyMaxAutoSettleFlowCount, &p.MaxAutoSettleFlowCount, validateMaxAutoSettleFlowCount), + paramtypes.NewParamSetPair(KeyMaxAutoResumeFlowCount, &p.MaxAutoResumeFlowCount, validateMaxAutoResumeFlowCount), + paramtypes.NewParamSetPair(KeyFeeDenom, &p.FeeDenom, validateFeeDenom), + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + if err := validateReserveTime(p.VersionedParams.ReserveTime); err != nil { + return err + } + + if err := validateValidatorTaxRate(p.VersionedParams.ValidatorTaxRate); err != nil { + return err + } + + if err := validateForcedSettleTime(p.ForcedSettleTime); err != nil { + return err + } + + if err := validatePaymentAccountCountLimit(p.PaymentAccountCountLimit); err != nil { + return err + } + + if err := validateMaxAutoSettleFlowCount(p.MaxAutoSettleFlowCount); err != nil { + return err + } + + if err := validateMaxAutoResumeFlowCount(p.MaxAutoResumeFlowCount); err != nil { + return err + } + + if err := validateFeeDenom(p.FeeDenom); err != nil { + return err + } + + if p.VersionedParams.ReserveTime <= p.ForcedSettleTime { + return fmt.Errorf("reserve time must be greater than force settle time") + } + + return nil +} + +// validateReserveTime validates the ReserveTime param +func validateReserveTime(v interface{}) error { + reserveTime, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if reserveTime <= 0 { + return fmt.Errorf("reserve time must be positive") + } + + return nil +} + +// validateForcedSettleTime validates the ForcedSettleTime param +func validateForcedSettleTime(v interface{}) error { + ForcedSettleTime, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if ForcedSettleTime <= 0 { + return fmt.Errorf("forced settle time must be positive") + } + return nil +} + +// validatePaymentAccountCountLimit validates the PaymentAccountCountLimit param +func validatePaymentAccountCountLimit(v interface{}) error { + paymentAccountCountLimit, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if paymentAccountCountLimit <= 0 { + return fmt.Errorf("payment account count limit must be positive") + } + + return nil +} + +// validateMaxAutoSettleFlowCount validates the MaxAutoSettleFlowCount param +func validateMaxAutoSettleFlowCount(v interface{}) error { + maxAutoSettleFlowCount, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if maxAutoSettleFlowCount <= 0 { + return fmt.Errorf("max force settle flow count must be positive") + } + + return nil +} + +// validateMaxAutoResumeFlowCount validates the MaxAutoResumeFlowCount param +func validateMaxAutoResumeFlowCount(v interface{}) error { + maxAutoResumeFlowCount, ok := v.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if maxAutoResumeFlowCount <= 0 { + return fmt.Errorf("max auto resume flow count must be positive") + } + + return nil +} + +// validateFeeDenom validates the FeeDenom param +func validateFeeDenom(v interface{}) error { + feeDenom, ok := v.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + _ = feeDenom + + return nil +} + +// validateValidatorTaxRate validates the ValidatorTaxRate param +func validateValidatorTaxRate(v interface{}) error { + validatorTaxRate, ok := v.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", v) + } + + if validatorTaxRate.IsNil() || validatorTaxRate.IsNegative() || validatorTaxRate.GT(sdk.OneDec()) { + return fmt.Errorf("validator tax ratio should be between 0 and 1, is %s", validatorTaxRate) + } + + return nil +} diff --git a/x/payment/keeper/v1/params.pb.go b/x/payment/types/v1/params.pb.go similarity index 82% rename from x/payment/keeper/v1/params.pb.go rename to x/payment/types/v1/params.pb.go index fbc572f46..53c90edff 100644 --- a/x/payment/keeper/v1/params.pb.go +++ b/x/payment/types/v1/params.pb.go @@ -1,15 +1,17 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: greenfield/payment/v1/params.proto + package v1 import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -43,7 +45,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_bd7d37632356c8f4, []int{0} + return fileDescriptor_0ccbc754ce0dbeed, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +128,7 @@ func (m *VersionedParams) Reset() { *m = VersionedParams{} } func (m *VersionedParams) String() string { return proto.CompactTextString(m) } func (*VersionedParams) ProtoMessage() {} func (*VersionedParams) Descriptor() ([]byte, []int) { - return fileDescriptor_bd7d37632356c8f4, []int{1} + return fileDescriptor_0ccbc754ce0dbeed, []int{1} } func (m *VersionedParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -162,47 +164,50 @@ func (m *VersionedParams) GetReserveTime() uint64 { return 0 } -//func init() { -// proto.RegisterType((*Params)(nil), "greenfield.payment.Params") -// proto.RegisterType((*VersionedParams)(nil), "greenfield.payment.VersionedParams") -//} -// -//func init() { proto.RegisterFile("greenfield/payment/params.proto", fileDescriptor_bd7d37632356c8f4) } +func init() { + proto.RegisterType((*Params)(nil), "greenfield.payment.v1.Params") + proto.RegisterType((*VersionedParams)(nil), "greenfield.payment.v1.VersionedParams") +} + +func init() { + proto.RegisterFile("greenfield/payment/v1/params.proto", fileDescriptor_0ccbc754ce0dbeed) +} -var fileDescriptor_bd7d37632356c8f4 = []byte{ - // 509 bytes of a gzipped FileDescriptorProto +var fileDescriptor_0ccbc754ce0dbeed = []byte{ + // 517 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xbf, 0x2f, 0x44, 0x64, 0x8a, 0xd4, 0xc8, 0x54, 0xe0, 0x06, 0x61, 0x07, 0x23, 0xaa, - 0x6c, 0x62, 0x0b, 0xd8, 0x55, 0x6c, 0x6a, 0x22, 0x24, 0x04, 0x0b, 0x64, 0x22, 0x16, 0x6c, 0x46, - 0x13, 0xfb, 0x3a, 0x35, 0x78, 0x3c, 0xd1, 0x78, 0x9c, 0x3a, 0xcf, 0xc0, 0x86, 0x87, 0x61, 0xc3, - 0x1b, 0x74, 0x59, 0xb1, 0x42, 0x2c, 0x2c, 0x94, 0xbc, 0x81, 0x9f, 0x00, 0x65, 0xc6, 0x69, 0x12, - 0xa2, 0xb2, 0x99, 0x9f, 0x7b, 0xce, 0x9c, 0x73, 0x75, 0xe7, 0x5e, 0x64, 0x4d, 0x38, 0x40, 0x1a, - 0xc5, 0x90, 0x84, 0xee, 0x94, 0xcc, 0x29, 0xa4, 0xc2, 0x9d, 0x12, 0x4e, 0x68, 0xe6, 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xc6, 0xe9, 0x78, 0x10, 0x9c, - 0x93, 0x38, 0x75, 0xb7, 0xc6, 0xab, 0xb8, 0x1e, 0x30, 0x69, 0x37, 0x6e, 0xc9, 0xd9, 0x78, 0xfe, - 0x27, 0x00, 0x00, 0xff, 0xff, 0xad, 0xa0, 0x65, 0x82, 0x83, 0x03, 0x00, 0x00, + 0x14, 0x8d, 0xbf, 0x2f, 0x44, 0x64, 0x8a, 0xd4, 0xc8, 0x14, 0x70, 0x83, 0xb0, 0x83, 0x25, 0xa2, + 0x6c, 0x62, 0x2b, 0x65, 0x57, 0xb1, 0x69, 0x88, 0xd8, 0xd0, 0x05, 0x32, 0x15, 0x48, 0x6c, 0x46, + 0x13, 0xfb, 0x26, 0x35, 0x78, 0x3c, 0xd1, 0x78, 0xec, 0x3a, 0x2f, 0x81, 0x78, 0x18, 0x36, 0xbc, + 0x41, 0x97, 0x15, 0x2b, 0xc4, 0xc2, 0x42, 0xc9, 0x1b, 0xf8, 0x09, 0x50, 0x66, 0x9c, 0x26, 0xa1, + 0x94, 0xcd, 0xfc, 0xdc, 0x73, 0xe6, 0x9c, 0xab, 0x3b, 0xf7, 0x22, 0x7b, 0xca, 0x01, 0xe2, 0x49, + 0x08, 0x51, 0xe0, 0xce, 0xc8, 0x9c, 0x42, 0x2c, 0xdc, 0x6c, 0xe0, 0xce, 0x08, 0x27, 0x34, 0x71, + 0x66, 0x9c, 0x09, 0xa6, 0x3f, 0xd8, 0x70, 0x9c, 0x8a, 0xe3, 0x64, 0x83, 0xf6, 0xa1, 0xcf, 0x12, + 0xca, 0x12, 0x2c, 0x49, 0xae, 0xba, 0xa8, 0x17, 0xed, 0x83, 0x29, 0x9b, 0x32, 0x15, 0x5f, 0x9d, + 0x54, 0xd4, 0xfe, 0x5c, 0x47, 0x8d, 0x37, 0x52, 0x58, 0x7f, 0x8f, 0x5a, 0x19, 0xf0, 0x24, 0x64, + 0x31, 0x04, 0x58, 0x99, 0x19, 0x5a, 0x47, 0xeb, 0x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 0xed, + 0xdd, 0x9d, 0x00, 0x8c, 0xe4, 0xf1, 0x9b, 0x86, 0xf6, 0xff, 0xf8, 0x57, 0xfd, 0x18, 0xdd, 0xe3, + 0x90, 0x00, 0xcf, 0xaa, 0x9a, 0x6a, 0x32, 0xb7, 0x47, 0x65, 0x61, 0xdd, 0x57, 0x4a, 0xdb, 0xa8, + 0xed, 0xed, 0x55, 0x57, 0x59, 0xc8, 0x8f, 0x48, 0xcf, 0x48, 0x14, 0x06, 0x44, 0x30, 0x8e, 0x05, + 0xc9, 0x31, 0x27, 0x02, 0xe4, 0x9f, 0x37, 0x87, 0x2f, 0x56, 0xfd, 0xf2, 0xb3, 0xb0, 0xba, 0xd3, + 0x50, 0x9c, 0xa7, 0x63, 0xc7, 0x67, 0xb4, 0xea, 0xd9, 0x6a, 0xeb, 0x27, 0xc1, 0x27, 0x57, 0xcc, + 0x67, 0x90, 0x38, 0x23, 0xf0, 0xbf, 0x7f, 0xed, 0xa3, 0xaa, 0xa5, 0x47, 0xe0, 0x7b, 0xad, 0x6b, + 0xdd, 0x33, 0x92, 0x7b, 0x44, 0xc0, 0xf0, 0xf4, 0x72, 0x61, 0x6a, 0x57, 0x0b, 0x53, 0xfb, 0xb5, + 0x30, 0xb5, 0x2f, 0x4b, 0xb3, 0x76, 0xb5, 0x34, 0x6b, 0x3f, 0x96, 0x66, 0xed, 0xc3, 0xd1, 0x96, + 0xc3, 0x38, 0x1e, 0xf7, 0xfd, 0x73, 0x12, 0xc6, 0xee, 0xd6, 0x9c, 0xe5, 0xd7, 0x93, 0x26, 0xed, + 0xdc, 0x6c, 0x30, 0x6e, 0xc8, 0x09, 0x79, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x61, 0xef, 0x30, + 0x62, 0x8f, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -358,12 +363,9 @@ func (m *VersionedParams) Size() (n int) { func sovParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - -//lint:ignore U1000 Ignore unused function for it is auto generated ealier func sozParams(x uint64) (n int) { return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0