fix: update account table interface to use address, chain and network

This commit is contained in:
Prad Nukala
2024-09-27 21:15:20 -04:00
parent d06dfb5a93
commit 06daff4b33
4 changed files with 100 additions and 84 deletions
+29 -28
View File
@@ -77,7 +77,7 @@ func (m *Balance) GetAmount() uint64 {
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"`
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,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"`
}
@@ -122,9 +122,9 @@ func (m *Account) GetId() uint64 {
return 0
}
func (m *Account) GetAccount() string {
func (m *Account) GetAddress() string {
if m != nil {
return m.Account
return m.Address
}
return ""
}
@@ -151,24 +151,25 @@ func init() {
func init() { proto.RegisterFile("oracle/v1/state.proto", fileDescriptor_8840885873256d8c) }
var fileDescriptor_8840885873256d8c = []byte{
// 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, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0xe2, 0x84, 0x08, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17,
0xeb, 0xe7, 0x17, 0xe5, 0x82, 0x54, 0xe5, 0x17, 0xe5, 0x42, 0xd4, 0x28, 0xc5, 0x70, 0xb1, 0x3b,
0x25, 0xe6, 0x24, 0xe6, 0x25, 0xa7, 0x0a, 0x49, 0x70, 0xb1, 0x27, 0x26, 0x27, 0xe7, 0x97, 0xe6,
0x95, 0x48, 0x30, 0x2a, 0x30, 0x6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xfd, 0x67,
// 291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xc1, 0x4a, 0x03, 0x31,
0x10, 0x86, 0x9b, 0xed, 0xda, 0xd2, 0x1c, 0x44, 0x82, 0xd5, 0xa8, 0x10, 0x4b, 0xa1, 0x50, 0xb0,
0x6c, 0x28, 0xde, 0x7a, 0x11, 0xfb, 0x08, 0x7b, 0x14, 0x2f, 0x69, 0x36, 0xd8, 0xc5, 0x6e, 0xa6,
0x24, 0x69, 0xd5, 0x97, 0x90, 0x3e, 0x81, 0xcf, 0xe3, 0xb1, 0xe0, 0xc5, 0xa3, 0xec, 0xbe, 0x81,
0x4f, 0x20, 0x9b, 0x4d, 0xbd, 0x0c, 0xfc, 0x33, 0xdf, 0xfc, 0xff, 0x30, 0xb8, 0x0f, 0x46, 0xc8,
0x95, 0xe2, 0xdb, 0x29, 0xb7, 0x4e, 0x38, 0x95, 0xac, 0x0d, 0x38, 0x20, 0xbd, 0xa6, 0x9d, 0x6c,
0xa7, 0x97, 0xe7, 0x12, 0x6c, 0x01, 0x96, 0x83, 0x29, 0x6a, 0x0a, 0x4c, 0xd1, 0x30, 0xc3, 0x47,
0xdc, 0x9d, 0x8b, 0x95, 0xd0, 0x52, 0x11, 0x8a, 0xbb, 0x42, 0x4a, 0xd8, 0x68, 0x47, 0xd1, 0x00,
0x8d, 0x7b, 0xe9, 0x41, 0x92, 0x33, 0xdc, 0x11, 0x85, 0x1f, 0x44, 0x03, 0x34, 0x8e, 0xd3, 0xa0,
0x66, 0xd7, 0xbf, 0x1f, 0x5f, 0xef, 0xed, 0x0b, 0xdc, 0xfb, 0xdf, 0x24, 0xf8, 0x80, 0x9e, 0x20,
0x8a, 0x86, 0x3b, 0x84, 0xbb, 0xf7, 0x61, 0x72, 0x8c, 0xa3, 0x3c, 0xf3, 0xce, 0x71, 0x1a, 0xe5,
0x99, 0x8f, 0xcb, 0x32, 0xa3, 0xac, 0xf5, 0xae, 0x75, 0x5c, 0x23, 0xc9, 0x29, 0x3e, 0x92, 0x4b,
0x91, 0x6b, 0xda, 0xf6, 0xfd, 0x46, 0xd4, 0xbc, 0x56, 0xee, 0x05, 0xcc, 0x33, 0x8d, 0x1b, 0x3e,
0xc8, 0xd9, 0x8d, 0x3f, 0x63, 0x84, 0xe3, 0x3a, 0x81, 0x5c, 0xe1, 0x7e, 0x30, 0x9a, 0xf8, 0xc5,
0x49, 0xc0, 0xea, 0x83, 0x68, 0x34, 0xbf, 0xfb, 0x2c, 0x19, 0xda, 0x97, 0x0c, 0xfd, 0x94, 0x0c,
0xed, 0x2a, 0xd6, 0xda, 0x57, 0xac, 0xf5, 0x5d, 0xb1, 0xd6, 0xc3, 0xe8, 0x29, 0x77, 0xcb, 0xcd,
0x22, 0x91, 0x50, 0x70, 0xd0, 0x16, 0xb4, 0xe1, 0xbe, 0xbc, 0xf2, 0xf0, 0x5e, 0xf7, 0xb6, 0x56,
0x76, 0xd1, 0xf1, 0x8f, 0xbb, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x85, 0x67, 0x6c, 0x75,
0x01, 0x00, 0x00,
}
@@ -241,10 +242,10 @@ func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) {
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)))
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintState(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0x12
}
@@ -292,7 +293,7 @@ func (m *Account) Size() (n int) {
if m.Id != 0 {
n += 1 + sovState(uint64(m.Id))
}
l = len(m.Account)
l = len(m.Address)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
@@ -464,7 +465,7 @@ func (m *Account) Unmarshal(dAtA []byte) error {
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -492,7 +493,7 @@ func (m *Account) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Account = string(dAtA[iNdEx:postIndex])
m.Address = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {