diff --git a/proto/hypergridssn/hypergridssn/hypergrid_node.proto b/proto/hypergridssn/hypergridssn/hypergrid_node.proto index 6432cfd..0cb3758 100644 --- a/proto/hypergridssn/hypergridssn/hypergrid_node.proto +++ b/proto/hypergridssn/hypergridssn/hypergrid_node.proto @@ -8,7 +8,8 @@ message HypergridNode { string name = 2; string rpc = 3; // Grid RPC int32 role = 4; // 0: unknown, 1: Solana L1, 2: SSN, 3: Grid, 4: Sonic Grid - int32 starttime = 5; - string creator = 6; + string data_account = 5; // data account for storing bill + int32 starttime = 6; + string creator = 7; } diff --git a/x/hypergridssn/keeper/msg_server_hypergrid_node.go b/x/hypergridssn/keeper/msg_server_hypergrid_node.go index e4f689b..1a8c1bf 100644 --- a/x/hypergridssn/keeper/msg_server_hypergrid_node.go +++ b/x/hypergridssn/keeper/msg_server_hypergrid_node.go @@ -23,12 +23,13 @@ func (k msgServer) CreateHypergridNode(goCtx context.Context, msg *types.MsgCrea } var hypergridNode = types.HypergridNode{ - Creator: msg.Creator, - Pubkey: msg.Pubkey, - Name: msg.Name, - Rpc: msg.Rpc, - Role: msg.Role, - Starttime: msg.Starttime, + Creator: msg.Creator, + Pubkey: msg.Pubkey, + Name: msg.Name, + Rpc: msg.Rpc, + DataAccount: msg.DataAccount, + Role: msg.Role, + Starttime: msg.Starttime, } k.SetHypergridNode( @@ -56,12 +57,13 @@ func (k msgServer) UpdateHypergridNode(goCtx context.Context, msg *types.MsgUpda } var hypergridNode = types.HypergridNode{ - Creator: msg.Creator, - Pubkey: msg.Pubkey, - Name: msg.Name, - Rpc: msg.Rpc, - Role: msg.Role, - Starttime: msg.Starttime, + Creator: msg.Creator, + Pubkey: msg.Pubkey, + Name: msg.Name, + Rpc: msg.Rpc, + DataAccount: msg.DataAccount, + Role: msg.Role, + Starttime: msg.Starttime, } k.SetHypergridNode(ctx, hypergridNode) diff --git a/x/hypergridssn/types/hypergrid_node.pb.go b/x/hypergridssn/types/hypergrid_node.pb.go index a7f91a1..6587b5c 100644 --- a/x/hypergridssn/types/hypergrid_node.pb.go +++ b/x/hypergridssn/types/hypergrid_node.pb.go @@ -23,12 +23,13 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type HypergridNode struct { - Pubkey string `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Rpc string `protobuf:"bytes,3,opt,name=rpc,proto3" json:"rpc,omitempty"` - Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"` - Starttime int32 `protobuf:"varint,5,opt,name=starttime,proto3" json:"starttime,omitempty"` - Creator string `protobuf:"bytes,6,opt,name=creator,proto3" json:"creator,omitempty"` + Pubkey string `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Rpc string `protobuf:"bytes,3,opt,name=rpc,proto3" json:"rpc,omitempty"` + Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"` + DataAccount string `protobuf:"bytes,5,opt,name=data_account,json=dataAccount,proto3" json:"data_account,omitempty"` + Starttime int32 `protobuf:"varint,6,opt,name=starttime,proto3" json:"starttime,omitempty"` + Creator string `protobuf:"bytes,7,opt,name=creator,proto3" json:"creator,omitempty"` } func (m *HypergridNode) Reset() { *m = HypergridNode{} } @@ -92,6 +93,13 @@ func (m *HypergridNode) GetRole() int32 { return 0 } +func (m *HypergridNode) GetDataAccount() string { + if m != nil { + return m.DataAccount + } + return "" +} + func (m *HypergridNode) GetStarttime() int32 { if m != nil { return m.Starttime @@ -115,21 +123,22 @@ func init() { } var fileDescriptor_57288d5cabe9c27d = []byte{ - // 214 bytes of a gzipped FileDescriptorProto + // 240 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcb, 0xa8, 0x2c, 0x48, 0x2d, 0x4a, 0x2f, 0xca, 0x4c, 0x29, 0x2e, 0xce, 0xd3, 0xc7, 0xce, 0x89, 0xcf, 0xcb, 0x4f, 0x49, - 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x44, 0x56, 0x82, 0xa2, 0x59, 0x69, 0x26, 0x23, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x44, 0x56, 0x82, 0xa2, 0x59, 0x69, 0x0f, 0x23, 0x17, 0xaf, 0x07, 0x4c, 0xc0, 0x2f, 0x3f, 0x25, 0x55, 0x48, 0x8c, 0x8b, 0xad, 0xa0, 0x34, 0x29, 0x3b, 0xb5, 0x52, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, 0x02, 0x8b, 0x82, 0xd9, 0x42, 0x02, 0x5c, 0xcc, 0x45, 0x05, 0xc9, 0x12, 0xcc, 0x60, 0x21, 0x10, 0x13, 0xa4, 0xaa, 0x28, 0x3f, 0x27, 0x55, 0x82, 0x45, 0x81, 0x51, - 0x83, 0x35, 0x08, 0xcc, 0x16, 0x92, 0xe1, 0xe2, 0x2c, 0x2e, 0x49, 0x2c, 0x2a, 0x29, 0xc9, 0xcc, - 0x4d, 0x95, 0x60, 0x05, 0x4b, 0x20, 0x04, 0x84, 0x24, 0xb8, 0xd8, 0x93, 0x8b, 0x52, 0x13, 0x4b, - 0xf2, 0x8b, 0x24, 0xd8, 0xc0, 0xe6, 0xc0, 0xb8, 0x4e, 0x36, 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, 0x04, 0xf7, 0x83, 0x2e, 0xc8, 0xd3, 0x15, 0xa8, 0x61, 0x50, 0x52, - 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xbb, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x07, 0x19, - 0x7c, 0xf4, 0x2d, 0x01, 0x00, 0x00, + 0x83, 0x35, 0x08, 0xcc, 0x16, 0x52, 0xe4, 0xe2, 0x49, 0x49, 0x2c, 0x49, 0x8c, 0x4f, 0x4c, 0x4e, + 0xce, 0x2f, 0xcd, 0x2b, 0x91, 0x60, 0x05, 0x2b, 0xe7, 0x06, 0x89, 0x39, 0x42, 0x84, 0x84, 0x64, + 0xb8, 0x38, 0x8b, 0x4b, 0x12, 0x8b, 0x4a, 0x4a, 0x32, 0x73, 0x53, 0x25, 0xd8, 0xc0, 0x7a, 0x11, + 0x02, 0x42, 0x12, 0x5c, 0xec, 0xc9, 0x45, 0xa9, 0x89, 0x25, 0xf9, 0x45, 0x12, 0xec, 0x60, 0xbd, + 0x30, 0xae, 0x93, 0xcd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x29, 0xc1, + 0xbd, 0xa9, 0x0b, 0x0a, 0x97, 0x0a, 0xd4, 0x60, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, + 0x07, 0x8f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x03, 0x52, 0x89, 0xc3, 0x50, 0x01, 0x00, 0x00, } func (m *HypergridNode) Marshal() (dAtA []byte, err error) { @@ -157,12 +166,19 @@ func (m *HypergridNode) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Creator) i = encodeVarintHypergridNode(dAtA, i, uint64(len(m.Creator))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } if m.Starttime != 0 { i = encodeVarintHypergridNode(dAtA, i, uint64(m.Starttime)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x30 + } + if len(m.DataAccount) > 0 { + i -= len(m.DataAccount) + copy(dAtA[i:], m.DataAccount) + i = encodeVarintHypergridNode(dAtA, i, uint64(len(m.DataAccount))) + i-- + dAtA[i] = 0x2a } if m.Role != 0 { i = encodeVarintHypergridNode(dAtA, i, uint64(m.Role)) @@ -225,6 +241,10 @@ func (m *HypergridNode) Size() (n int) { if m.Role != 0 { n += 1 + sovHypergridNode(uint64(m.Role)) } + l = len(m.DataAccount) + if l > 0 { + n += 1 + l + sovHypergridNode(uint64(l)) + } if m.Starttime != 0 { n += 1 + sovHypergridNode(uint64(m.Starttime)) } @@ -386,6 +406,38 @@ func (m *HypergridNode) Unmarshal(dAtA []byte) error { } } case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypergridNode + } + 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 ErrInvalidLengthHypergridNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypergridNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Starttime", wireType) } @@ -404,7 +456,7 @@ func (m *HypergridNode) Unmarshal(dAtA []byte) error { break } } - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) }