diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 423eff0da4..e9718495d8 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -859,6 +859,9 @@ - [lbm/fswap/v1/event.proto](#lbm/fswap/v1/event.proto) - [EventSwapCoins](#lbm.fswap.v1.EventSwapCoins) +- [lbm/fswap/v1/fswap.proto](#lbm/fswap/v1/fswap.proto) + - [Swapped](#lbm.fswap.v1.Swapped) + - [lbm/fswap/v1/params.proto](#lbm/fswap/v1/params.proto) - [Params](#lbm.fswap.v1.Params) @@ -12731,6 +12734,38 @@ Msg defines the foundation Msg service. + + + + + + + + + + + +

Top

+ +## lbm/fswap/v1/fswap.proto + + + + + +### Swapped + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `old_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `new_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + @@ -12756,9 +12791,6 @@ Params defines the parameters for the module. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `new_coin_swap_total_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | upper limit in new coin that this module can swap | -| `swap_rate` | [uint64](#uint64) | | constant value representing the exchange rate, without decimal (148079656) | -| `swap_rate_decimals` | [int32](#int32) | | The number shows how to get the true exchange rate by dividing swap_rate by 10 to the power | | `new_coin_denom` | [string](#string) | | new denomination for new coin after swap | @@ -12791,6 +12823,7 @@ GenesisState defines the fswap module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `params` | [Params](#lbm.fswap.v1.Params) | | | +| `swapped` | [Swapped](#lbm.fswap.v1.Swapped) | | | @@ -12831,8 +12864,7 @@ GenesisState defines the fswap module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `old_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | -| `new_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `swapped` | [Swapped](#lbm.fswap.v1.Swapped) | | | diff --git a/proto/lbm/fswap/v1/fswap.proto b/proto/lbm/fswap/v1/fswap.proto new file mode 100644 index 0000000000..827f5f3e32 --- /dev/null +++ b/proto/lbm/fswap/v1/fswap.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package lbm.fswap.v1; + +option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +message Swapped{ + cosmos.base.v1beta1.Coin old_coin_amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"]; + cosmos.base.v1beta1.Coin new_coin_amount = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"]; +} diff --git a/proto/lbm/fswap/v1/genesis.proto b/proto/lbm/fswap/v1/genesis.proto index 4b055874ef..ae0a9ade75 100644 --- a/proto/lbm/fswap/v1/genesis.proto +++ b/proto/lbm/fswap/v1/genesis.proto @@ -5,8 +5,10 @@ option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types"; import "gogoproto/gogo.proto"; import "lbm/fswap/v1/params.proto"; +import "lbm/fswap/v1/fswap.proto"; // GenesisState defines the fswap module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; + Swapped swapped =2 [(gogoproto.nullable) = false]; } diff --git a/proto/lbm/fswap/v1/params.proto b/proto/lbm/fswap/v1/params.proto index 3507c72b91..da236c9373 100644 --- a/proto/lbm/fswap/v1/params.proto +++ b/proto/lbm/fswap/v1/params.proto @@ -1,22 +1,13 @@ - syntax = "proto3"; package lbm.fswap.v1; option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types"; import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - // upper limit in new coin that this module can swap - cosmos.base.v1beta1.Coin new_coin_swap_total_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"]; - // constant value representing the exchange rate, without decimal (148079656) - uint64 swap_rate = 2; - // The number shows how to get the true exchange rate by dividing swap_rate by 10 to the power - int32 swap_rate_decimals = 3; // new denomination for new coin after swap - string new_coin_denom = 4; + string new_coin_denom = 1; } diff --git a/proto/lbm/fswap/v1/query.proto b/proto/lbm/fswap/v1/query.proto index 1d7041dd32..f5d92c7bfc 100644 --- a/proto/lbm/fswap/v1/query.proto +++ b/proto/lbm/fswap/v1/query.proto @@ -6,6 +6,7 @@ option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "lbm/fswap/v1/fswap.proto"; service Query { rpc Swapped(QuerySwappedRequest) returns (QuerySwappedResponse) { @@ -18,10 +19,7 @@ service Query { message QuerySwappedRequest {} message QuerySwappedResponse { - cosmos.base.v1beta1.Coin old_coin_amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"]; - cosmos.base.v1beta1.Coin new_coin_amount = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"]; + Swapped swapped = 1 [(gogoproto.nullable) = false]; } message QueryTotalSwappableAmountRequest {} diff --git a/x/fswap/types/fswap.pb.go b/x/fswap/types/fswap.pb.go new file mode 100644 index 0000000000..f53d058797 --- /dev/null +++ b/x/fswap/types/fswap.pb.go @@ -0,0 +1,378 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: lbm/fswap/v1/fswap.proto + +package types + +import ( + fmt "fmt" + types "github.com/Finschia/finschia-sdk/types" + _ "github.com/gogo/protobuf/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 +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 + +type Swapped struct { + OldCoinAmount types.Coin `protobuf:"bytes,1,opt,name=old_coin_amount,json=oldCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"old_coin_amount"` + NewCoinAmount types.Coin `protobuf:"bytes,2,opt,name=new_coin_amount,json=newCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"new_coin_amount"` +} + +func (m *Swapped) Reset() { *m = Swapped{} } +func (m *Swapped) String() string { return proto.CompactTextString(m) } +func (*Swapped) ProtoMessage() {} +func (*Swapped) Descriptor() ([]byte, []int) { + return fileDescriptor_42ca60eaf37a2b67, []int{0} +} +func (m *Swapped) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Swapped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Swapped.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 *Swapped) XXX_Merge(src proto.Message) { + xxx_messageInfo_Swapped.Merge(m, src) +} +func (m *Swapped) XXX_Size() int { + return m.Size() +} +func (m *Swapped) XXX_DiscardUnknown() { + xxx_messageInfo_Swapped.DiscardUnknown(m) +} + +var xxx_messageInfo_Swapped proto.InternalMessageInfo + +func (m *Swapped) GetOldCoinAmount() types.Coin { + if m != nil { + return m.OldCoinAmount + } + return types.Coin{} +} + +func (m *Swapped) GetNewCoinAmount() types.Coin { + if m != nil { + return m.NewCoinAmount + } + return types.Coin{} +} + +func init() { + proto.RegisterType((*Swapped)(nil), "lbm.fswap.v1.Swapped") +} + +func init() { proto.RegisterFile("lbm/fswap/v1/fswap.proto", fileDescriptor_42ca60eaf37a2b67) } + +var fileDescriptor_42ca60eaf37a2b67 = []byte{ + // 262 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0x49, 0xca, 0xd5, + 0x4f, 0x2b, 0x2e, 0x4f, 0x2c, 0xd0, 0x2f, 0x33, 0x84, 0x30, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, + 0x85, 0x78, 0x72, 0x92, 0x72, 0xf5, 0x20, 0x02, 0x65, 0x86, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, + 0x60, 0x09, 0x7d, 0x10, 0x0b, 0xa2, 0x46, 0x4a, 0x2e, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x58, 0x3f, + 0x29, 0xb1, 0x38, 0x55, 0xbf, 0xcc, 0x30, 0x29, 0xb5, 0x24, 0xd1, 0x50, 0x3f, 0x39, 0x3f, 0x33, + 0x0f, 0x22, 0xaf, 0xf4, 0x93, 0x91, 0x8b, 0x3d, 0xb8, 0x3c, 0xb1, 0xa0, 0x20, 0x35, 0x45, 0xa8, + 0x8c, 0x8b, 0x3f, 0x3f, 0x27, 0x25, 0x1e, 0x24, 0x1b, 0x9f, 0x98, 0x9b, 0x5f, 0x9a, 0x57, 0x22, + 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa9, 0x07, 0x31, 0x45, 0x0f, 0x64, 0x8a, 0x1e, 0xd4, + 0x14, 0x3d, 0xe7, 0xfc, 0xcc, 0x3c, 0x27, 0xe3, 0x13, 0xf7, 0xe4, 0x19, 0x56, 0xdd, 0x97, 0xd7, + 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0xcb, 0xcc, 0x2b, 0x4e, + 0xce, 0xc8, 0x4c, 0xd4, 0x4f, 0x83, 0x32, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x4b, 0x2a, 0x0b, 0x52, + 0x8b, 0xc1, 0x9a, 0x82, 0x78, 0xf3, 0x73, 0x52, 0x40, 0x0c, 0x47, 0xb0, 0x25, 0x20, 0x7b, 0xf3, + 0x52, 0xcb, 0x51, 0xec, 0x65, 0xa2, 0x8d, 0xbd, 0x79, 0xa9, 0xe5, 0x08, 0x7b, 0x9d, 0x3c, 0x4e, + 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, + 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x8f, 0xa0, 0xa9, 0x15, 0xd0, 0x28, + 0x01, 0x9b, 0x9e, 0xc4, 0x06, 0x0e, 0x4c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x78, + 0x6f, 0xce, 0xac, 0x01, 0x00, 0x00, +} + +func (m *Swapped) 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 *Swapped) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Swapped) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.NewCoinAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFswap(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.OldCoinAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFswap(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintFswap(dAtA []byte, offset int, v uint64) int { + offset -= sovFswap(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Swapped) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.OldCoinAmount.Size() + n += 1 + l + sovFswap(uint64(l)) + l = m.NewCoinAmount.Size() + n += 1 + l + sovFswap(uint64(l)) + return n +} + +func sovFswap(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFswap(x uint64) (n int) { + return sovFswap(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Swapped) 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 ErrIntOverflowFswap + } + 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: Swapped: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Swapped: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldCoinAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFswap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFswap + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFswap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OldCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewCoinAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFswap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFswap + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFswap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFswap(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFswap + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFswap(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, ErrIntOverflowFswap + } + 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, ErrIntOverflowFswap + } + 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, ErrIntOverflowFswap + } + 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, ErrInvalidLengthFswap + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFswap + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFswap + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFswap = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFswap = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFswap = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/fswap/types/genesis.pb.go b/x/fswap/types/genesis.pb.go index a56d510e68..af2475beea 100644 --- a/x/fswap/types/genesis.pb.go +++ b/x/fswap/types/genesis.pb.go @@ -25,7 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the fswap module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Swapped Swapped `protobuf:"bytes,2,opt,name=swapped,proto3" json:"swapped"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -68,6 +69,13 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetSwapped() Swapped { + if m != nil { + return m.Swapped + } + return Swapped{} +} + func init() { proto.RegisterType((*GenesisState)(nil), "lbm.fswap.v1.GenesisState") } @@ -75,20 +83,22 @@ func init() { func init() { proto.RegisterFile("lbm/fswap/v1/genesis.proto", fileDescriptor_94e309cb1db27661) } var fileDescriptor_94e309cb1db27661 = []byte{ - // 200 bytes of a gzipped FileDescriptorProto + // 231 bytes of a gzipped FileDesc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x36, 0xb0, 0xa3, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xa6, 0x7e, 0x83, 0x5e, 0xf1, 0x00, 0x00, 0x00, + 0x14, 0xfd, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0xed, 0x52, 0x12, 0x28, 0x52, 0x10, 0x73, 0xc0, + 0x32, 0x4a, 0x95, 0x5c, 0x3c, 0xee, 0x10, 0x9b, 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x8c, 0xb8, + 0xd8, 0x20, 0x3a, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x44, 0xf4, 0x90, 0x6d, 0xd6, 0x0b, + 0x00, 0xcb, 0x39, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, 0x29, 0x64, 0xca, 0xc5, 0x0e, + 0x92, 0x2f, 0x48, 0x4d, 0x91, 0x60, 0x02, 0x6b, 0x12, 0x45, 0xd5, 0x14, 0x0c, 0x91, 0x84, 0xea, + 0x82, 0xa9, 0x75, 0xf2, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, + 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xbd, + 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb7, 0xcc, 0xbc, 0xe2, 0xe4, + 0x8c, 0xcc, 0x44, 0xfd, 0x34, 0x28, 0x43, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0xea, 0x9b, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x5f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x23, + 0x15, 0x87, 0x48, 0x42, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -111,6 +121,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Swapped.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 { @@ -143,6 +163,8 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + l = m.Swapped.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -214,6 +236,39 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swapped", 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.Swapped.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/fswap/types/params.pb.go b/x/fswap/types/params.pb.go index 9298bdc283..fd779ed5a6 100644 --- a/x/fswap/types/params.pb.go +++ b/x/fswap/types/params.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - types "github.com/Finschia/finschia-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -26,14 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - // upper limit in new coin that this module can swap - NewCoinSwapTotalLimit types.Coin `protobuf:"bytes,1,opt,name=new_coin_swap_total_limit,json=newCoinSwapTotalLimit,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"new_coin_swap_total_limit"` - // constant value representing the exchange rate, without decimal (148079656) - SwapRate uint64 `protobuf:"varint,2,opt,name=swap_rate,json=swapRate,proto3" json:"swap_rate,omitempty"` - // The number shows how to get the true exchange rate by dividing swap_rate by 10 to the power - SwapRateDecimals int32 `protobuf:"varint,3,opt,name=swap_rate_decimals,json=swapRateDecimals,proto3" json:"swap_rate_decimals,omitempty"` // new denomination for new coin after swap - NewCoinDenom string `protobuf:"bytes,4,opt,name=new_coin_denom,json=newCoinDenom,proto3" json:"new_coin_denom,omitempty"` + NewCoinDenom string `protobuf:"bytes,1,opt,name=new_coin_denom,json=newCoinDenom,proto3" json:"new_coin_denom,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -68,27 +61,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetNewCoinSwapTotalLimit() types.Coin { - if m != nil { - return m.NewCoinSwapTotalLimit - } - return types.Coin{} -} - -func (m *Params) GetSwapRate() uint64 { - if m != nil { - return m.SwapRate - } - return 0 -} - -func (m *Params) GetSwapRateDecimals() int32 { - if m != nil { - return m.SwapRateDecimals - } - return 0 -} - func (m *Params) GetNewCoinDenom() string { if m != nil { return m.NewCoinDenom @@ -103,29 +75,20 @@ func init() { func init() { proto.RegisterFile("lbm/fswap/v1/params.proto", fileDescriptor_15e620b81032c44d) } var fileDescriptor_15e620b81032c44d = []byte{ - // 342 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xb1, 0x4e, 0xeb, 0x30, - 0x18, 0x85, 0xe3, 0xde, 0xde, 0x8a, 0x86, 0x0a, 0xa1, 0x08, 0xa4, 0xb4, 0x48, 0x6e, 0x84, 0x18, - 0x22, 0x01, 0xb6, 0x42, 0x37, 0xc6, 0x52, 0x21, 0x06, 0x06, 0x14, 0x98, 0x58, 0x22, 0x27, 0x75, - 0x5b, 0x8b, 0x38, 0x8e, 0x6a, 0xd3, 0xc0, 0x1b, 0x20, 0x26, 0x46, 0x46, 0x66, 0x9e, 0xa4, 0x63, - 0x47, 0x26, 0x40, 0xed, 0x8b, 0x20, 0x3b, 0xa1, 0x2b, 0xdb, 0xaf, 0x73, 0x7e, 0x7f, 0xc7, 0xc7, - 0xb6, 0xdb, 0x69, 0xcc, 0xf1, 0x48, 0x16, 0x24, 0xc7, 0xb3, 0x00, 0xe7, 0x64, 0x4a, 0xb8, 0x44, - 0xf9, 0x54, 0x28, 0xe1, 0xb4, 0xd2, 0x98, 0x23, 0x63, 0xa1, 0x59, 0xd0, 0xd9, 0x19, 0x8b, 0xb1, - 0x30, 0x06, 0xd6, 0x53, 0xb9, 0xd3, 0x81, 0x89, 0x90, 0x5c, 0x48, 0x1c, 0x13, 0x49, 0xf1, 0x2c, - 0x88, 0xa9, 0x22, 0x01, 0x4e, 0x04, 0xcb, 0x4a, 0x7f, 0xff, 0xb9, 0x66, 0x37, 0xae, 0x0c, 0xd4, - 0x79, 0x02, 0x76, 0x3b, 0xa3, 0x45, 0xa4, 0xdd, 0x48, 0x53, 0x23, 0x25, 0x14, 0x49, 0xa3, 0x94, - 0x71, 0xa6, 0x5c, 0xe0, 0x01, 0x7f, 0xf3, 0xa4, 0x8d, 0x4a, 0x1e, 0xd2, 0x3c, 0x54, 0xf1, 0xd0, - 0x99, 0x60, 0x59, 0xbf, 0x37, 0xff, 0xec, 0x5a, 0xef, 0x5f, 0xdd, 0xc3, 0x31, 0x53, 0x93, 0xfb, - 0x18, 0x25, 0x82, 0xe3, 0x73, 0x96, 0xc9, 0x64, 0xc2, 0x08, 0x1e, 0x55, 0xc3, 0xb1, 0x1c, 0xde, - 0x61, 0xf5, 0x98, 0x53, 0x69, 0x0e, 0x85, 0xbb, 0x19, 0x2d, 0xf4, 0x70, 0x5d, 0x90, 0xfc, 0x46, - 0xa7, 0x5d, 0xea, 0x30, 0x67, 0xcf, 0x6e, 0x9a, 0x0b, 0x4c, 0x89, 0xa2, 0x6e, 0xcd, 0x03, 0x7e, - 0x3d, 0xdc, 0xd0, 0x42, 0x48, 0x14, 0x75, 0x8e, 0x6c, 0x67, 0x6d, 0x46, 0x43, 0x9a, 0x30, 0x4e, - 0x52, 0xe9, 0xfe, 0xf3, 0x80, 0xff, 0x3f, 0xdc, 0xfe, 0xdd, 0x1a, 0x54, 0xba, 0x73, 0x60, 0x6f, - 0xad, 0x4b, 0x0d, 0x69, 0x26, 0xb8, 0x5b, 0xf7, 0x80, 0xdf, 0x0c, 0x5b, 0x55, 0xf2, 0x40, 0x6b, - 0xa7, 0xf5, 0xd7, 0xb7, 0xae, 0xd5, 0xbf, 0x98, 0x2f, 0x21, 0x58, 0x2c, 0x21, 0xf8, 0x5e, 0x42, - 0xf0, 0xb2, 0x82, 0xd6, 0x62, 0x05, 0xad, 0x8f, 0x15, 0xb4, 0x6e, 0xd1, 0x9f, 0xa5, 0x1e, 0xaa, - 0x4f, 0x32, 0xe5, 0xe2, 0x86, 0x79, 0xdd, 0xde, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x6c, - 0x55, 0x7a, 0xbe, 0x01, 0x00, 0x00, + // 194 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x49, 0xca, 0xd5, + 0x4f, 0x2b, 0x2e, 0x4f, 0x2c, 0xd0, 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc9, 0x49, 0xca, 0xd5, 0x03, 0x4b, 0xe9, 0x95, 0x19, + 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x25, 0x13, 0x2e, + 0xb6, 0x00, 0xb0, 0x1e, 0x21, 0x15, 0x2e, 0xbe, 0xbc, 0xd4, 0xf2, 0xf8, 0xe4, 0xfc, 0xcc, 0xbc, + 0xf8, 0x94, 0xd4, 0xbc, 0xfc, 0x5c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x9e, 0xbc, 0xd4, + 0x72, 0xe7, 0xfc, 0xcc, 0x3c, 0x17, 0x90, 0x98, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0x1e, + 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, + 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, + 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x96, 0x99, 0x57, 0x9c, 0x9c, 0x91, 0x99, 0xa8, 0x9f, + 0x06, 0x65, 0xe8, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x40, 0x5d, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0x76, 0x86, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x90, 0xbf, 0xad, 0x40, 0xc7, 0x00, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -153,28 +116,8 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.NewCoinDenom) i = encodeVarintParams(dAtA, i, uint64(len(m.NewCoinDenom))) i-- - dAtA[i] = 0x22 - } - if m.SwapRateDecimals != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.SwapRateDecimals)) - i-- - dAtA[i] = 0x18 - } - if m.SwapRate != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.SwapRate)) - i-- - dAtA[i] = 0x10 + dAtA[i] = 0xa } - { - size, err := m.NewCoinSwapTotalLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -195,14 +138,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = m.NewCoinSwapTotalLimit.Size() - n += 1 + l + sovParams(uint64(l)) - if m.SwapRate != 0 { - n += 1 + sovParams(uint64(m.SwapRate)) - } - if m.SwapRateDecimals != 0 { - n += 1 + sovParams(uint64(m.SwapRateDecimals)) - } l = len(m.NewCoinDenom) if l > 0 { n += 1 + l + sovParams(uint64(l)) @@ -246,77 +181,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewCoinSwapTotalLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NewCoinSwapTotalLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapRate", wireType) - } - m.SwapRate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SwapRate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapRateDecimals", wireType) - } - m.SwapRateDecimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SwapRateDecimals |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NewCoinDenom", wireType) } diff --git a/x/fswap/types/query.pb.go b/x/fswap/types/query.pb.go index 49b4e5ae0d..b3635cf9ad 100644 --- a/x/fswap/types/query.pb.go +++ b/x/fswap/types/query.pb.go @@ -67,8 +67,7 @@ func (m *QuerySwappedRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySwappedRequest proto.InternalMessageInfo type QuerySwappedResponse struct { - OldCoinAmount types.Coin `protobuf:"bytes,1,opt,name=old_coin_amount,json=oldCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"old_coin_amount"` - NewCoinAmount types.Coin `protobuf:"bytes,2,opt,name=new_coin_amount,json=newCoinAmount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"new_coin_amount"` + Swapped Swapped `protobuf:"bytes,1,opt,name=swapped,proto3" json:"swapped"` } func (m *QuerySwappedResponse) Reset() { *m = QuerySwappedResponse{} } @@ -104,18 +103,11 @@ func (m *QuerySwappedResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySwappedResponse proto.InternalMessageInfo -func (m *QuerySwappedResponse) GetOldCoinAmount() types.Coin { +func (m *QuerySwappedResponse) GetSwapped() Swapped { if m != nil { - return m.OldCoinAmount + return m.Swapped } - return types.Coin{} -} - -func (m *QuerySwappedResponse) GetNewCoinAmount() types.Coin { - if m != nil { - return m.NewCoinAmount - } - return types.Coin{} + return Swapped{} } type QueryTotalSwappableAmountRequest struct { @@ -208,35 +200,35 @@ func init() { func init() { proto.RegisterFile("lbm/fswap/v1/query.proto", fileDescriptor_01deae9da7816d6a) } var fileDescriptor_01deae9da7816d6a = []byte{ - // 447 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x33, 0x01, 0x15, 0x46, 0x45, 0x88, 0xad, 0x76, 0x83, 0xa6, 0x6d, 0x2e, 0x2a, 0xe2, - 0x0c, 0x69, 0x3f, 0x81, 0x15, 0xc4, 0x83, 0x08, 0x56, 0x4f, 0x5e, 0x96, 0x49, 0x32, 0x4d, 0x07, - 0x93, 0x79, 0x69, 0x66, 0x92, 0xd8, 0xab, 0x07, 0xc1, 0x9b, 0xe0, 0x97, 0x10, 0x41, 0xfc, 0x1a, - 0x3d, 0x2e, 0x78, 0xf1, 0xa4, 0xb2, 0xeb, 0x07, 0x91, 0x4c, 0x66, 0x75, 0x57, 0xc2, 0xea, 0x65, - 0x6f, 0x8f, 0x79, 0x2f, 0xef, 0xf7, 0x7f, 0xff, 0xf7, 0x82, 0xb7, 0xf2, 0xb8, 0xa0, 0x47, 0xaa, - 0x65, 0x25, 0x6d, 0x22, 0x7a, 0x52, 0xf3, 0xea, 0x94, 0x94, 0x15, 0x68, 0xf0, 0x2e, 0xe5, 0x71, - 0x41, 0x4c, 0x86, 0x34, 0x91, 0x7f, 0x23, 0x03, 0xc8, 0x72, 0x4e, 0x59, 0x29, 0x28, 0x93, 0x12, - 0x34, 0xd3, 0x02, 0xa4, 0xea, 0x6b, 0xfd, 0x8d, 0x0c, 0x32, 0x30, 0x21, 0xed, 0x22, 0xfb, 0x1a, - 0x24, 0xa0, 0x0a, 0x50, 0x34, 0x66, 0x8a, 0xd3, 0x26, 0x8a, 0xb9, 0x66, 0x11, 0x4d, 0x40, 0xc8, - 0x3e,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, 0x9f, 0x33, 0xbc, 0xf9, 0xfa, 0xcb, 0xcf, 0xf7, 0xee, 0x75, - 0x6f, 0x93, 0x2e, 0x9d, 0xb5, 0xb2, 0x94, 0x4f, 0x08, 0x8f, 0x8c, 0x4f, 0x9d, 0xa2, 0xba, 0xaa, - 0xb8, 0x4c, 0x4c, 0x8b, 0xc7, 0xa2, 0x10, 0xda, 0x23, 0x03, 0x80, 0x15, 0xd6, 0xfb, 0xf4, 0xbf, - 0xeb, 0xad, 0x3a, 0x6a, 0xd4, 0xdd, 0xf1, 0x6e, 0x0d, 0xa8, 0x1b, 0x5a, 0xcc, 0xc1, 0xa3, 0xb3, - 0x69, 0x80, 0x26, 0xd3, 0x00, 0xfd, 0x98, 0x06, 0xe8, 0xdd, 0x2c, 0x70, 0x26, 0xb3, 0xc0, 0xf9, - 0x3a, 0x0b, 0x9c, 0x17, 0xe4, 0x9f, 0x9b, 0x78, 0x65, 0x01, 0x66, 0x23, 0xf1, 0x79, 0xf3, 0xc7, - 0xed, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x07, 0x01, 0xc3, 0x43, 0xef, 0x03, 0x00, 0x00, + // 441 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0xc7, 0x33, 0x8b, 0xba, 0x30, 0x7a, 0x1a, 0xb7, 0xba, 0x0d, 0x9a, 0xdd, 0xcd, 0x45, 0x45, + 0x9c, 0x21, 0xbb, 0xf8, 0x01, 0xac, 0x20, 0x1e, 0x54, 0xb0, 0x7a, 0xf2, 0x52, 0x26, 0xd9, 0xd9, + 0xec, 0x60, 0x32, 0x2f, 0xcd, 0x4c, 0x1a, 0x7b, 0xf5, 0xe6, 0x4d, 0xf0, 0x4b, 0x88, 0x20, 0x7e, + 0x8d, 0x1e, 0x0b, 0x5e, 0x3c, 0xa9, 0xb4, 0x7e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0x8d, 0x67, 0x4f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -399,17 +391,7 @@ func (m *QuerySwappedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.NewCoinAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.OldCoinAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Swapped.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -503,9 +485,7 @@ func (m *QuerySwappedResponse) Size() (n int) { } var l int _ = l - l = m.OldCoinAmount.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.NewCoinAmount.Size() + l = m.Swapped.Size() n += 1 + l + sovQuery(uint64(l)) return n } @@ -617,40 +597,7 @@ func (m *QuerySwappedResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldCoinAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OldCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewCoinAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Swapped", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -677,7 +624,7 @@ func (m *QuerySwappedResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.NewCoinAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Swapped.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex