From 192aaa0ab3139a9bffcccc5266221c4100aae657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=C3=B4ng=20Li=E1=BB=81u?= Date: Fri, 27 Dec 2024 15:54:22 +0700 Subject: [PATCH] add decimals to proposal --- proto/reserve/psm/v1/tx.proto | 5 + x/psm/keeper/keeper_test.go | 4 + x/psm/keeper/msg_server.go | 10 ++ x/psm/types/expected_keepers.go | 1 + x/psm/types/msgs.go | 2 + x/psm/types/tx.pb.go | 268 ++++++++++++++++++++++++-------- 6 files changed, 227 insertions(+), 63 deletions(-) diff --git a/proto/reserve/psm/v1/tx.proto b/proto/reserve/psm/v1/tx.proto index 10e703b..9aef506 100644 --- a/proto/reserve/psm/v1/tx.proto +++ b/proto/reserve/psm/v1/tx.proto @@ -71,6 +71,8 @@ message MsgAddStableCoin { ]; int64 oracle_script = 6; string symbol = 7; + uint64 stable_decimal = 8; + uint64 mint_decimal = 9; } message MsgAddStableCoinResponse {} @@ -103,6 +105,9 @@ message MsgUpdatesStableCoin { int64 oracle_script = 6; string symbol = 7; + + uint64 stable_decimal = 8; + uint64 mint_decimal = 9; } message MsgUpdatesStableCoinResponse {} diff --git a/x/psm/keeper/keeper_test.go b/x/psm/keeper/keeper_test.go index f2b24d0..1f7871f 100644 --- a/x/psm/keeper/keeper_test.go +++ b/x/psm/keeper/keeper_test.go @@ -43,6 +43,10 @@ func (s MockOracleKeeper) GetPrice(ctx context.Context, denom1 string, denom2 st return p, nil } +func (s MockOracleKeeper) SetPairDecimalsRate(ctx context.Context, base, quote string, baseDecimals, quoteDecimals uint64) error { + return nil +} + func (s MockOracleKeeper) AddNewSymbolToBandOracleRequest(ctx context.Context, symbol string, oracleScriptId int64) error { _, ok := s.prices[symbol] diff --git a/x/psm/keeper/msg_server.go b/x/psm/keeper/msg_server.go index bdbd3f1..04f97ee 100644 --- a/x/psm/keeper/msg_server.go +++ b/x/psm/keeper/msg_server.go @@ -99,6 +99,11 @@ func (k msgServer) AddStableCoinProposal(ctx context.Context, msg *types.MsgAddS return &types.MsgAddStableCoinResponse{}, err } + err = k.keeper.OracleKeeper.SetPairDecimalsRate(ctx, msg.Symbol, types.SymBolUSD, msg.StableDecimal, msg.MintDecimal) + if err != nil { + return &types.MsgAddStableCoinResponse{}, err + } + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventAddStablecoin, @@ -136,6 +141,11 @@ func (k msgServer) UpdatesStableCoinProposal(ctx context.Context, msg *types.Msg return &types.MsgUpdatesStableCoinResponse{}, err } + err = k.keeper.OracleKeeper.SetPairDecimalsRate(ctx, msg.Symbol, types.SymBolUSD, msg.StableDecimal, msg.MintDecimal) + if err != nil { + return &types.MsgUpdatesStableCoinResponse{}, err + } + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventAddStablecoin, diff --git a/x/psm/types/expected_keepers.go b/x/psm/types/expected_keepers.go index 4deee4c..37a5135 100644 --- a/x/psm/types/expected_keepers.go +++ b/x/psm/types/expected_keepers.go @@ -35,4 +35,5 @@ type ParamSubspace interface { type OracleKeeper interface { GetPrice(ctx context.Context, base, quote string) (math.LegacyDec, error) AddNewSymbolToBandOracleRequest(ctx context.Context, symbol string, oracleScriptId int64) error + SetPairDecimalsRate(ctx context.Context, base, quote string, baseDecimals, quoteDecimals uint64) error } diff --git a/x/psm/types/msgs.go b/x/psm/types/msgs.go index c1ec263..aad10ee 100644 --- a/x/psm/types/msgs.go +++ b/x/psm/types/msgs.go @@ -18,6 +18,8 @@ var ( _ govtypes.Content = &MsgAddStableCoin{} _ govtypes.Content = &MsgUpdatesStableCoin{} + + Msg_serviceDesc = _Msg_serviceDesc ) const ( diff --git a/x/psm/types/tx.pb.go b/x/psm/types/tx.pb.go index 5ab49b1..6b6219e 100644 --- a/x/psm/types/tx.pb.go +++ b/x/psm/types/tx.pb.go @@ -129,13 +129,15 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgAddStableCoin struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - LimitTotal cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=limit_total,json=limitTotal,proto3,customtype=cosmossdk.io/math.Int" json:"limit_total"` - FeeIn cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=fee_in,json=feeIn,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_in"` - FeeOut cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=fee_out,json=feeOut,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_out"` - OracleScript int64 `protobuf:"varint,6,opt,name=oracle_script,json=oracleScript,proto3" json:"oracle_script,omitempty"` - Symbol string `protobuf:"bytes,7,opt,name=symbol,proto3" json:"symbol,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + LimitTotal cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=limit_total,json=limitTotal,proto3,customtype=cosmossdk.io/math.Int" json:"limit_total"` + FeeIn cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=fee_in,json=feeIn,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_in"` + FeeOut cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=fee_out,json=feeOut,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_out"` + OracleScript int64 `protobuf:"varint,6,opt,name=oracle_script,json=oracleScript,proto3" json:"oracle_script,omitempty"` + Symbol string `protobuf:"bytes,7,opt,name=symbol,proto3" json:"symbol,omitempty"` + StableDecimal uint64 `protobuf:"varint,8,opt,name=stable_decimal,json=stableDecimal,proto3" json:"stable_decimal,omitempty"` + MintDecimal uint64 `protobuf:"varint,9,opt,name=mint_decimal,json=mintDecimal,proto3" json:"mint_decimal,omitempty"` } func (m *MsgAddStableCoin) Reset() { *m = MsgAddStableCoin{} } @@ -199,6 +201,20 @@ func (m *MsgAddStableCoin) GetSymbol() string { return "" } +func (m *MsgAddStableCoin) GetStableDecimal() uint64 { + if m != nil { + return m.StableDecimal + } + return 0 +} + +func (m *MsgAddStableCoin) GetMintDecimal() uint64 { + if m != nil { + return m.MintDecimal + } + return 0 +} + type MsgAddStableCoinResponse struct { } @@ -236,13 +252,15 @@ func (m *MsgAddStableCoinResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddStableCoinResponse proto.InternalMessageInfo type MsgUpdatesStableCoin struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - LimitTotal cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=limit_total,json=limitTotal,proto3,customtype=cosmossdk.io/math.Int" json:"limit_total"` - FeeIn cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=fee_in,json=feeIn,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_in"` - FeeOut cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=fee_out,json=feeOut,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_out"` - OracleScript int64 `protobuf:"varint,6,opt,name=oracle_script,json=oracleScript,proto3" json:"oracle_script,omitempty"` - Symbol string `protobuf:"bytes,7,opt,name=symbol,proto3" json:"symbol,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + LimitTotal cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=limit_total,json=limitTotal,proto3,customtype=cosmossdk.io/math.Int" json:"limit_total"` + FeeIn cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=fee_in,json=feeIn,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_in"` + FeeOut cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=fee_out,json=feeOut,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_out"` + OracleScript int64 `protobuf:"varint,6,opt,name=oracle_script,json=oracleScript,proto3" json:"oracle_script,omitempty"` + Symbol string `protobuf:"bytes,7,opt,name=symbol,proto3" json:"symbol,omitempty"` + StableDecimal uint64 `protobuf:"varint,8,opt,name=stable_decimal,json=stableDecimal,proto3" json:"stable_decimal,omitempty"` + MintDecimal uint64 `protobuf:"varint,9,opt,name=mint_decimal,json=mintDecimal,proto3" json:"mint_decimal,omitempty"` } func (m *MsgUpdatesStableCoin) Reset() { *m = MsgUpdatesStableCoin{} } @@ -306,6 +324,20 @@ func (m *MsgUpdatesStableCoin) GetSymbol() string { return "" } +func (m *MsgUpdatesStableCoin) GetStableDecimal() uint64 { + if m != nil { + return m.StableDecimal + } + return 0 +} + +func (m *MsgUpdatesStableCoin) GetMintDecimal() uint64 { + if m != nil { + return m.MintDecimal + } + return 0 +} + type MsgUpdatesStableCoinResponse struct { } @@ -452,54 +484,57 @@ func init() { func init() { proto.RegisterFile("reserve/psm/v1/tx.proto", fileDescriptor_d0ff2d5421e71e2a) } var fileDescriptor_d0ff2d5421e71e2a = []byte{ - // 752 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0xbb, 0x6f, 0xd3, 0x5e, - 0x14, 0xc7, 0xe3, 0x5f, 0x7e, 0x49, 0x95, 0xd3, 0x07, 0x60, 0xa5, 0x8d, 0xe3, 0x52, 0x37, 0x0a, - 0x54, 0x44, 0x55, 0x6b, 0x37, 0x45, 0x20, 0xd1, 0xad, 0x0f, 0x21, 0x8a, 0x88, 0x28, 0x0e, 0x48, - 0x88, 0x25, 0xba, 0xb1, 0x6f, 0x5c, 0x8b, 0xd8, 0xd7, 0xf2, 0xbd, 0x09, 0xcd, 0x86, 0x18, 0x99, - 0x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x0e, 0x9e, 0xc2, 0x81, 0xdb, 0x25, 0xdf, 0xbb, 0x22, 0x21, 0xee, 0x20, 0x1a, - 0x30, 0xd9, 0xf7, 0x76, 0x6c, 0xf9, 0xc4, 0x23, 0x14, 0x35, 0xc5, 0xc2, 0x05, 0x0a, 0x7d, 0x99, - 0x72, 0xe9, 0xaa, 0x8c, 0x6e, 0x13, 0x02, 0xf9, 0x21, 0x44, 0xdd, 0x46, 0x77, 0x2f, 0x1d, 0xb5, - 0x27, 0x5b, 0x5e, 0xf8, 0x93, 0xac, 0x6e, 0x43, 0x1d, 0xa0, 0x07, 0xf9, 0xcc, 0x05, 0xb5, 0xe7, - 0x61, 0x79, 0xee, 0xb7, 0xe1, 0x58, 0x53, 0x4e, 0xbd, 0x0f, 0x20, 0xae, 0x3d, 0x3e, 0x38, 0x51, - 0x84, 0xc3, 0x13, 0x45, 0xf8, 0x79, 0xa2, 0x08, 0xbb, 0xa7, 0x4a, 0xe2, 0xf0, 0x54, 0x49, 0x7c, - 0x3f, 0x55, 0x12, 0x6f, 0x16, 0x2c, 0x9b, 0x6d, 0xb7, 0xea, 0xaa, 0x41, 0x1c, 0x8d, 0xb8, 0xc4, - 0xe9, 0xf0, 0xbf, 0x44, 0x83, 0x34, 0xb5, 0xfe, 0x1f, 0x32, 0xeb, 0x78, 0x98, 0xd6, 0xd3, 0x3c, - 0x7a, 0xff, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x92, 0xac, 0x8c, 0x06, 0xf5, 0x07, 0x00, 0x00, + // 795 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x16, 0xab, 0x1f, 0x57, 0x2b, 0xc9, 0x6d, 0x09, 0xd9, 0xa2, 0xe8, 0x9a, 0x56, 0xd5, 0x1a, + 0x15, 0x0c, 0x9b, 0xb4, 0x5c, 0xb4, 0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d3, + 0x06, 0x76, 0xb4, 0x71, 0x21, 0xd3, 0x81, 0x8f, 0x48, 0x27, 0xc3, 0xbc, 0xbf, 0x7d, 0x0c, 0x00, + 0x00, 0xff, 0xff, 0x7a, 0x49, 0x07, 0xa8, 0x89, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -669,7 +704,6 @@ func _Msg_StableSwap_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "reserve.psm.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -778,6 +812,16 @@ func (m *MsgAddStableCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MintDecimal != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MintDecimal)) + i-- + dAtA[i] = 0x48 + } + if m.StableDecimal != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StableDecimal)) + i-- + dAtA[i] = 0x40 + } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) @@ -880,6 +924,16 @@ func (m *MsgUpdatesStableCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MintDecimal != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MintDecimal)) + i-- + dAtA[i] = 0x48 + } + if m.StableDecimal != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StableDecimal)) + i-- + dAtA[i] = 0x40 + } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) @@ -1094,6 +1148,12 @@ func (m *MsgAddStableCoin) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.StableDecimal != 0 { + n += 1 + sovTx(uint64(m.StableDecimal)) + } + if m.MintDecimal != 0 { + n += 1 + sovTx(uint64(m.MintDecimal)) + } return n } @@ -1133,6 +1193,12 @@ func (m *MsgUpdatesStableCoin) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.StableDecimal != 0 { + n += 1 + sovTx(uint64(m.StableDecimal)) + } + if m.MintDecimal != 0 { + n += 1 + sovTx(uint64(m.MintDecimal)) + } return n } @@ -1590,6 +1656,44 @@ func (m *MsgAddStableCoin) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StableDecimal", wireType) + } + m.StableDecimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StableDecimal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDecimal", wireType) + } + m.MintDecimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MintDecimal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1907,6 +2011,44 @@ func (m *MsgUpdatesStableCoin) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StableDecimal", wireType) + } + m.StableDecimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StableDecimal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MintDecimal", wireType) + } + m.MintDecimal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MintDecimal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])