refactor: remove unused code related to whitelisted assets

This commit is contained in:
Prad Nukala
2024-09-27 20:58:05 -04:00
parent 88a3d9da1c
commit 92ff87cc2c
57 changed files with 25331 additions and 15090 deletions
+688 -37
View File
@@ -72,7 +72,7 @@ func (m *GenesisState) GetParams() Params {
// Params defines the set of module parameters.
type Params struct {
SomeValue bool `protobuf:"varint,2,opt,name=some_value,json=someValue,proto3" json:"some_value,omitempty"`
Assets *Assets `protobuf:"bytes,1,opt,name=assets,proto3" json:"assets,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
@@ -107,38 +107,181 @@ func (m *Params) XXX_DiscardUnknown() {
var xxx_messageInfo_Params proto.InternalMessageInfo
func (m *Params) GetSomeValue() bool {
func (m *Params) GetAssets() *Assets {
if m != nil {
return m.SomeValue
return m.Assets
}
return false
return nil
}
type Assets struct {
Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"`
}
func (m *Assets) Reset() { *m = Assets{} }
func (*Assets) ProtoMessage() {}
func (*Assets) Descriptor() ([]byte, []int) {
return fileDescriptor_14b982a0a6345d1d, []int{2}
}
func (m *Assets) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Assets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Assets.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 *Assets) XXX_Merge(src proto.Message) {
xxx_messageInfo_Assets.Merge(m, src)
}
func (m *Assets) XXX_Size() int {
return m.Size()
}
func (m *Assets) XXX_DiscardUnknown() {
xxx_messageInfo_Assets.DiscardUnknown(m)
}
var xxx_messageInfo_Assets proto.InternalMessageInfo
func (m *Assets) GetAssets() []*AssetInfo {
if m != nil {
return m.Assets
}
return nil
}
// AssetInfo defines the asset info
type AssetInfo struct {
// The coin type index for bip44 path
Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
// The hrp for bech32 address
Hrp string `protobuf:"bytes,2,opt,name=hrp,proto3" json:"hrp,omitempty"`
// The coin symbol
Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"`
// The coin name
AssetType string `protobuf:"bytes,4,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"`
// The name of the asset
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
// The icon url
IconUrl string `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"`
}
func (m *AssetInfo) Reset() { *m = AssetInfo{} }
func (m *AssetInfo) String() string { return proto.CompactTextString(m) }
func (*AssetInfo) ProtoMessage() {}
func (*AssetInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_14b982a0a6345d1d, []int{3}
}
func (m *AssetInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AssetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AssetInfo.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 *AssetInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_AssetInfo.Merge(m, src)
}
func (m *AssetInfo) XXX_Size() int {
return m.Size()
}
func (m *AssetInfo) XXX_DiscardUnknown() {
xxx_messageInfo_AssetInfo.DiscardUnknown(m)
}
var xxx_messageInfo_AssetInfo proto.InternalMessageInfo
func (m *AssetInfo) GetIndex() int64 {
if m != nil {
return m.Index
}
return 0
}
func (m *AssetInfo) GetHrp() string {
if m != nil {
return m.Hrp
}
return ""
}
func (m *AssetInfo) GetSymbol() string {
if m != nil {
return m.Symbol
}
return ""
}
func (m *AssetInfo) GetAssetType() string {
if m != nil {
return m.AssetType
}
return ""
}
func (m *AssetInfo) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *AssetInfo) GetIconUrl() string {
if m != nil {
return m.IconUrl
}
return ""
}
func init() {
proto.RegisterType((*GenesisState)(nil), "oracle.v1.GenesisState")
proto.RegisterType((*Params)(nil), "oracle.v1.Params")
proto.RegisterType((*Assets)(nil), "oracle.v1.Assets")
proto.RegisterType((*AssetInfo)(nil), "oracle.v1.AssetInfo")
}
func init() { proto.RegisterFile("oracle/v1/genesis.proto", fileDescriptor_14b982a0a6345d1d) }
var fileDescriptor_14b982a0a6345d1d = []byte{
// 243 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x2f, 0x4a, 0x4c,
0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28,
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x48, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7,
0x83, 0x45, 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x29, 0xc1, 0xc4, 0xdc, 0xcc, 0xbc, 0x7c, 0x7d, 0x30,
0x09, 0x11, 0x52, 0xb2, 0xe7, 0xe2, 0x71, 0x87, 0x18, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xa4,
0xcf, 0xc5, 0x56, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24,
0xa8, 0x07, 0x37, 0x54, 0x2f, 0x00, 0x2c, 0xe1, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54,
0x99, 0x92, 0x33, 0x17, 0x1b, 0x44, 0x5c, 0x48, 0x96, 0x8b, 0xab, 0x38, 0x3f, 0x37, 0x35, 0xbe,
0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x23, 0x88, 0x13, 0x24, 0x12, 0x06,
0x12, 0xb0, 0x92, 0x9a, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0xc6, 0xae, 0xe7, 0x1b, 0xb4,
0x78, 0xa1, 0x7e, 0x80, 0x18, 0xe2, 0x64, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c,
0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72,
0x0c, 0x51, 0xaa, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79,
0xc5, 0xf9, 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0x6a, 0x42, 0x49, 0x65, 0x41, 0x6a, 0x71,
0x12, 0x1b, 0xd8, 0x37, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x80, 0x35, 0x92, 0x1c,
0x01, 0x00, 0x00,
// 366 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4a, 0xeb, 0x40,
0x14, 0x86, 0x33, 0x37, 0x6d, 0xee, 0xcd, 0xf4, 0x0a, 0x76, 0x28, 0x1a, 0x0b, 0xa6, 0xa5, 0x20,
0x54, 0x91, 0x0c, 0xad, 0x3b, 0x37, 0xc5, 0x6e, 0xc4, 0x95, 0x12, 0x75, 0xe3, 0xa6, 0xa4, 0x75,
0x4c, 0x03, 0xc9, 0x4c, 0xc8, 0xa4, 0xa5, 0x7d, 0x05, 0x57, 0x2e, 0x75, 0xd7, 0x47, 0xf0, 0x31,
0xba, 0xec, 0xd2, 0x95, 0x48, 0xbb, 0xd0, 0xc7, 0x90, 0x9c, 0x09, 0x45, 0x44, 0x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 0x8e, 0xec, 0x62, 0x0c, 0xdc, 0x5e, 0x3a, 0x8d, 0x99, 0x55, 0x80, 0xcc,
0x04, 0xe7, 0x6a, 0x1a, 0x33, 0x42, 0x70, 0x81, 0x7b, 0x11, 0xb3, 0x8a, 0x10, 0x80, 0x26, 0x3b,
0xf8, 0x5f, 0x30, 0x10, 0xbc, 0x37, 0x4a, 0x42, 0xcb, 0x00, 0xff, 0x6f, 0xd6, 0x5f, 0x27, 0x61,
0xb7, 0x33, 0x5f, 0xda, 0x68, 0xb1, 0xb4, 0xd1, 0xdb, 0xd2, 0x46, 0x0f, 0x2b, 0x5b, 0x5b, 0xac,
0x6c, 0xed, 0x65, 0x65, 0x6b, 0x37, 0x7b, 0x7e, 0x90, 0x0e, 0x47, 0x7d, 0x67, 0x20, 0x22, 0x2a,
0xb8, 0x14, 0x3c, 0xa1, 0x50, 0x26, 0x34, 0xbf, 0x2e, 0xfb, 0xbe, 0xec, 0x1b, 0xf0, 0x92, 0x47,
0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xd4, 0x42, 0x19, 0x18, 0x02, 0x00, 0x00,
}
func (this *Params) Equal(that interface{}) bool {
@@ -160,11 +303,40 @@ func (this *Params) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if this.SomeValue != that1.SomeValue {
if !this.Assets.Equal(that1.Assets) {
return false
}
return true
}
func (this *Assets) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Assets)
if !ok {
that2, ok := that.(Assets)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if len(this.Assets) != len(that1.Assets) {
return false
}
for i := range this.Assets {
if !this.Assets[i].Equal(that1.Assets[i]) {
return false
}
}
return true
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -218,15 +390,117 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.SomeValue {
i--
if m.SomeValue {
dAtA[i] = 1
} else {
dAtA[i] = 0
if m.Assets != nil {
{
size, err := m.Assets.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x10
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Assets) 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 *Assets) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Assets) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Assets) > 0 {
for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *AssetInfo) 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 *AssetInfo) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.IconUrl) > 0 {
i -= len(m.IconUrl)
copy(dAtA[i:], m.IconUrl)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.IconUrl)))
i--
dAtA[i] = 0x32
}
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0x2a
}
if len(m.AssetType) > 0 {
i -= len(m.AssetType)
copy(dAtA[i:], m.AssetType)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssetType)))
i--
dAtA[i] = 0x22
}
if len(m.Symbol) > 0 {
i -= len(m.Symbol)
copy(dAtA[i:], m.Symbol)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Symbol)))
i--
dAtA[i] = 0x1a
}
if len(m.Hrp) > 0 {
i -= len(m.Hrp)
copy(dAtA[i:], m.Hrp)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Hrp)))
i--
dAtA[i] = 0x12
}
if m.Index != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.Index))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
@@ -259,8 +533,56 @@ func (m *Params) Size() (n int) {
}
var l int
_ = l
if m.SomeValue {
n += 2
if m.Assets != nil {
l = m.Assets.Size()
n += 1 + l + sovGenesis(uint64(l))
}
return n
}
func (m *Assets) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Assets) > 0 {
for _, e := range m.Assets {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func (m *AssetInfo) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Index != 0 {
n += 1 + sovGenesis(uint64(m.Index))
}
l = len(m.Hrp)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.Symbol)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.AssetType)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.Name)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.IconUrl)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
return n
}
@@ -383,11 +705,11 @@ func (m *Params) Unmarshal(dAtA []byte) error {
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field SomeValue", wireType)
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType)
}
var v int
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
@@ -397,12 +719,341 @@ func (m *Params) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.SomeValue = bool(v != 0)
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Assets == nil {
m.Assets = &Assets{}
}
if err := m.Assets.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Assets) 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 ErrIntOverflowGenesis
}
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: Assets: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Assets: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Assets", 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
}
m.Assets = append(m.Assets, &AssetInfo{})
if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AssetInfo) 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 ErrIntOverflowGenesis
}
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: AssetInfo: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AssetInfo: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
}
m.Index = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Index |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Hrp", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Hrp = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
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 ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Symbol = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AssetType", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AssetType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field IconUrl", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.IconUrl = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
+355 -45
View File
@@ -23,23 +23,23 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ExampleData struct {
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
type Balance struct {
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (m *ExampleData) Reset() { *m = ExampleData{} }
func (m *ExampleData) String() string { return proto.CompactTextString(m) }
func (*ExampleData) ProtoMessage() {}
func (*ExampleData) Descriptor() ([]byte, []int) {
func (m *Balance) Reset() { *m = Balance{} }
func (m *Balance) String() string { return proto.CompactTextString(m) }
func (*Balance) ProtoMessage() {}
func (*Balance) Descriptor() ([]byte, []int) {
return fileDescriptor_8840885873256d8c, []int{0}
}
func (m *ExampleData) XXX_Unmarshal(b []byte) error {
func (m *Balance) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ExampleData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ExampleData.Marshal(b, m, deterministic)
return xxx_messageInfo_Balance.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@@ -49,56 +49,130 @@ func (m *ExampleData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return b[:n], nil
}
}
func (m *ExampleData) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExampleData.Merge(m, src)
func (m *Balance) XXX_Merge(src proto.Message) {
xxx_messageInfo_Balance.Merge(m, src)
}
func (m *ExampleData) XXX_Size() int {
func (m *Balance) XXX_Size() int {
return m.Size()
}
func (m *ExampleData) XXX_DiscardUnknown() {
xxx_messageInfo_ExampleData.DiscardUnknown(m)
func (m *Balance) XXX_DiscardUnknown() {
xxx_messageInfo_Balance.DiscardUnknown(m)
}
var xxx_messageInfo_ExampleData proto.InternalMessageInfo
var xxx_messageInfo_Balance proto.InternalMessageInfo
func (m *ExampleData) GetAccount() []byte {
func (m *Balance) GetAccount() string {
if m != nil {
return m.Account
}
return nil
return ""
}
func (m *ExampleData) GetAmount() uint64 {
func (m *Balance) GetAmount() uint64 {
if m != nil {
return m.Amount
}
return 0
}
type Account struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
Chain string `protobuf:"bytes,3,opt,name=chain,proto3" json:"chain,omitempty"`
Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
}
func (m *Account) Reset() { *m = Account{} }
func (m *Account) String() string { return proto.CompactTextString(m) }
func (*Account) ProtoMessage() {}
func (*Account) Descriptor() ([]byte, []int) {
return fileDescriptor_8840885873256d8c, []int{1}
}
func (m *Account) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) {
xxx_messageInfo_Account.Merge(m, src)
}
func (m *Account) XXX_Size() int {
return m.Size()
}
func (m *Account) XXX_DiscardUnknown() {
xxx_messageInfo_Account.DiscardUnknown(m)
}
var xxx_messageInfo_Account proto.InternalMessageInfo
func (m *Account) GetId() uint64 {
if m != nil {
return m.Id
}
return 0
}
func (m *Account) GetAccount() string {
if m != nil {
return m.Account
}
return ""
}
func (m *Account) GetChain() string {
if m != nil {
return m.Chain
}
return ""
}
func (m *Account) GetNetwork() string {
if m != nil {
return m.Network
}
return ""
}
func init() {
proto.RegisterType((*ExampleData)(nil), "oracle.v1.ExampleData")
proto.RegisterType((*Balance)(nil), "oracle.v1.Balance")
proto.RegisterType((*Account)(nil), "oracle.v1.Account")
}
func init() { proto.RegisterFile("oracle/v1/state.proto", fileDescriptor_8840885873256d8c) }
var fileDescriptor_8840885873256d8c = []byte{
// 207 bytes of a gzipped FileDescriptorProto
// 275 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0x2f, 0x4a, 0x4c,
0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x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, 0xf3, 0x73, 0xf5, 0xf3, 0xf3,
0x8a, 0xf3, 0xf3, 0x8a, 0xf4, 0xc1, 0x44, 0x85, 0x3e, 0x34, 0x40, 0x4b, 0x2a, 0x0b, 0x52, 0x8b,
0x93, 0xd8, 0xc0, 0x41, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0x11, 0xbc, 0xfd, 0x67,
0x01, 0x00, 0x00,
}
func (m *ExampleData) Marshal() (dAtA []byte, err error) {
func (m *Balance) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -108,12 +182,12 @@ func (m *ExampleData) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *ExampleData) MarshalTo(dAtA []byte) (int, error) {
func (m *Balance) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ExampleData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@@ -133,6 +207,55 @@ func (m *ExampleData) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Network) > 0 {
i -= len(m.Network)
copy(dAtA[i:], m.Network)
i = encodeVarintState(dAtA, i, uint64(len(m.Network)))
i--
dAtA[i] = 0x22
}
if len(m.Chain) > 0 {
i -= len(m.Chain)
copy(dAtA[i:], m.Chain)
i = encodeVarintState(dAtA, i, uint64(len(m.Chain)))
i--
dAtA[i] = 0x1a
}
if len(m.Account) > 0 {
i -= len(m.Account)
copy(dAtA[i:], m.Account)
i = encodeVarintState(dAtA, i, uint64(len(m.Account)))
i--
dAtA[i] = 0x12
}
if m.Id != 0 {
i = encodeVarintState(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
offset -= sovState(v)
base := offset
@@ -144,7 +267,7 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func (m *ExampleData) Size() (n int) {
func (m *Balance) Size() (n int) {
if m == nil {
return 0
}
@@ -160,13 +283,37 @@ func (m *ExampleData) Size() (n int) {
return n
}
func (m *Account) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovState(uint64(m.Id))
}
l = len(m.Account)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Chain)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Network)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
return n
}
func sovState(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozState(x uint64) (n int) {
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ExampleData) Unmarshal(dAtA []byte) error {
func (m *Balance) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -189,17 +336,17 @@ func (m *ExampleData) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ExampleData: wiretype end group for non-group")
return fmt.Errorf("proto: Balance: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ExampleData: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
}
var byteLen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
@@ -209,25 +356,23 @@ func (m *ExampleData) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthState
}
postIndex := iNdEx + byteLen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...)
if m.Account == nil {
m.Account = []byte{}
}
m.Account = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
@@ -269,6 +414,171 @@ func (m *ExampleData) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *Account) 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 ErrIntOverflowState
}
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: Account: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Account = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Chain = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Network = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipState(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthState
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipState(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0