diff --git a/proto/palomachain/paloma/gravity/bridge_tax_proposal.proto b/proto/palomachain/paloma/gravity/bridge_tax_proposal.proto new file mode 100644 index 00000000..17a5754a --- /dev/null +++ b/proto/palomachain/paloma/gravity/bridge_tax_proposal.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package palomachain.paloma.gravity; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/palomachain/paloma/x/skyway/types/gravity"; + +message SetBridgeTaxProposal { + string title = 1; + string description = 2; + string rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + repeated string excluded_tokens = 4; + repeated string exempt_addresses = 5; +} diff --git a/proto/palomachain/paloma/gravity/bridge_transfer_limit_proposal.proto b/proto/palomachain/paloma/gravity/bridge_transfer_limit_proposal.proto new file mode 100644 index 00000000..3c500cc6 --- /dev/null +++ b/proto/palomachain/paloma/gravity/bridge_transfer_limit_proposal.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package palomachain.paloma.gravity; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/palomachain/paloma/x/skyway/types/gravity"; + +enum LimitPeriod { + NONE = 0; + DAILY = 1; + WEEKLY = 2; + MONTHLY = 3; + YEARLY = 4; +} + +message SetBridgeTransferLimitProposal { + string title = 1; + string description = 2; + string token = 3; + string limit = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + LimitPeriod limit_period = 5; + repeated string exempt_addresses = 6; +} diff --git a/proto/palomachain/paloma/gravity/erc20_to_denom_proposal.proto b/proto/palomachain/paloma/gravity/erc20_to_denom_proposal.proto new file mode 100644 index 00000000..0cc44c14 --- /dev/null +++ b/proto/palomachain/paloma/gravity/erc20_to_denom_proposal.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package palomachain.paloma.gravity; + +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/palomachain/paloma/x/skyway/types/gravity"; + +message SetERC20ToDenomProposal { + string title = 1; + string description = 2; + string chain_reference_id = 3; + string erc20 = 4; + string denom = 5; +} diff --git a/x/skyway/types/codec.go b/x/skyway/types/codec.go index 7b14dc6b..ef8bbb29 100644 --- a/x/skyway/types/codec.go +++ b/x/skyway/types/codec.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/palomachain/paloma/x/skyway/types/gravity" ) // ModuleCdc is the codec for the module @@ -36,6 +37,10 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*govtypes.Content)(nil), + // Register the legacy gravity proposals + &gravity.SetERC20ToDenomProposal{}, + &gravity.SetBridgeTaxProposal{}, + &gravity.SetBridgeTransferLimitProposal{}, &SetERC20ToDenomProposal{}, &SetBridgeTaxProposal{}, &SetBridgeTransferLimitProposal{}, diff --git a/x/skyway/types/gravity/bridge_tax_proposal.pb.go b/x/skyway/types/gravity/bridge_tax_proposal.pb.go new file mode 100644 index 00000000..a816b196 --- /dev/null +++ b/x/skyway/types/gravity/bridge_tax_proposal.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: palomachain/paloma/gravity/bridge_tax_proposal.proto + +package gravity + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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 + +type SetBridgeTaxProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Rate string `protobuf:"bytes,3,opt,name=rate,proto3" json:"rate,omitempty"` + ExcludedTokens []string `protobuf:"bytes,4,rep,name=excluded_tokens,json=excludedTokens,proto3" json:"excluded_tokens,omitempty"` + ExemptAddresses []string `protobuf:"bytes,5,rep,name=exempt_addresses,json=exemptAddresses,proto3" json:"exempt_addresses,omitempty"` +} + +func (m *SetBridgeTaxProposal) Reset() { *m = SetBridgeTaxProposal{} } +func (m *SetBridgeTaxProposal) String() string { return proto.CompactTextString(m) } +func (*SetBridgeTaxProposal) ProtoMessage() {} +func (*SetBridgeTaxProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_7b15146dd277be39, []int{0} +} +func (m *SetBridgeTaxProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetBridgeTaxProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetBridgeTaxProposal.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 *SetBridgeTaxProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetBridgeTaxProposal.Merge(m, src) +} +func (m *SetBridgeTaxProposal) XXX_Size() int { + return m.Size() +} +func (m *SetBridgeTaxProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SetBridgeTaxProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SetBridgeTaxProposal proto.InternalMessageInfo + +func (m *SetBridgeTaxProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *SetBridgeTaxProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *SetBridgeTaxProposal) GetRate() string { + if m != nil { + return m.Rate + } + return "" +} + +func (m *SetBridgeTaxProposal) GetExcludedTokens() []string { + if m != nil { + return m.ExcludedTokens + } + return nil +} + +func (m *SetBridgeTaxProposal) GetExemptAddresses() []string { + if m != nil { + return m.ExemptAddresses + } + return nil +} + +func init() { + proto.RegisterType((*SetBridgeTaxProposal)(nil), "palomachain.paloma.gravity.SetBridgeTaxProposal") +} + +func init() { + proto.RegisterFile("palomachain/paloma/gravity/bridge_tax_proposal.proto", fileDescriptor_7b15146dd277be39) +} + +var fileDescriptor_7b15146dd277be39 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0x32, 0x41, + 0x14, 0x85, 0xd9, 0x1f, 0xf8, 0x13, 0xc6, 0x04, 0xcc, 0x86, 0x62, 0xa5, 0x98, 0x10, 0x1a, 0xb1, + 0x70, 0xa7, 0x90, 0x17, 0x90, 0x58, 0x1b, 0x83, 0x54, 0x36, 0x9b, 0x61, 0xe6, 0x06, 0x26, 0xec, + 0x32, 0x93, 0x99, 0x8b, 0xee, 0xbe, 0x85, 0x0f, 0xe3, 0x33, 0x18, 0x4b, 0x62, 0x65, 0x69, 0xe0, + 0x45, 0x8c, 0x33, 0x6c, 0x42, 0x61, 0x77, 0xef, 0x77, 0xee, 0x39, 0x37, 0x39, 0x64, 0x62, 0x78, + 0xae, 0x0b, 0x2e, 0x56, 0x5c, 0x6d, 0x58, 0x98, 0xd9, 0xd2, 0xf2, 0x67, 0x85, 0x15, 0x5b, 0x58, + 0x25, 0x97, 0x90, 0x21, 0x2f, 0x33, 0x63, 0xb5, 0xd1, 0x8e, 0xe7, 0xa9, 0xb1, 0x1a, 0x75, 0x3c, + 0x38, 0x71, 0xa5, 0x61, 0x4e, 0x8f, 0xae, 0xc1, 0x85, 0xd0, 0xae, 0xd0, 0x2e, 0xf3, 0x97, 0x2c, + 0x2c, 0xc1, 0x36, 0x7a, 0x8f, 0x48, 0xff, 0x11, 0x70, 0xea, 0x73, 0xe7, 0xbc, 0x7c, 0x38, 0xa6, + 0xc6, 0x7d, 0xd2, 0x46, 0x85, 0x39, 0x24, 0xd1, 0x30, 0x1a, 0x77, 0x66, 0x61, 0x89, 0x87, 0xe4, + 0x4c, 0x82, 0x13, 0x56, 0x19, 0x54, 0x7a, 0x93, 0xfc, 0xf3, 0xda, 0x29, 0x8a, 0x47, 0xa4, 0x65, + 0x39, 0x42, 0xd2, 0xfc, 0x95, 0xa6, 0xdd, 0xcf, 0xb7, 0x6b, 0x72, 0x7c, 0x78, 0x07, 0x62, 0xe6, + 0xb5, 0xf8, 0x92, 0xf4, 0xa0, 0x14, 0xf9, 0x56, 0x82, 0xcc, 0x50, 0xaf, 0x61, 0xe3, 0x92, 0xd6, + 0xb0, 0x39, 0xee, 0xcc, 0xba, 0x35, 0x9e, 0x7b, 0x1a, 0x5f, 0x91, 0x73, 0x28, 0xa1, 0x30, 0x98, + 0x71, 0x29, 0x2d, 0x38, 0x07, 0x2e, 0x69, 0xfb, 0xcb, 0x5e, 0xe0, 0xb7, 0x35, 0x9e, 0xde, 0x7f, + 0xec, 0x69, 0xb4, 0xdb, 0xd3, 0xe8, 0x7b, 0x4f, 0xa3, 0xd7, 0x03, 0x6d, 0xec, 0x0e, 0xb4, 0xf1, + 0x75, 0xa0, 0x8d, 0xa7, 0xc9, 0x52, 0xe1, 0x6a, 0xbb, 0x48, 0x85, 0x2e, 0xd8, 0x1f, 0xd5, 0x96, + 0xcc, 0xad, 0xab, 0x17, 0x5e, 0x31, 0xac, 0x0c, 0xb8, 0xba, 0xe9, 0xc5, 0x7f, 0xdf, 0xcf, 0xcd, + 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc6, 0xc6, 0x11, 0x2b, 0x8e, 0x01, 0x00, 0x00, +} + +func (m *SetBridgeTaxProposal) 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 *SetBridgeTaxProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetBridgeTaxProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExemptAddresses) > 0 { + for iNdEx := len(m.ExemptAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExemptAddresses[iNdEx]) + copy(dAtA[i:], m.ExemptAddresses[iNdEx]) + i = encodeVarintBridgeTaxProposal(dAtA, i, uint64(len(m.ExemptAddresses[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.ExcludedTokens) > 0 { + for iNdEx := len(m.ExcludedTokens) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExcludedTokens[iNdEx]) + copy(dAtA[i:], m.ExcludedTokens[iNdEx]) + i = encodeVarintBridgeTaxProposal(dAtA, i, uint64(len(m.ExcludedTokens[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Rate) > 0 { + i -= len(m.Rate) + copy(dAtA[i:], m.Rate) + i = encodeVarintBridgeTaxProposal(dAtA, i, uint64(len(m.Rate))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBridgeTaxProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintBridgeTaxProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBridgeTaxProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovBridgeTaxProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SetBridgeTaxProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovBridgeTaxProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBridgeTaxProposal(uint64(l)) + } + l = len(m.Rate) + if l > 0 { + n += 1 + l + sovBridgeTaxProposal(uint64(l)) + } + if len(m.ExcludedTokens) > 0 { + for _, s := range m.ExcludedTokens { + l = len(s) + n += 1 + l + sovBridgeTaxProposal(uint64(l)) + } + } + if len(m.ExemptAddresses) > 0 { + for _, s := range m.ExemptAddresses { + l = len(s) + n += 1 + l + sovBridgeTaxProposal(uint64(l)) + } + } + return n +} + +func sovBridgeTaxProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBridgeTaxProposal(x uint64) (n int) { + return sovBridgeTaxProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SetBridgeTaxProposal) 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 ErrIntOverflowBridgeTaxProposal + } + 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: SetBridgeTaxProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetBridgeTaxProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTaxProposal + } + 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 ErrInvalidLengthBridgeTaxProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTaxProposal + } + 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 ErrInvalidLengthBridgeTaxProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTaxProposal + } + 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 ErrInvalidLengthBridgeTaxProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExcludedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTaxProposal + } + 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 ErrInvalidLengthBridgeTaxProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExcludedTokens = append(m.ExcludedTokens, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExemptAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTaxProposal + } + 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 ErrInvalidLengthBridgeTaxProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExemptAddresses = append(m.ExemptAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBridgeTaxProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBridgeTaxProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBridgeTaxProposal(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, ErrIntOverflowBridgeTaxProposal + } + 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, ErrIntOverflowBridgeTaxProposal + } + 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, ErrIntOverflowBridgeTaxProposal + } + 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, ErrInvalidLengthBridgeTaxProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBridgeTaxProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBridgeTaxProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBridgeTaxProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBridgeTaxProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBridgeTaxProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/skyway/types/gravity/bridge_transfer_limit_proposal.pb.go b/x/skyway/types/gravity/bridge_transfer_limit_proposal.pb.go new file mode 100644 index 00000000..2dab83e0 --- /dev/null +++ b/x/skyway/types/gravity/bridge_transfer_limit_proposal.pb.go @@ -0,0 +1,608 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: palomachain/paloma/gravity/bridge_transfer_limit_proposal.proto + +package gravity + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "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 + +type LimitPeriod int32 + +const ( + LimitPeriod_NONE LimitPeriod = 0 + LimitPeriod_DAILY LimitPeriod = 1 + LimitPeriod_WEEKLY LimitPeriod = 2 + LimitPeriod_MONTHLY LimitPeriod = 3 + LimitPeriod_YEARLY LimitPeriod = 4 +) + +var LimitPeriod_name = map[int32]string{ + 0: "NONE", + 1: "DAILY", + 2: "WEEKLY", + 3: "MONTHLY", + 4: "YEARLY", +} + +var LimitPeriod_value = map[string]int32{ + "NONE": 0, + "DAILY": 1, + "WEEKLY": 2, + "MONTHLY": 3, + "YEARLY": 4, +} + +func (x LimitPeriod) String() string { + return proto.EnumName(LimitPeriod_name, int32(x)) +} + +func (LimitPeriod) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_decc4855205ef000, []int{0} +} + +type SetBridgeTransferLimitProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Limit cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=limit,proto3,customtype=cosmossdk.io/math.Int" json:"limit"` + LimitPeriod LimitPeriod `protobuf:"varint,5,opt,name=limit_period,json=limitPeriod,proto3,enum=palomachain.paloma.gravity.LimitPeriod" json:"limit_period,omitempty"` + ExemptAddresses []string `protobuf:"bytes,6,rep,name=exempt_addresses,json=exemptAddresses,proto3" json:"exempt_addresses,omitempty"` +} + +func (m *SetBridgeTransferLimitProposal) Reset() { *m = SetBridgeTransferLimitProposal{} } +func (m *SetBridgeTransferLimitProposal) String() string { return proto.CompactTextString(m) } +func (*SetBridgeTransferLimitProposal) ProtoMessage() {} +func (*SetBridgeTransferLimitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_decc4855205ef000, []int{0} +} +func (m *SetBridgeTransferLimitProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetBridgeTransferLimitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetBridgeTransferLimitProposal.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 *SetBridgeTransferLimitProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetBridgeTransferLimitProposal.Merge(m, src) +} +func (m *SetBridgeTransferLimitProposal) XXX_Size() int { + return m.Size() +} +func (m *SetBridgeTransferLimitProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SetBridgeTransferLimitProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SetBridgeTransferLimitProposal proto.InternalMessageInfo + +func (m *SetBridgeTransferLimitProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *SetBridgeTransferLimitProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *SetBridgeTransferLimitProposal) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SetBridgeTransferLimitProposal) GetLimitPeriod() LimitPeriod { + if m != nil { + return m.LimitPeriod + } + return LimitPeriod_NONE +} + +func (m *SetBridgeTransferLimitProposal) GetExemptAddresses() []string { + if m != nil { + return m.ExemptAddresses + } + return nil +} + +func init() { + proto.RegisterEnum("palomachain.paloma.gravity.LimitPeriod", LimitPeriod_name, LimitPeriod_value) + proto.RegisterType((*SetBridgeTransferLimitProposal)(nil), "palomachain.paloma.gravity.SetBridgeTransferLimitProposal") +} + +func init() { + proto.RegisterFile("palomachain/paloma/gravity/bridge_transfer_limit_proposal.proto", fileDescriptor_decc4855205ef000) +} + +var fileDescriptor_decc4855205ef000 = []byte{ + // 403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4f, 0x8b, 0xd3, 0x40, + 0x18, 0xc6, 0x93, 0xb6, 0xa9, 0x76, 0x22, 0x1a, 0x86, 0x15, 0xc2, 0x82, 0xd9, 0xe0, 0xc5, 0xea, + 0x61, 0x06, 0x5c, 0xef, 0xd2, 0x62, 0xd0, 0xd5, 0x98, 0x95, 0xb8, 0x20, 0xf1, 0x12, 0xa6, 0xc9, + 0x98, 0x0e, 0x4d, 0x32, 0x61, 0x66, 0xd4, 0xe6, 0x5b, 0x78, 0xf6, 0x13, 0xf5, 0xd8, 0xa3, 0x78, + 0x28, 0xd2, 0x7e, 0x11, 0xc9, 0x9f, 0x62, 0x0f, 0xee, 0xed, 0x7d, 0x9f, 0xf7, 0x7d, 0x7e, 0xcc, + 0xc3, 0x3b, 0xe0, 0x65, 0x45, 0x72, 0x5e, 0x90, 0x64, 0x49, 0x58, 0x89, 0xbb, 0x1a, 0x67, 0x82, + 0x7c, 0x63, 0xaa, 0xc6, 0x0b, 0xc1, 0xd2, 0x8c, 0xc6, 0x4a, 0x90, 0x52, 0x7e, 0xa1, 0x22, 0xce, + 0x59, 0xc1, 0x54, 0x5c, 0x09, 0x5e, 0x71, 0x49, 0x72, 0x54, 0x09, 0xae, 0x38, 0x3c, 0x3f, 0x01, + 0xa0, 0xae, 0x46, 0x3d, 0xe0, 0xfc, 0x2c, 0xe3, 0x19, 0x6f, 0xd7, 0x70, 0x53, 0x75, 0x8e, 0xc7, + 0x3f, 0x07, 0xc0, 0xf9, 0x48, 0xd5, 0xbc, 0xa5, 0xdf, 0xf4, 0x70, 0xbf, 0x61, 0x7f, 0xe8, 0xd1, + 0xf0, 0x0c, 0x18, 0x8a, 0xa9, 0x9c, 0xda, 0xba, 0xab, 0x4f, 0x27, 0x61, 0xd7, 0x40, 0x17, 0x98, + 0x29, 0x95, 0x89, 0x60, 0x95, 0x62, 0xbc, 0xb4, 0x07, 0xed, 0xec, 0x54, 0x6a, 0x7d, 0x7c, 0x45, + 0x4b, 0x7b, 0xd8, 0xfb, 0x9a, 0x06, 0x5e, 0x02, 0xa3, 0x7d, 0xba, 0x3d, 0x6a, 0xd4, 0xf9, 0xa3, + 0xcd, 0xee, 0x42, 0xfb, 0xbd, 0xbb, 0x78, 0x98, 0x70, 0x59, 0x70, 0x29, 0xd3, 0x15, 0x62, 0x1c, + 0x17, 0x44, 0x2d, 0xd1, 0x55, 0xa9, 0xc2, 0x6e, 0x17, 0xbe, 0x05, 0xf7, 0xfa, 0xbc, 0x54, 0x30, + 0x9e, 0xda, 0x86, 0xab, 0x4f, 0xef, 0x3f, 0x7f, 0x82, 0x6e, 0x8f, 0x8b, 0xba, 0x0c, 0xed, 0x7a, + 0x68, 0xe6, 0xff, 0x1a, 0xf8, 0x14, 0x58, 0x74, 0x4d, 0x8b, 0x4a, 0xc5, 0x24, 0x4d, 0x05, 0x95, + 0x92, 0x4a, 0x7b, 0xec, 0x0e, 0xa7, 0x93, 0xf0, 0x41, 0xa7, 0xcf, 0x8e, 0xf2, 0xb3, 0xd7, 0xc0, + 0x3c, 0xc1, 0xc0, 0xbb, 0x60, 0x14, 0x5c, 0x07, 0x9e, 0xa5, 0xc1, 0x09, 0x30, 0x5e, 0xcd, 0xae, + 0xfc, 0xc8, 0xd2, 0x21, 0x00, 0xe3, 0x4f, 0x9e, 0xf7, 0xce, 0x8f, 0xac, 0x01, 0x34, 0xc1, 0x9d, + 0xf7, 0xd7, 0xc1, 0xcd, 0x1b, 0x3f, 0xb2, 0x86, 0xcd, 0x20, 0xf2, 0x66, 0xa1, 0x1f, 0x59, 0xa3, + 0x79, 0xb0, 0xd9, 0x3b, 0xfa, 0x76, 0xef, 0xe8, 0x7f, 0xf6, 0x8e, 0xfe, 0xe3, 0xe0, 0x68, 0xdb, + 0x83, 0xa3, 0xfd, 0x3a, 0x38, 0xda, 0xe7, 0x17, 0x19, 0x53, 0xcb, 0xaf, 0x0b, 0x94, 0xf0, 0x02, + 0xff, 0xe7, 0xfa, 0x6b, 0x2c, 0x57, 0xf5, 0x77, 0x52, 0x63, 0x55, 0x57, 0x54, 0x1e, 0x3f, 0xc3, + 0x62, 0xdc, 0x1e, 0xef, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x3a, 0x32, 0x17, 0x31, + 0x02, 0x00, 0x00, +} + +func (m *SetBridgeTransferLimitProposal) 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 *SetBridgeTransferLimitProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetBridgeTransferLimitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExemptAddresses) > 0 { + for iNdEx := len(m.ExemptAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExemptAddresses[iNdEx]) + copy(dAtA[i:], m.ExemptAddresses[iNdEx]) + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(len(m.ExemptAddresses[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.LimitPeriod != 0 { + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(m.LimitPeriod)) + i-- + dAtA[i] = 0x28 + } + { + size := m.Limit.Size() + i -= size + if _, err := m.Limit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintBridgeTransferLimitProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBridgeTransferLimitProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovBridgeTransferLimitProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SetBridgeTransferLimitProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovBridgeTransferLimitProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBridgeTransferLimitProposal(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovBridgeTransferLimitProposal(uint64(l)) + } + l = m.Limit.Size() + n += 1 + l + sovBridgeTransferLimitProposal(uint64(l)) + if m.LimitPeriod != 0 { + n += 1 + sovBridgeTransferLimitProposal(uint64(m.LimitPeriod)) + } + if len(m.ExemptAddresses) > 0 { + for _, s := range m.ExemptAddresses { + l = len(s) + n += 1 + l + sovBridgeTransferLimitProposal(uint64(l)) + } + } + return n +} + +func sovBridgeTransferLimitProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBridgeTransferLimitProposal(x uint64) (n int) { + return sovBridgeTransferLimitProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SetBridgeTransferLimitProposal) 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 ErrIntOverflowBridgeTransferLimitProposal + } + 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: SetBridgeTransferLimitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetBridgeTransferLimitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + 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 ErrInvalidLengthBridgeTransferLimitProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + 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 ErrInvalidLengthBridgeTransferLimitProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + 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 ErrInvalidLengthBridgeTransferLimitProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + 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 ErrInvalidLengthBridgeTransferLimitProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Limit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitPeriod", wireType) + } + m.LimitPeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitPeriod |= LimitPeriod(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExemptAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBridgeTransferLimitProposal + } + 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 ErrInvalidLengthBridgeTransferLimitProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExemptAddresses = append(m.ExemptAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBridgeTransferLimitProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBridgeTransferLimitProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBridgeTransferLimitProposal(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, ErrIntOverflowBridgeTransferLimitProposal + } + 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, ErrIntOverflowBridgeTransferLimitProposal + } + 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, ErrIntOverflowBridgeTransferLimitProposal + } + 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, ErrInvalidLengthBridgeTransferLimitProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBridgeTransferLimitProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBridgeTransferLimitProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBridgeTransferLimitProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBridgeTransferLimitProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBridgeTransferLimitProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/skyway/types/gravity/erc20_to_denom_proposal.pb.go b/x/skyway/types/gravity/erc20_to_denom_proposal.pb.go new file mode 100644 index 00000000..4f8f161e --- /dev/null +++ b/x/skyway/types/gravity/erc20_to_denom_proposal.pb.go @@ -0,0 +1,529 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: palomachain/paloma/gravity/erc20_to_denom_proposal.proto + +package gravity + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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 + +type SetERC20ToDenomProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainReferenceId string `protobuf:"bytes,3,opt,name=chain_reference_id,json=chainReferenceId,proto3" json:"chain_reference_id,omitempty"` + Erc20 string `protobuf:"bytes,4,opt,name=erc20,proto3" json:"erc20,omitempty"` + Denom string `protobuf:"bytes,5,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *SetERC20ToDenomProposal) Reset() { *m = SetERC20ToDenomProposal{} } +func (m *SetERC20ToDenomProposal) String() string { return proto.CompactTextString(m) } +func (*SetERC20ToDenomProposal) ProtoMessage() {} +func (*SetERC20ToDenomProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_aedb9a8b0e7c953e, []int{0} +} +func (m *SetERC20ToDenomProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetERC20ToDenomProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetERC20ToDenomProposal.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 *SetERC20ToDenomProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetERC20ToDenomProposal.Merge(m, src) +} +func (m *SetERC20ToDenomProposal) XXX_Size() int { + return m.Size() +} +func (m *SetERC20ToDenomProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SetERC20ToDenomProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SetERC20ToDenomProposal proto.InternalMessageInfo + +func (m *SetERC20ToDenomProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *SetERC20ToDenomProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *SetERC20ToDenomProposal) GetChainReferenceId() string { + if m != nil { + return m.ChainReferenceId + } + return "" +} + +func (m *SetERC20ToDenomProposal) GetErc20() string { + if m != nil { + return m.Erc20 + } + return "" +} + +func (m *SetERC20ToDenomProposal) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func init() { + proto.RegisterType((*SetERC20ToDenomProposal)(nil), "palomachain.paloma.gravity.SetERC20ToDenomProposal") +} + +func init() { + proto.RegisterFile("palomachain/paloma/gravity/erc20_to_denom_proposal.proto", fileDescriptor_aedb9a8b0e7c953e) +} + +var fileDescriptor_aedb9a8b0e7c953e = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x50, 0xbb, 0x4e, 0xc3, 0x30, + 0x14, 0x8d, 0x81, 0x22, 0x11, 0x16, 0x14, 0x21, 0x11, 0x3a, 0x58, 0x15, 0x13, 0x03, 0x8a, 0xab, + 0xc2, 0xc0, 0xcc, 0x63, 0x60, 0x41, 0x28, 0x30, 0xb1, 0x58, 0xae, 0x63, 0x5a, 0x8b, 0x24, 0xd7, + 0xb2, 0xcd, 0x23, 0x7f, 0xc1, 0x7f, 0xf0, 0x23, 0x8c, 0x1d, 0x19, 0x51, 0xf2, 0x23, 0x28, 0xd7, + 0xad, 0xd4, 0xa1, 0xdb, 0x3d, 0xe7, 0xdc, 0x73, 0x1f, 0x27, 0xbe, 0x34, 0xa2, 0x84, 0x4a, 0xc8, + 0xb9, 0xd0, 0x35, 0x0b, 0x35, 0x9b, 0x59, 0xf1, 0xae, 0x7d, 0xc3, 0x94, 0x95, 0x93, 0x31, 0xf7, + 0xc0, 0x0b, 0x55, 0x43, 0xc5, 0x8d, 0x05, 0x03, 0x4e, 0x94, 0x99, 0xb1, 0xe0, 0x21, 0x19, 0xae, + 0x39, 0xb3, 0x50, 0x67, 0x4b, 0xe7, 0xf0, 0x58, 0x82, 0xab, 0xc0, 0x71, 0xec, 0x64, 0x01, 0x04, + 0xdb, 0xc9, 0x37, 0x89, 0x8f, 0x1e, 0x95, 0xbf, 0xcd, 0xaf, 0x27, 0xe3, 0x27, 0xb8, 0xe9, 0x27, + 0x3f, 0x2c, 0x07, 0x27, 0x87, 0xf1, 0xc0, 0x6b, 0x5f, 0xaa, 0x94, 0x8c, 0xc8, 0xe9, 0x5e, 0x1e, + 0x40, 0x32, 0x8a, 0xf7, 0x0b, 0xe5, 0xa4, 0xd5, 0xc6, 0x6b, 0xa8, 0xd3, 0x2d, 0xd4, 0xd6, 0xa9, + 0xe4, 0x2c, 0x4e, 0xf0, 0x0c, 0x6e, 0xd5, 0x8b, 0xb2, 0xaa, 0x96, 0x8a, 0xeb, 0x22, 0xdd, 0xc6, + 0xc6, 0x03, 0x54, 0xf2, 0x95, 0x70, 0x57, 0xf4, 0x5b, 0xf0, 0xb3, 0x74, 0x27, 0x6c, 0x41, 0xd0, + 0xb3, 0xf8, 0x66, 0x3a, 0x08, 0x2c, 0x82, 0xab, 0xfb, 0x9f, 0x96, 0x92, 0x45, 0x4b, 0xc9, 0x5f, + 0x4b, 0xc9, 0x57, 0x47, 0xa3, 0x45, 0x47, 0xa3, 0xdf, 0x8e, 0x46, 0xcf, 0x17, 0x33, 0xed, 0xe7, + 0x6f, 0xd3, 0x4c, 0x42, 0xc5, 0x36, 0x64, 0xf8, 0xc9, 0xdc, 0x6b, 0xf3, 0x21, 0x1a, 0xe6, 0x1b, + 0xa3, 0xdc, 0x2a, 0xd2, 0xe9, 0x2e, 0x86, 0x70, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x79, + 0x41, 0x36, 0x77, 0x01, 0x00, 0x00, +} + +func (m *SetERC20ToDenomProposal) 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 *SetERC20ToDenomProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SetERC20ToDenomProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintErc20ToDenomProposal(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x2a + } + if len(m.Erc20) > 0 { + i -= len(m.Erc20) + copy(dAtA[i:], m.Erc20) + i = encodeVarintErc20ToDenomProposal(dAtA, i, uint64(len(m.Erc20))) + i-- + dAtA[i] = 0x22 + } + if len(m.ChainReferenceId) > 0 { + i -= len(m.ChainReferenceId) + copy(dAtA[i:], m.ChainReferenceId) + i = encodeVarintErc20ToDenomProposal(dAtA, i, uint64(len(m.ChainReferenceId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintErc20ToDenomProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintErc20ToDenomProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintErc20ToDenomProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovErc20ToDenomProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SetERC20ToDenomProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovErc20ToDenomProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErc20ToDenomProposal(uint64(l)) + } + l = len(m.ChainReferenceId) + if l > 0 { + n += 1 + l + sovErc20ToDenomProposal(uint64(l)) + } + l = len(m.Erc20) + if l > 0 { + n += 1 + l + sovErc20ToDenomProposal(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovErc20ToDenomProposal(uint64(l)) + } + return n +} + +func sovErc20ToDenomProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozErc20ToDenomProposal(x uint64) (n int) { + return sovErc20ToDenomProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SetERC20ToDenomProposal) 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 ErrIntOverflowErc20ToDenomProposal + } + 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: SetERC20ToDenomProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetERC20ToDenomProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErc20ToDenomProposal + } + 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 ErrInvalidLengthErc20ToDenomProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErc20ToDenomProposal + } + 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 ErrInvalidLengthErc20ToDenomProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainReferenceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErc20ToDenomProposal + } + 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 ErrInvalidLengthErc20ToDenomProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainReferenceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Erc20", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErc20ToDenomProposal + } + 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 ErrInvalidLengthErc20ToDenomProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Erc20 = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErc20ToDenomProposal + } + 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 ErrInvalidLengthErc20ToDenomProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErc20ToDenomProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthErc20ToDenomProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipErc20ToDenomProposal(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, ErrIntOverflowErc20ToDenomProposal + } + 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, ErrIntOverflowErc20ToDenomProposal + } + 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, ErrIntOverflowErc20ToDenomProposal + } + 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, ErrInvalidLengthErc20ToDenomProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupErc20ToDenomProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthErc20ToDenomProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthErc20ToDenomProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowErc20ToDenomProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupErc20ToDenomProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/skyway/types/gravity/governance_proposals.go b/x/skyway/types/gravity/governance_proposals.go new file mode 100644 index 00000000..746177b4 --- /dev/null +++ b/x/skyway/types/gravity/governance_proposals.go @@ -0,0 +1,44 @@ +package gravity + +import ( + govv1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +const ( + RouterKey = "gravity" + ProposalTypeSetERC20ToDenomProposal = "SetERC20ToDenomProposal" + ProposalTypeSetBridgeTaxProposal = "SetBridgeTaxProposal" + ProposalTypeSetBridgeTransferLimitProposal = "SetBridgeTransferLimitProposal" +) + +var ( + _ govv1beta1types.Content = &SetERC20ToDenomProposal{} + _ govv1beta1types.Content = &SetBridgeTaxProposal{} + _ govv1beta1types.Content = &SetBridgeTransferLimitProposal{} +) + +func (p *SetERC20ToDenomProposal) ProposalRoute() string { return RouterKey } +func (p *SetERC20ToDenomProposal) ProposalType() string { return ProposalTypeSetERC20ToDenomProposal } +func (p *SetERC20ToDenomProposal) ValidateBasic() error { + if err := govv1beta1types.ValidateAbstract(p); err != nil { + return err + } + + return nil +} + +func (p *SetBridgeTaxProposal) ProposalRoute() string { return RouterKey } +func (p *SetBridgeTaxProposal) ProposalType() string { return ProposalTypeSetBridgeTaxProposal } +func (p *SetBridgeTaxProposal) ValidateBasic() error { + return govv1beta1types.ValidateAbstract(p) +} + +func (p *SetBridgeTransferLimitProposal) ProposalRoute() string { return RouterKey } + +func (p *SetBridgeTransferLimitProposal) ProposalType() string { + return ProposalTypeSetBridgeTransferLimitProposal +} + +func (p *SetBridgeTransferLimitProposal) ValidateBasic() error { + return govv1beta1types.ValidateAbstract(p) +}