diff --git a/proto/reserve/psm/v1/psm.proto b/proto/reserve/psm/v1/psm.proto index 896eaad..7d7307b 100644 --- a/proto/reserve/psm/v1/psm.proto +++ b/proto/reserve/psm/v1/psm.proto @@ -43,4 +43,5 @@ message StablecoinInfo { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; + string sym_bol = 7; } diff --git a/proto/reserve/psm/v1/tx.proto b/proto/reserve/psm/v1/tx.proto index 252a9a4..5bd2615 100644 --- a/proto/reserve/psm/v1/tx.proto +++ b/proto/reserve/psm/v1/tx.proto @@ -70,6 +70,7 @@ message MsgAddStableCoin { (gogoproto.nullable) = false ]; int64 oracle_script = 6; + string sym_bol = 7; } message MsgAddStableCoinResponse {} @@ -101,6 +102,7 @@ message MsgUpdatesStableCoin { ]; int64 oracle_script = 6; + string sym_bol = 7; } message MsgUpdatesStableCoinResponse {} diff --git a/x/psm/keeper/abci.go b/x/psm/keeper/abci.go index 6753b02..3667514 100644 --- a/x/psm/keeper/abci.go +++ b/x/psm/keeper/abci.go @@ -13,7 +13,7 @@ func (k Keeper) BeginBlocker(ctx context.Context) error { func (k Keeper) UpdatesStablecoinEpoch(ctx context.Context) error { updatePrice := func(info types.StablecoinInfo) bool { - price := k.OracleKeeper.GetPrice(ctx, info.Denom, types.ReserveStableCoinDenom) + price := k.OracleKeeper.GetPrice(ctx, info.SymBol, types.ReserveStableCoinDenom) if price == nil || price.IsNil() { return false } diff --git a/x/psm/keeper/abci_test.go b/x/psm/keeper/abci_test.go index 4730605..42e7ba9 100644 --- a/x/psm/keeper/abci_test.go +++ b/x/psm/keeper/abci_test.go @@ -42,6 +42,7 @@ func (s *KeeperTestSuite) TestUpdatesStablecoinEpoch() { s.Run(t.name, func() { sc := types.GetMsgStablecoin(&types.MsgAddStableCoin{ Denom: usdt, + SymBol: usdt, LimitTotal: limitUSDT, FeeIn: t.feeIn, FeeOut: t.feeOut, diff --git a/x/psm/keeper/proposals_test.go b/x/psm/keeper/proposals_test.go index 5a12272..9644802 100644 --- a/x/psm/keeper/proposals_test.go +++ b/x/psm/keeper/proposals_test.go @@ -13,6 +13,7 @@ func (s *KeeperTestSuite) TestAddStableCoinProposal() { proAdd := types.MsgAddStableCoin{ Denom: usdt, LimitTotal: limitUSDT, + SymBol: usdt, Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), @@ -34,6 +35,7 @@ func (s *KeeperTestSuite) TestUpdateStableCoinProposal() { proAdd := types.MsgAddStableCoin{ Denom: usdt, LimitTotal: limitUSDT, + SymBol: usdt, Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), @@ -57,6 +59,7 @@ func (s *KeeperTestSuite) TestUpdateStableCoinProposal() { Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), + SymBol: usdt, OracleScript: 44, } diff --git a/x/psm/keeper/swap.go b/x/psm/keeper/swap.go index fb1a684..6a88e43 100644 --- a/x/psm/keeper/swap.go +++ b/x/psm/keeper/swap.go @@ -15,8 +15,8 @@ import ( // SwapToStablecoin return receiveAmount, fee, error func (k Keeper) SwapToOtherStablecoin(ctx context.Context, addr sdk.AccAddress, offerCoin sdk.Coin, expectedDenom string) error { // check stablecoin is suport - ok, err := k.StablecoinInfos.Has(ctx, expectedDenom) - if err != nil || !ok { + stablecoin, err := k.StablecoinInfos.Get(ctx, expectedDenom) + if err != nil { return fmt.Errorf("%s not in list stablecoin supported", expectedDenom) } @@ -27,7 +27,7 @@ func (k Keeper) SwapToOtherStablecoin(ctx context.Context, addr sdk.AccAddress, } // check balace and calculate amount of coins received - receiveAmountStablecoin, fee_out, err := k.calculateSwapToStablecoin(ctx, offerCoin.Amount, expectedDenom) + receiveAmountStablecoin, fee_out, err := k.calculateSwapToStablecoin(ctx, offerCoin.Amount, stablecoin) if err != nil { return err } @@ -76,8 +76,8 @@ func (k Keeper) SwapToOtherStablecoin(ctx context.Context, addr sdk.AccAddress, func (k Keeper) SwapToOnomyStableToken(ctx context.Context, accAddress sdk.AccAddress, offerCoin sdk.Coin, expectedDenom string) error { // check stablecoin is suport - ok, err := k.StablecoinInfos.Has(ctx, offerCoin.Denom) - if err != nil || !ok { + stablecoin, err := k.StablecoinInfos.Get(ctx, offerCoin.Denom) + if err != nil { return fmt.Errorf("%s not in list stablecoin supported", offerCoin.Denom) } @@ -88,7 +88,7 @@ func (k Keeper) SwapToOnomyStableToken(ctx context.Context, accAddress sdk.AccAd } // check balance user and calculate amount of coins received - receiveAmountnomUSD, fee_in, err := k.calculateSwapToOnomyStableToken(ctx, offerCoin) + receiveAmountnomUSD, fee_in, err := k.calculateSwapToOnomyStableToken(ctx, offerCoin, stablecoin.SymBol) if err != nil { return err } @@ -150,26 +150,26 @@ func (k Keeper) PayFeesIn(ctx context.Context, amount math.Int, denom string) (m } // SwapToStablecoin return receiveAmount, fee, error -func (k Keeper) calculateSwapToStablecoin(ctx context.Context, amount math.Int, toDenom string) (math.Int, sdk.DecCoin, error) { - multiplier := k.OracleKeeper.GetPrice(ctx, toDenom, types.ReserveStableCoinDenom) +func (k Keeper) calculateSwapToStablecoin(ctx context.Context, amount math.Int, sc types.StablecoinInfo) (math.Int, sdk.DecCoin, error) { + multiplier := k.OracleKeeper.GetPrice(ctx, sc.SymBol, types.ReserveStableCoinDenom) if multiplier == nil || multiplier.IsNil() { - return math.Int{}, sdk.DecCoin{}, errors.Wrapf(oracletypes.ErrInvalidOracle, "can not get price with base %s quote %s", toDenom, types.ReserveStableCoinDenom) + return math.Int{}, sdk.DecCoin{}, errors.Wrapf(oracletypes.ErrInvalidOracle, "can not get price with base %s quote %s", sc.SymBol, types.ReserveStableCoinDenom) } amountStablecoin := amount.ToLegacyDec().Quo(*multiplier) - fee, err := k.PayFeesOut(ctx, amountStablecoin.RoundInt(), toDenom) + fee, err := k.PayFeesOut(ctx, amountStablecoin.RoundInt(), sc.Denom) if err != nil { return math.Int{}, sdk.DecCoin{}, err } receiveAmount := amountStablecoin.Sub(fee) - return receiveAmount.RoundInt(), sdk.NewDecCoinFromDec(toDenom, fee), nil + return receiveAmount.RoundInt(), sdk.NewDecCoinFromDec(sc.Denom, fee), nil } -func (k Keeper) calculateSwapToOnomyStableToken(ctx context.Context, stablecoin sdk.Coin) (math.Int, sdk.DecCoin, error) { - multiplier := k.OracleKeeper.GetPrice(ctx, stablecoin.Denom, types.ReserveStableCoinDenom) +func (k Keeper) calculateSwapToOnomyStableToken(ctx context.Context, stablecoin sdk.Coin, symBol string) (math.Int, sdk.DecCoin, error) { + multiplier := k.OracleKeeper.GetPrice(ctx, symBol, types.ReserveStableCoinDenom) if multiplier == nil || multiplier.IsNil() { - return math.Int{}, sdk.DecCoin{}, errors.Wrapf(oracletypes.ErrInvalidOracle, "can not get price with base %s quote %s", stablecoin.Denom, types.ReserveStableCoinDenom) + return math.Int{}, sdk.DecCoin{}, errors.Wrapf(oracletypes.ErrInvalidOracle, "can not get price with base %s quote %s", symBol, types.ReserveStableCoinDenom) } amountnomUSD := multiplier.Mul(stablecoin.Amount.ToLegacyDec()) diff --git a/x/psm/keeper/swap_test.go b/x/psm/keeper/swap_test.go index 03b1775..bdd5983 100644 --- a/x/psm/keeper/swap_test.go +++ b/x/psm/keeper/swap_test.go @@ -36,6 +36,7 @@ func (s *KeeperTestSuite) TestSwapToOnomyStableToken() { _, err = s.msgServer.AddStableCoinProposal(s.Ctx, &types.MsgAddStableCoin{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Denom: usdt, + SymBol: usdt, LimitTotal: limitUSDT, FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), @@ -54,6 +55,7 @@ func (s *KeeperTestSuite) TestSwapToOnomyStableToken() { _, err := s.msgServer.AddStableCoinProposal(s.Ctx, &types.MsgAddStableCoin{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Denom: usdc, + SymBol: usdc, LimitTotal: limitUSDC, FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), @@ -113,6 +115,7 @@ func (s *KeeperTestSuite) TestSwapToOtherStablecoin() { _, err = s.msgServer.AddStableCoinProposal(s.Ctx, &types.MsgAddStableCoin{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Denom: usdt, + SymBol: usdt, LimitTotal: limitUSDT, FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), @@ -135,6 +138,7 @@ func (s *KeeperTestSuite) TestSwapToOtherStablecoin() { _, err := s.msgServer.AddStableCoinProposal(s.Ctx, &types.MsgAddStableCoin{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Denom: usdc, + SymBol: usdc, LimitTotal: limitUSDC, FeeIn: math.LegacyMustNewDecFromStr("0.001"), FeeOut: math.LegacyMustNewDecFromStr("0.001"), diff --git a/x/psm/types/msgs.go b/x/psm/types/msgs.go index 00ac854..4854944 100644 --- a/x/psm/types/msgs.go +++ b/x/psm/types/msgs.go @@ -83,6 +83,10 @@ func (msg MsgAddStableCoin) ValidateBasic() error { return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "empty denom") } + if msg.SymBol == "" { + return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "empty symbol") + } + if msg.OracleScript <= 0 { return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "empty oracle script") } @@ -122,6 +126,10 @@ func (msg MsgUpdatesStableCoin) ValidateBasic() error { return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "empty denom") } + if msg.SymBol == "" { + return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "empty symbol") + } + if msg.LimitTotal.LT(math.ZeroInt()) { return sdkerrors.Wrap(ErrInvalidAddStableCoinProposal, "limittotal less than zero") } diff --git a/x/psm/types/psm.go b/x/psm/types/psm.go index d6dc604..7101a22 100644 --- a/x/psm/types/psm.go +++ b/x/psm/types/psm.go @@ -12,6 +12,7 @@ func GetMsgStablecoin(msg getStablecoinFromMsg) StablecoinInfo { FeeOut: msg.GetFeeOut(), TotalStablecoinLock: math.ZeroInt(), FeeMaxStablecoin: msg.GetFeeIn().Add(msg.GetFeeOut()), + SymBol: msg.GetSymBol(), } } @@ -21,4 +22,5 @@ type getStablecoinFromMsg interface { // GetPrice() math.LegacyDec GetFeeIn() math.LegacyDec GetFeeOut() math.LegacyDec + GetSymBol() string } diff --git a/x/psm/types/psm.pb.go b/x/psm/types/psm.pb.go index 80a6d56..7bc95d4 100644 --- a/x/psm/types/psm.pb.go +++ b/x/psm/types/psm.pb.go @@ -40,6 +40,7 @@ type StablecoinInfo struct { TotalStablecoinLock cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=total_stablecoin_lock,json=totalStablecoinLock,proto3,customtype=cosmossdk.io/math.Int" json:"total_stablecoin_lock"` // maximum fee for when either fee = 0 FeeMaxStablecoin cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=fee_max_stablecoin,json=feeMaxStablecoin,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee_max_stablecoin"` + SymBol string `protobuf:"bytes,7,opt,name=sym_bol,json=symBol,proto3" json:"sym_bol,omitempty"` } func (m *StablecoinInfo) Reset() { *m = StablecoinInfo{} } @@ -82,6 +83,13 @@ func (m *StablecoinInfo) GetDenom() string { return "" } +func (m *StablecoinInfo) GetSymBol() string { + if m != nil { + return m.SymBol + } + return "" +} + func init() { proto.RegisterType((*StablecoinInfo)(nil), "reserve.psm.v1.StablecoinInfo") } @@ -89,32 +97,33 @@ func init() { func init() { proto.RegisterFile("reserve/psm/v1/psm.proto", fileDescriptor_59572214fa05fb2f) } var fileDescriptor_59572214fa05fb2f = []byte{ - // 397 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0xab, 0xd3, 0x40, - 0x10, 0xc7, 0x13, 0x9f, 0xad, 0xb8, 0xca, 0x43, 0xd7, 0xf7, 0x20, 0x3e, 0x21, 0xef, 0xe1, 0xe9, - 0x21, 0x9a, 0x35, 0xf8, 0x0d, 0x4a, 0x11, 0x23, 0x15, 0xb1, 0x7a, 0xf2, 0x12, 0x36, 0xdb, 0x49, - 0x1a, 0x9a, 0xdd, 0x29, 0xdd, 0x6d, 0x68, 0xbf, 0x85, 0x1f, 0xc3, 0xa3, 0x07, 0x3f, 0x44, 0x8f, - 0xc5, 0x83, 0x88, 0x87, 0x22, 0xed, 0xc1, 0xaf, 0x21, 0xbb, 0x89, 0xb6, 0xe0, 0xad, 0x97, 0x64, - 0x67, 0xfe, 0xc3, 0x6f, 0xfe, 0x33, 0x0c, 0x09, 0x66, 0xa0, 0x61, 0x56, 0x03, 0x9b, 0x6a, 0xc9, - 0xea, 0xd8, 0xfe, 0xa2, 0xe9, 0x0c, 0x0d, 0xd2, 0xd3, 0x56, 0x89, 0x6c, 0xaa, 0x8e, 0x2f, 0xce, - 0x0a, 0x2c, 0xd0, 0x49, 0xcc, 0xbe, 0x9a, 0xaa, 0x8b, 0x87, 0x02, 0xb5, 0x44, 0x9d, 0x36, 0x42, - 0x13, 0xb4, 0xd2, 0x7d, 0x2e, 0x4b, 0x85, 0xcc, 0x7d, 0xdb, 0x54, 0xd8, 0x14, 0xb0, 0x8c, 0x6b, - 0x60, 0x75, 0x9c, 0x81, 0xe1, 0x31, 0x13, 0x58, 0xaa, 0x46, 0x7f, 0xfc, 0xfd, 0x84, 0x9c, 0xbe, - 0x37, 0x3c, 0xab, 0xc0, 0x26, 0x13, 0x95, 0x23, 0x3d, 0x23, 0x9d, 0x11, 0x28, 0x94, 0x81, 0x7f, - 0xe5, 0x5f, 0xdf, 0x1e, 0x36, 0x01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8, 0x50, 0x2e, 0xdd, 0x25, 0x08, - 0xac, 0xd8, 0xdf, 0xcb, 0x5c, 0xb8, 0xdb, 0x34, 0xcb, 0x29, 0xe8, 0xac, 0xeb, 0xd4, 0x17, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xad, 0x79, 0xba, 0x33, 0xb7, 0x02, 0x00, 0x00, + // 416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x63, 0x4a, 0x1c, 0xb1, 0xa0, 0x0a, 0x96, 0x56, 0x2c, 0x45, 0x72, 0x2b, 0x4e, 0x15, + 0x02, 0x2f, 0x16, 0x6f, 0x10, 0x55, 0x08, 0xa3, 0x22, 0x44, 0xe0, 0xc4, 0xc5, 0x5a, 0x6f, 0xc6, + 0xae, 0x15, 0xef, 0x4e, 0x94, 0xdd, 0x58, 0xf1, 0x5b, 0xf0, 0x18, 0x1c, 0x39, 0xf0, 0x10, 0x3d, + 0x56, 0x9c, 0x10, 0x87, 0x0a, 0x25, 0x07, 0x8e, 0xbc, 0x02, 0xda, 0xb5, 0xa1, 0x95, 0xb8, 0xe5, + 0x62, 0x7b, 0xe6, 0x1f, 0x7d, 0xf3, 0xcf, 0x78, 0x08, 0x5b, 0x80, 0x81, 0x45, 0x03, 0x7c, 0x6e, + 0x14, 0x6f, 0x12, 0xf7, 0x8a, 0xe7, 0x0b, 0xb4, 0x48, 0x77, 0x7b, 0x25, 0x76, 0xa9, 0x26, 0x39, + 0xd8, 0x2b, 0xb1, 0x44, 0x2f, 0x71, 0xf7, 0xd5, 0x55, 0x1d, 0x3c, 0x94, 0x68, 0x14, 0x9a, 0xac, + 0x13, 0xba, 0xa0, 0x97, 0xee, 0x09, 0x55, 0x69, 0xe4, 0xfe, 0xd9, 0xa7, 0xa2, 0xae, 0x80, 0xe7, + 0xc2, 0x00,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0xe0, 0x8d, 0x58, 0x5d, 0x35, 0xa1, 0x0f, 0xc8, 0xc8, 0xb4, + 0x2a, 0xcb, 0xb1, 0x66, 0x23, 0xff, 0x1f, 0x43, 0xd3, 0xaa, 0x31, 0xd6, 0xe3, 0x97, 0xe7, 0xeb, + 0x28, 0xb8, 0x58, 0x47, 0xc1, 0xcf, 0x75, 0x14, 0x7c, 0xda, 0x44, 0x83, 0x8b, 0x4d, 0x34, 0xf8, + 0xbe, 0x89, 0x06, 0x1f, 0x9f, 0x96, 0x95, 0x3d, 0x5b, 0xe6, 0xb1, 0x44, 0xc5, 0x51, 0xa3, 0x6a, + 0xfd, 0x89, 0x48, 0xac, 0xf9, 0xdf, 0x93, 0x5d, 0xf9, 0xa3, 0xb5, 0xed, 0x1c, 0x4c, 0x1e, 0x7a, + 0xf5, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x36, 0xc2, 0xe8, 0xd0, 0x02, 0x00, 0x00, } func (m *StablecoinInfo) Marshal() (dAtA []byte, err error) { @@ -137,6 +146,13 @@ func (m *StablecoinInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SymBol) > 0 { + i -= len(m.SymBol) + copy(dAtA[i:], m.SymBol) + i = encodeVarintPsm(dAtA, i, uint64(len(m.SymBol))) + i-- + dAtA[i] = 0x3a + } { size := m.FeeMaxStablecoin.Size() i -= size @@ -228,6 +244,10 @@ func (m *StablecoinInfo) Size() (n int) { n += 1 + l + sovPsm(uint64(l)) l = m.FeeMaxStablecoin.Size() n += 1 + l + sovPsm(uint64(l)) + l = len(m.SymBol) + if l > 0 { + n += 1 + l + sovPsm(uint64(l)) + } return n } @@ -463,6 +483,38 @@ func (m *StablecoinInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SymBol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPsm + } + 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 ErrInvalidLengthPsm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPsm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SymBol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPsm(dAtA[iNdEx:]) diff --git a/x/psm/types/tx.pb.go b/x/psm/types/tx.pb.go index 66d2aa4..2f15125 100644 --- a/x/psm/types/tx.pb.go +++ b/x/psm/types/tx.pb.go @@ -135,6 +135,7 @@ type MsgAddStableCoin struct { 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=sym_bol,json=symBol,proto3" json:"sym_bol,omitempty"` } func (m *MsgAddStableCoin) Reset() { *m = MsgAddStableCoin{} } @@ -191,6 +192,13 @@ func (m *MsgAddStableCoin) GetOracleScript() int64 { return 0 } +func (m *MsgAddStableCoin) GetSymBol() string { + if m != nil { + return m.SymBol + } + return "" +} + type MsgAddStableCoinResponse struct { } @@ -234,6 +242,7 @@ type MsgUpdatesStableCoin struct { 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=sym_bol,json=symBol,proto3" json:"sym_bol,omitempty"` } func (m *MsgUpdatesStableCoin) Reset() { *m = MsgUpdatesStableCoin{} } @@ -290,6 +299,13 @@ func (m *MsgUpdatesStableCoin) GetOracleScript() int64 { return 0 } +func (m *MsgUpdatesStableCoin) GetSymBol() string { + if m != nil { + return m.SymBol + } + return "" +} + type MsgUpdatesStableCoinResponse struct { } @@ -436,54 +452,55 @@ func init() { func init() { proto.RegisterFile("reserve/psm/v1/tx.proto", fileDescriptor_d0ff2d5421e71e2a) } var fileDescriptor_d0ff2d5421e71e2a = []byte{ - // 738 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0xcf, 0x4f, 0xd3, 0x60, - 0x18, 0xc7, 0x57, 0xe7, 0x46, 0xf6, 0x30, 0x50, 0x9b, 0xe1, 0xba, 0x22, 0x65, 0x99, 0x12, 0x17, - 0x02, 0x2d, 0xc3, 0x68, 0x22, 0x37, 0x06, 0x31, 0x62, 0x5c, 0xc4, 0x4e, 0x13, 0xe3, 0x65, 0x79, - 0xd7, 0xbe, 0x2b, 0x8d, 0x6b, 0xdf, 0xa6, 0xef, 0xbb, 0xc9, 0x6e, 0xc6, 0xa3, 0x27, 0xfe, 0x05, - 0xe3, 0x45, 0x6f, 0x1c, 0x88, 0x7f, 0x03, 0x47, 0xc2, 0xc9, 0x78, 0x20, 0x06, 0x0e, 0xfc, 0x1b, - 0xa6, 0xbf, 0xc6, 0xba, 0x81, 0x18, 0x0e, 0x9e, 0xbc, 0x2c, 0x7b, 0x7e, 0x7d, 0x9f, 0xe7, 0xd9, - 0x67, 0x7d, 0x0a, 0x79, 0x17, 0x53, 0xec, 0x76, 0x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x90, 0xcf, 0x9c, - 0x53, 0x7b, 0x16, 0x16, 0xe7, 0xfe, 0x18, 0x8e, 0x34, 0xc5, 0xd4, 0x07, 0x0f, 0x62, 0xf5, 0xc9, - 0xfe, 0xb1, 0xc4, 0x1d, 0x1c, 0x4b, 0xdc, 0xaf, 0x63, 0x89, 0xdb, 0x39, 0x91, 0x12, 0x07, 0x27, - 0x52, 0xe2, 0xc7, 0x89, 0x94, 0x78, 0xbb, 0x60, 0x98, 0x6c, 0xab, 0xd3, 0x94, 0x35, 0x62, 0x29, - 0xc4, 0x26, 0x56, 0xcf, 0x7f, 0xc5, 0x69, 0xa4, 0xad, 0xc4, 0xff, 0xc8, 0xac, 0xe7, 0x60, 0xda, - 0x4c, 0xfb, 0xd1, 0x07, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x18, 0x0a, 0xb3, 0x04, 0xc5, 0x07, - 0x00, 0x00, + // 760 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x4d, 0x4f, 0x13, 0x5d, + 0x14, 0xc7, 0x3b, 0x4f, 0x9f, 0xb6, 0xe9, 0xa1, 0xf0, 0x3c, 0x4e, 0x8a, 0x9d, 0x0e, 0x32, 0x34, + 0x55, 0x62, 0x43, 0x60, 0x86, 0x62, 0x34, 0x91, 0x1d, 0x85, 0x18, 0x31, 0x36, 0xe2, 0x54, 0x13, + 0xe3, 0xa6, 0xb9, 0x9d, 0xb9, 0x1d, 0x26, 0xce, 0xcc, 0x9d, 0xcc, 0xbd, 0xad, 0x74, 0x67, 0x5c, + 0xba, 0xe2, 0x3b, 0xb8, 0x71, 0xc9, 0x82, 0xb8, 0x70, 0xe9, 0x8a, 0x25, 0x61, 0x65, 0x5c, 0x10, + 0x03, 0x0b, 0xbe, 0x86, 0x99, 0xb7, 0xd2, 0x17, 0x10, 0xc3, 0xc6, 0x8d, 0x9b, 0xa6, 0xf7, 0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xbe, 0x74, 0x81, 0xc2, 0x50, 0xa4, 0x58, 0xb9, 0x2a, 0xa2, 0x5f, 0x84, 0x40, + 0x71, 0x0c, 0x51, 0xbf, 0xd0, 0x9d, 0x4b, 0x5b, 0x1d, 0x88, 0x16, 0x17, 0x7f, 0x27, 0xaa, 0x5f, + 0x50, 0x05, 0x18, 0x40, 0x3e, 0x7b, 0x41, 0xee, 0xb9, 0x5b, 0x9c, 0xff, 0xa5, 0x3b, 0xd6, 0x14, + 0x53, 0xef, 0x7c, 0x88, 0xb5, 0x47, 0x07, 0x27, 0x12, 0x77, 0x78, 0x22, 0x71, 0x3f, 0x4e, 0x24, + 0x6e, 0xf7, 0x54, 0x4a, 0x1c, 0x9e, 0x4a, 0x89, 0x6f, 0xa7, 0x52, 0xe2, 0xf5, 0xa2, 0x61, 0xb2, + 0xed, 0x4e, 0x4b, 0xd6, 0x88, 0xad, 0x10, 0x87, 0xd8, 0xbd, 0xe0, 0x4f, 0x51, 0x23, 0x96, 0x32, + 0xfc, 0x43, 0x66, 0x3d, 0x17, 0xd3, 0x56, 0x3a, 0xf0, 0xde, 0xfb, 0x19, 0x00, 0x00, 0xff, 0xff, + 0x5e, 0xb7, 0x87, 0xbe, 0xf7, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -762,6 +779,13 @@ func (m *MsgAddStableCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SymBol) > 0 { + i -= len(m.SymBol) + copy(dAtA[i:], m.SymBol) + i = encodeVarintTx(dAtA, i, uint64(len(m.SymBol))) + i-- + dAtA[i] = 0x3a + } if m.OracleScript != 0 { i = encodeVarintTx(dAtA, i, uint64(m.OracleScript)) i-- @@ -857,6 +881,13 @@ func (m *MsgUpdatesStableCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SymBol) > 0 { + i -= len(m.SymBol) + copy(dAtA[i:], m.SymBol) + i = encodeVarintTx(dAtA, i, uint64(len(m.SymBol))) + i-- + dAtA[i] = 0x3a + } if m.OracleScript != 0 { i = encodeVarintTx(dAtA, i, uint64(m.OracleScript)) i-- @@ -1060,6 +1091,10 @@ func (m *MsgAddStableCoin) Size() (n int) { if m.OracleScript != 0 { n += 1 + sovTx(uint64(m.OracleScript)) } + l = len(m.SymBol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1095,6 +1130,10 @@ func (m *MsgUpdatesStableCoin) Size() (n int) { if m.OracleScript != 0 { n += 1 + sovTx(uint64(m.OracleScript)) } + l = len(m.SymBol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1517,6 +1556,38 @@ func (m *MsgAddStableCoin) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SymBol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SymBol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1799,6 +1870,38 @@ func (m *MsgUpdatesStableCoin) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SymBol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SymBol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])