diff --git a/proto/terra/market/v1beta1/market.proto b/proto/terra/market/v1beta1/market.proto index 756b89197..a87d5dcce 100644 --- a/proto/terra/market/v1beta1/market.proto +++ b/proto/terra/market/v1beta1/market.proto @@ -21,4 +21,9 @@ message Params { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; + bytes fee_burn_ratio = 4 [ + (gogoproto.moretags) = "yaml:\"fee_burn_ratio\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } diff --git a/x/market/keeper/msg_server.go b/x/market/keeper/msg_server.go index 550c8c7b8..c38d44465 100644 --- a/x/market/keeper/msg_server.go +++ b/x/market/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + treasury "github.com/classic-terra/core/v2/x/treasury/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -121,12 +122,24 @@ func (k msgServer) handleSwapRequest(ctx sdk.Context, return nil, err } - // Send swap fee to oracle account + // Send swap fee to oracle account based on percentage, burn the rest if feeCoin.IsPositive() { - feeCoins := sdk.NewCoins(feeCoin) - err = k.BankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, oracletypes.ModuleName, feeCoins) - if err != nil { - return nil, err + var sendCoins sdk.Coins + burnCoins := sdk.NewCoins(sdk.NewCoin(feeCoin.GetDenom(), sdk.NewDec(feeCoin.Amount.Int64()).Mul(k.FeeBurnRatio(ctx)).TruncateInt())) + if !burnCoins.IsZero() { + sendCoins = sdk.NewCoins(feeCoin.Sub(burnCoins[0])) + err = k.BankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, treasury.BurnModuleName, burnCoins) + if err != nil { + return nil, err + } + } else { + sendCoins = sdk.NewCoins(feeCoin) + } + if !sendCoins.IsZero() { + err = k.BankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, oracletypes.ModuleName, sendCoins) + if err != nil { + return nil, err + } } } diff --git a/x/market/keeper/params.go b/x/market/keeper/params.go index ccf6ebf7f..09c59d467 100644 --- a/x/market/keeper/params.go +++ b/x/market/keeper/params.go @@ -19,6 +19,12 @@ func (k Keeper) MinStabilitySpread(ctx sdk.Context) (res sdk.Dec) { return } +// FeeBurnRatio represents the percentage of spread fee burnt during swaps to / from Luna. +func (k Keeper) FeeBurnRatio(ctx sdk.Context) (res sdk.Dec) { + k.paramSpace.Get(ctx, types.KeyFeeBurnRatio, &res) + return +} + // PoolRecoveryPeriod is the period required to recover Terra&Luna Pools to the MintBasePool & BurnBasePool func (k Keeper) PoolRecoveryPeriod(ctx sdk.Context) (res uint64) { k.paramSpace.Get(ctx, types.KeyPoolRecoveryPeriod, &res) diff --git a/x/market/types/genesis_test.go b/x/market/types/genesis_test.go index 0c3d6fb84..8a775bf18 100644 --- a/x/market/types/genesis_test.go +++ b/x/market/types/genesis_test.go @@ -3,23 +3,63 @@ package types import ( "testing" - "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" ) func TestGenesisValidation(t *testing.T) { - genState := DefaultGenesisState() - require.NoError(t, ValidateGenesis(genState)) - - genState.Params.BasePool = sdk.NewDec(-1) - require.Error(t, ValidateGenesis(genState)) - genState = DefaultGenesisState() - genState.Params.PoolRecoveryPeriod = 0 - require.Error(t, ValidateGenesis(genState)) + tests := []struct { + name string + GenState func() *GenesisState + wantErr bool + }{ + { + name: "valid state", + GenState: DefaultGenesisState, + wantErr: false, + }, + { + name: "invalid BasePool state", + GenState: func() *GenesisState { + genState := DefaultGenesisState() + genState.Params.BasePool = sdk.NewDec(-1) + return genState + }, + wantErr: true, + }, + { + name: "invalid PoolRecoveryPeriod state", + GenState: func() *GenesisState { + genState := DefaultGenesisState() + genState.Params.PoolRecoveryPeriod = 0 + return genState + }, + wantErr: true, + }, + { + name: "invalid MinStabilitySpread state", + GenState: func() *GenesisState { + genState := DefaultGenesisState() + genState.Params.MinStabilitySpread = sdk.NewDec(-1) + return genState + }, + wantErr: true, + }, + { + name: "invalid FeeBurnRatio state", + GenState: func() *GenesisState { + genState := DefaultGenesisState() + genState.Params.FeeBurnRatio = sdk.NewDec(-1) + return genState + }, + wantErr: true, + }, + } - genState = DefaultGenesisState() - genState.Params.MinStabilitySpread = sdk.NewDec(-1) - require.Error(t, ValidateGenesis(genState)) + for _, tt := range tests { + genState := tt.GenState() + if err := ValidateGenesis(genState); (err != nil) != tt.wantErr { + t.Errorf("expected wantErr = %v got %v", tt.wantErr, err != nil) + } + } } diff --git a/x/market/types/market.pb.go b/x/market/types/market.pb.go index 53f7a0481..32b6453df 100644 --- a/x/market/types/market.pb.go +++ b/x/market/types/market.pb.go @@ -5,21 +5,18 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -32,6 +29,7 @@ type Params struct { BasePool github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=base_pool,json=basePool,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_pool" yaml:"base_pool"` PoolRecoveryPeriod uint64 `protobuf:"varint,2,opt,name=pool_recovery_period,json=poolRecoveryPeriod,proto3" json:"pool_recovery_period,omitempty" yaml:"pool_recovery_period"` MinStabilitySpread github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=min_stability_spread,json=minStabilitySpread,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_stability_spread" yaml:"min_stability_spread"` + FeeBurnRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=fee_burn_ratio,json=feeBurnRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_burn_ratio" yaml:"fee_burn_ratio"` } func (m *Params) Reset() { *m = Params{} } @@ -39,11 +37,9 @@ func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_114ea92c5ae3e66f, []int{0} } - func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Params.Marshal(b, m, deterministic) @@ -56,15 +52,12 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *Params) XXX_Merge(src proto.Message) { xxx_messageInfo_Params.Merge(m, src) } - func (m *Params) XXX_Size() int { return m.Size() } - func (m *Params) XXX_DiscardUnknown() { xxx_messageInfo_Params.DiscardUnknown(m) } @@ -85,28 +78,31 @@ func init() { func init() { proto.RegisterFile("terra/market/v1beta1/market.proto", fileDescriptor_114ea92c5ae3e66f) } var fileDescriptor_114ea92c5ae3e66f = []byte{ - // 334 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xb1, 0x4e, 0xeb, 0x30, - 0x14, 0x86, 0xe3, 0xde, 0xab, 0xaa, 0x44, 0x0c, 0x28, 0xca, 0x50, 0x81, 0x14, 0x97, 0x0c, 0xa8, - 0x4b, 0x63, 0x15, 0xb6, 0x8e, 0x11, 0x0b, 0x03, 0x52, 0x49, 0x37, 0x96, 0xc8, 0x49, 0xad, 0x62, - 0x35, 0xee, 0x89, 0x6c, 0x53, 0x91, 0x89, 0x57, 0x60, 0x64, 0xec, 0xdb, 0xd0, 0xb1, 0x23, 0x62, - 0x88, 0x50, 0xbb, 0x30, 0xf7, 0x09, 0x50, 0xdc, 0x14, 0x31, 0x74, 0x61, 0xf2, 0xf1, 0xa7, 0xcf, - 0xc7, 0xbf, 0xf4, 0xdb, 0xe7, 0x9a, 0x49, 0x49, 0x89, 0xa0, 0x72, 0xca, 0x34, 0x99, 0xf7, 0x13, - 0xa6, 0x69, 0xbf, 0xbe, 0x06, 0xb9, 0x04, 0x0d, 0x8e, 0x6b, 0x94, 0xa0, 0x66, 0xb5, 0x72, 0xea, - 0x4e, 0x60, 0x02, 0x46, 0x20, 0xd5, 0xb4, 0x73, 0xfd, 0xb7, 0x86, 0xdd, 0x1c, 0x52, 0x49, 0x85, - 0x72, 0x62, 0xfb, 0x28, 0xa1, 0x8a, 0xc5, 0x39, 0x40, 0xd6, 0x46, 0x1d, 0xd4, 0x3d, 0x0e, 0xc3, - 0x65, 0x89, 0xad, 0x8f, 0x12, 0x5f, 0x4c, 0xb8, 0x7e, 0x78, 0x4c, 0x82, 0x14, 0x04, 0x49, 0x41, - 0x09, 0x50, 0xf5, 0xd1, 0x53, 0xe3, 0x29, 0xd1, 0x45, 0xce, 0x54, 0x70, 0xcd, 0xd2, 0x6d, 0x89, - 0x4f, 0x0a, 0x2a, 0xb2, 0x81, 0xff, 0xb3, 0xc8, 0x8f, 0x5a, 0xd5, 0x3c, 0x04, 0xc8, 0x9c, 0x3b, - 0xdb, 0xad, 0x50, 0x2c, 0x59, 0x0a, 0x73, 0x26, 0x8b, 0x38, 0x67, 0x92, 0xc3, 0xb8, 0xdd, 0xe8, - 0xa0, 0xee, 0xff, 0x10, 0x6f, 0x4b, 0x7c, 0xb6, 0x7b, 0x7d, 0xc8, 0xf2, 0x23, 0xa7, 0xc2, 0x51, - 0x4d, 0x87, 0x06, 0x3a, 0xcf, 0xb6, 0x2b, 0xf8, 0x2c, 0x56, 0x9a, 0x26, 0x3c, 0xe3, 0xba, 0x88, - 0x55, 0x2e, 0x19, 0x1d, 0xb7, 0xff, 0x99, 0xf8, 0xb7, 0x7f, 0x8e, 0x5f, 0x07, 0x38, 0xb4, 0xd3, - 0x8f, 0x1c, 0xc1, 0x67, 0xa3, 0x3d, 0x1d, 0x19, 0x38, 0x68, 0xbd, 0x2e, 0xb0, 0xf5, 0xb5, 0xc0, - 0x28, 0xbc, 0x59, 0xae, 0x3d, 0xb4, 0x5a, 0x7b, 0xe8, 0x73, 0xed, 0xa1, 0x97, 0x8d, 0x67, 0xad, - 0x36, 0x9e, 0xf5, 0xbe, 0xf1, 0xac, 0x7b, 0xf2, 0xfb, 0xfb, 0x8c, 0x2a, 0xc5, 0xd3, 0xde, 0xae, - 0xc5, 0x14, 0x24, 0x23, 0xf3, 0x4b, 0xf2, 0xb4, 0xef, 0xd3, 0x64, 0x49, 0x9a, 0xa6, 0x9b, 0xab, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xee, 0xb4, 0xbb, 0x6d, 0xec, 0x01, 0x00, 0x00, + // 375 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x6a, 0xe3, 0x30, + 0x1c, 0xc6, 0xed, 0x4b, 0x08, 0x39, 0x13, 0x8e, 0xc3, 0xf8, 0xc0, 0xdc, 0x81, 0x9d, 0xf3, 0x70, + 0x64, 0x89, 0x45, 0xae, 0x5b, 0x46, 0x53, 0x28, 0x1d, 0x0a, 0xa9, 0xb3, 0x75, 0x11, 0xb2, 0xa3, + 0xa4, 0x22, 0x96, 0x65, 0x24, 0x25, 0xd4, 0x53, 0x5f, 0xa1, 0x63, 0xc7, 0x3c, 0x45, 0x9f, 0x21, + 0x63, 0xc6, 0xd2, 0xc1, 0x94, 0x64, 0xe9, 0x9c, 0x27, 0x28, 0x96, 0x9d, 0xd2, 0x42, 0x96, 0x4c, + 0xfa, 0xff, 0x7f, 0x7c, 0xfa, 0x7f, 0xdf, 0xf0, 0x19, 0x7f, 0x25, 0xe6, 0x1c, 0x01, 0x8a, 0xf8, + 0x1c, 0x4b, 0xb0, 0x1c, 0x44, 0x58, 0xa2, 0x41, 0xbd, 0xfa, 0x19, 0x67, 0x92, 0x99, 0x96, 0x92, + 0xf8, 0x35, 0xab, 0x25, 0xbf, 0xad, 0x19, 0x9b, 0x31, 0x25, 0x00, 0xe5, 0x54, 0x69, 0xbd, 0xa7, + 0x86, 0xd1, 0x1a, 0x21, 0x8e, 0xa8, 0x30, 0xa1, 0xf1, 0x3d, 0x42, 0x02, 0xc3, 0x8c, 0xb1, 0xc4, + 0xd6, 0xbb, 0x7a, 0xaf, 0x13, 0x04, 0xeb, 0xc2, 0xd5, 0x5e, 0x0a, 0xf7, 0xdf, 0x8c, 0xc8, 0xdb, + 0x45, 0xe4, 0xc7, 0x8c, 0x82, 0x98, 0x09, 0xca, 0x44, 0xfd, 0xf4, 0xc5, 0x64, 0x0e, 0x64, 0x9e, + 0x61, 0xe1, 0x9f, 0xe3, 0x78, 0x5f, 0xb8, 0x3f, 0x73, 0x44, 0x93, 0xa1, 0xf7, 0x71, 0xc8, 0x0b, + 0xdb, 0xe5, 0x3c, 0x62, 0x2c, 0x31, 0xaf, 0x0d, 0xab, 0x44, 0x90, 0xe3, 0x98, 0x2d, 0x31, 0xcf, + 0x61, 0x86, 0x39, 0x61, 0x13, 0xfb, 0x5b, 0x57, 0xef, 0x35, 0x03, 0x77, 0x5f, 0xb8, 0x7f, 0xaa, + 0xdf, 0xc7, 0x54, 0x5e, 0x68, 0x96, 0x38, 0xac, 0xe9, 0x48, 0x41, 0xf3, 0xde, 0xb0, 0x28, 0x49, + 0xa1, 0x90, 0x28, 0x22, 0x09, 0x91, 0x39, 0x14, 0x19, 0xc7, 0x68, 0x62, 0x37, 0x54, 0xfc, 0xab, + 0x93, 0xe3, 0xd7, 0x01, 0x8e, 0xdd, 0xf4, 0x42, 0x93, 0x92, 0x74, 0x7c, 0xa0, 0x63, 0x05, 0x4d, + 0x6a, 0xfc, 0x98, 0x62, 0x0c, 0xa3, 0x05, 0x4f, 0x21, 0x47, 0x92, 0x30, 0xbb, 0xa9, 0xac, 0x2f, + 0x4e, 0xb6, 0xfe, 0x55, 0x59, 0x7f, 0xbd, 0xe6, 0x85, 0x9d, 0x29, 0xc6, 0xc1, 0x82, 0xa7, 0x61, + 0xb9, 0x0e, 0xdb, 0x8f, 0x2b, 0x57, 0x7b, 0x5b, 0xb9, 0x7a, 0x70, 0xb9, 0xde, 0x3a, 0xfa, 0x66, + 0xeb, 0xe8, 0xaf, 0x5b, 0x47, 0x7f, 0xd8, 0x39, 0xda, 0x66, 0xe7, 0x68, 0xcf, 0x3b, 0x47, 0xbb, + 0x01, 0x9f, 0x2d, 0x13, 0x24, 0x04, 0x89, 0xfb, 0x55, 0x69, 0x62, 0xc6, 0x31, 0x58, 0xfe, 0x07, + 0x77, 0x87, 0xfa, 0x28, 0xff, 0xa8, 0xa5, 0xaa, 0x70, 0xf6, 0x1e, 0x00, 0x00, 0xff, 0xff, 0xf5, + 0xa7, 0x62, 0xf4, 0x5b, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -137,9 +133,11 @@ func (this *Params) Equal(that interface{}) bool { if !this.MinStabilitySpread.Equal(that1.MinStabilitySpread) { return false } + if !this.FeeBurnRatio.Equal(that1.FeeBurnRatio) { + return false + } return true } - func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -160,6 +158,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.FeeBurnRatio.Size() + i -= size + if _, err := m.FeeBurnRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 { size := m.MinStabilitySpread.Size() i -= size @@ -199,7 +207,6 @@ func encodeVarintMarket(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *Params) Size() (n int) { if m == nil { return 0 @@ -213,17 +220,17 @@ func (m *Params) Size() (n int) { } l = m.MinStabilitySpread.Size() n += 1 + l + sovMarket(uint64(l)) + l = m.FeeBurnRatio.Size() + n += 1 + l + sovMarket(uint64(l)) return n } func sovMarket(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozMarket(x uint64) (n int) { return sovMarket(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -338,6 +345,39 @@ 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 FeeBurnRatio", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeBurnRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMarket(dAtA[iNdEx:]) @@ -359,7 +399,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } - func skipMarket(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/market/types/params.go b/x/market/types/params.go index 5f3ddbe12..a4c5cf743 100644 --- a/x/market/types/params.go +++ b/x/market/types/params.go @@ -19,6 +19,8 @@ var ( KeyPoolRecoveryPeriod = []byte("PoolRecoveryPeriod") // Min spread KeyMinStabilitySpread = []byte("MinStabilitySpread") + // Fee burn percentage + KeyFeeBurnRatio = []byte("FeeBurnRatio") ) // Default parameter values @@ -26,6 +28,7 @@ var ( DefaultBasePool = sdk.NewDec(1000000 * core.MicroUnit) // 1000,000sdr = 1000,000,000,000usdr DefaultPoolRecoveryPeriod = core.BlocksPerDay // 14,400 DefaultMinStabilitySpread = sdk.NewDecWithPrec(2, 2) // 2% + DefaultBurnRatio = sdk.NewDecWithPrec(100, 2) // 100% ) var _ paramstypes.ParamSet = &Params{} @@ -36,6 +39,7 @@ func DefaultParams() Params { BasePool: DefaultBasePool, PoolRecoveryPeriod: DefaultPoolRecoveryPeriod, MinStabilitySpread: DefaultMinStabilitySpread, + FeeBurnRatio: DefaultBurnRatio, } } @@ -57,6 +61,7 @@ func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs { paramstypes.NewParamSetPair(KeyBasePool, &p.BasePool, validateBasePool), paramstypes.NewParamSetPair(KeyPoolRecoveryPeriod, &p.PoolRecoveryPeriod, validatePoolRecoveryPeriod), paramstypes.NewParamSetPair(KeyMinStabilitySpread, &p.MinStabilitySpread, validateMinStabilitySpread), + paramstypes.NewParamSetPair(KeyFeeBurnRatio, &p.FeeBurnRatio, validateFeeBurnRatio), } } @@ -71,6 +76,9 @@ func (p Params) Validate() error { if p.MinStabilitySpread.IsNegative() || p.MinStabilitySpread.GT(sdk.OneDec()) { return fmt.Errorf("market minimum stability spead should be a value between [0,1], is %s", p.MinStabilitySpread) } + if p.FeeBurnRatio.IsNegative() || p.FeeBurnRatio.GT(sdk.OneDec()) { + return fmt.Errorf("fee burn ratio should be a value between [0,1], is %s", p.FeeBurnRatio) + } return nil } @@ -117,3 +125,20 @@ func validateMinStabilitySpread(i interface{}) error { return nil } + +func validateFeeBurnRatio(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() { + return fmt.Errorf("burn ratio must be positive or zero: %s", v) + } + + if v.GT(sdk.OneDec()) { + return fmt.Errorf("burn ratio is too large: %s", v) + } + + return nil +} diff --git a/x/market/types/params_test.go b/x/market/types/params_test.go index 97c850c4b..a2285cd85 100644 --- a/x/market/types/params_test.go +++ b/x/market/types/params_test.go @@ -25,12 +25,12 @@ func TestParamsEqual(t *testing.T) { require.Error(t, err) // invalid min spread - p4 := DefaultParams() - p4.MinStabilitySpread = sdk.NewDecWithPrec(-1, 2) - err = p4.Validate() + p5 := DefaultParams() + p5.FeeBurnRatio = sdk.NewDecWithPrec(-1, 2) + err = p5.Validate() require.Error(t, err) - p5 := DefaultParams() - require.NotNil(t, p5.ParamSetPairs()) - require.NotNil(t, p5.String()) + p6 := DefaultParams() + require.NotNil(t, p6.ParamSetPairs()) + require.NotNil(t, p6.String()) }