From ce1e06aa0a03d2570970e9a88b67d5af922cefc8 Mon Sep 17 00:00:00 2001 From: alidevjimmy Date: Fri, 22 Nov 2024 19:53:26 +0330 Subject: [PATCH 1/5] fix jrpc and grpc doc lint --- www/grpc/buf/grpc-md.tmpl | 4 +- www/grpc/buf/json-rpc-md.tmpl | 4 +- www/grpc/gen/docs/grpc.md | 4 +- www/grpc/gen/docs/json-rpc.md | 4 +- www/grpc/gen/go/blockchain.pb.go | 620 ++++---------------- www/grpc/gen/go/blockchain_grpc.pb.go | 25 +- www/grpc/gen/go/network.pb.go | 180 ++---- www/grpc/gen/go/network_grpc.pb.go | 25 +- www/grpc/gen/go/transaction.pb.go | 378 +++---------- www/grpc/gen/go/transaction_grpc.pb.go | 25 +- www/grpc/gen/go/utils.pb.go | 180 ++---- www/grpc/gen/go/utils_grpc.pb.go | 25 +- www/grpc/gen/go/wallet.pb.go | 752 +++++-------------------- www/grpc/gen/go/wallet_grpc.pb.go | 25 +- 14 files changed, 487 insertions(+), 1764 deletions(-) diff --git a/www/grpc/buf/grpc-md.tmpl b/www/grpc/buf/grpc-md.tmpl index f8db08e84..51600f200 100644 --- a/www/grpc/buf/grpc-md.tmpl +++ b/www/grpc/buf/grpc-md.tmpl @@ -3,7 +3,9 @@ title: GRPC API Reference weight: 1 --- -Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. +Each node in the Pactus network +can be configured to use the +[gRPC](https://grpc.io/) protocol for communication. Here you can find the list of all gRPC methods and messages. All the amounts and values in gRPC endpoints are in NanoPAC units, which are atomic and the smallest unit in the Pactus blockchain. diff --git a/www/grpc/buf/json-rpc-md.tmpl b/www/grpc/buf/json-rpc-md.tmpl index 2446bb5d8..ecca37541 100644 --- a/www/grpc/buf/json-rpc-md.tmpl +++ b/www/grpc/buf/json-rpc-md.tmpl @@ -3,7 +3,9 @@ title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured to use the [JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. +Each node in the Pactus network can be configured +to use the [JSON-RPC](https://www.jsonrpc.org/specification) +protocol for communication. Here, you can find the list of all JSON-RPC methods and messages. All the amounts and values in JSON-RPC endpoints are in NanoPAC units, diff --git a/www/grpc/gen/docs/grpc.md b/www/grpc/gen/docs/grpc.md index 5509d5ce4..f980093c6 100644 --- a/www/grpc/gen/docs/grpc.md +++ b/www/grpc/gen/docs/grpc.md @@ -3,7 +3,9 @@ title: GRPC API Reference weight: 1 --- -Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. +Each node in the Pactus network +can be configured to use the +[gRPC](https://grpc.io/) protocol for communication. Here you can find the list of all gRPC methods and messages. All the amounts and values in gRPC endpoints are in NanoPAC units, which are atomic and the smallest unit in the Pactus blockchain. diff --git a/www/grpc/gen/docs/json-rpc.md b/www/grpc/gen/docs/json-rpc.md index cab178293..9493f092f 100644 --- a/www/grpc/gen/docs/json-rpc.md +++ b/www/grpc/gen/docs/json-rpc.md @@ -3,7 +3,9 @@ title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured to use the [JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. +Each node in the Pactus network can be configured +to use the [JSON-RPC](https://www.jsonrpc.org/specification) +protocol for communication. Here, you can find the list of all JSON-RPC methods and messages. All the amounts and values in JSON-RPC endpoints are in NanoPAC units, diff --git a/www/grpc/gen/go/blockchain.pb.go b/www/grpc/gen/go/blockchain.pb.go index 327e05d5b..a751b96f2 100644 --- a/www/grpc/gen/go/blockchain.pb.go +++ b/www/grpc/gen/go/blockchain.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: blockchain.proto @@ -142,11 +142,9 @@ type GetAccountRequest struct { func (x *GetAccountRequest) Reset() { *x = GetAccountRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAccountRequest) String() string { @@ -157,7 +155,7 @@ func (*GetAccountRequest) ProtoMessage() {} func (x *GetAccountRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -191,11 +189,9 @@ type GetAccountResponse struct { func (x *GetAccountResponse) Reset() { *x = GetAccountResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAccountResponse) String() string { @@ -206,7 +202,7 @@ func (*GetAccountResponse) ProtoMessage() {} func (x *GetAccountResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -237,11 +233,9 @@ type GetValidatorAddressesRequest struct { func (x *GetValidatorAddressesRequest) Reset() { *x = GetValidatorAddressesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorAddressesRequest) String() string { @@ -252,7 +246,7 @@ func (*GetValidatorAddressesRequest) ProtoMessage() {} func (x *GetValidatorAddressesRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -279,11 +273,9 @@ type GetValidatorAddressesResponse struct { func (x *GetValidatorAddressesResponse) Reset() { *x = GetValidatorAddressesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorAddressesResponse) String() string { @@ -294,7 +286,7 @@ func (*GetValidatorAddressesResponse) ProtoMessage() {} func (x *GetValidatorAddressesResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -328,11 +320,9 @@ type GetValidatorRequest struct { func (x *GetValidatorRequest) Reset() { *x = GetValidatorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorRequest) String() string { @@ -343,7 +333,7 @@ func (*GetValidatorRequest) ProtoMessage() {} func (x *GetValidatorRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -377,11 +367,9 @@ type GetValidatorByNumberRequest struct { func (x *GetValidatorByNumberRequest) Reset() { *x = GetValidatorByNumberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorByNumberRequest) String() string { @@ -392,7 +380,7 @@ func (*GetValidatorByNumberRequest) ProtoMessage() {} func (x *GetValidatorByNumberRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -426,11 +414,9 @@ type GetValidatorResponse struct { func (x *GetValidatorResponse) Reset() { *x = GetValidatorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorResponse) String() string { @@ -441,7 +427,7 @@ func (*GetValidatorResponse) ProtoMessage() {} func (x *GetValidatorResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -475,11 +461,9 @@ type GetPublicKeyRequest struct { func (x *GetPublicKeyRequest) Reset() { *x = GetPublicKeyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetPublicKeyRequest) String() string { @@ -490,7 +474,7 @@ func (*GetPublicKeyRequest) ProtoMessage() {} func (x *GetPublicKeyRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -524,11 +508,9 @@ type GetPublicKeyResponse struct { func (x *GetPublicKeyResponse) Reset() { *x = GetPublicKeyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetPublicKeyResponse) String() string { @@ -539,7 +521,7 @@ func (*GetPublicKeyResponse) ProtoMessage() {} func (x *GetPublicKeyResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -575,11 +557,9 @@ type GetBlockRequest struct { func (x *GetBlockRequest) Reset() { *x = GetBlockRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockRequest) String() string { @@ -590,7 +570,7 @@ func (*GetBlockRequest) ProtoMessage() {} func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -644,11 +624,9 @@ type GetBlockResponse struct { func (x *GetBlockResponse) Reset() { *x = GetBlockResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockResponse) String() string { @@ -659,7 +637,7 @@ func (*GetBlockResponse) ProtoMessage() {} func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -735,11 +713,9 @@ type GetBlockHashRequest struct { func (x *GetBlockHashRequest) Reset() { *x = GetBlockHashRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockHashRequest) String() string { @@ -750,7 +726,7 @@ func (*GetBlockHashRequest) ProtoMessage() {} func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -784,11 +760,9 @@ type GetBlockHashResponse struct { func (x *GetBlockHashResponse) Reset() { *x = GetBlockHashResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockHashResponse) String() string { @@ -799,7 +773,7 @@ func (*GetBlockHashResponse) ProtoMessage() {} func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -833,11 +807,9 @@ type GetBlockHeightRequest struct { func (x *GetBlockHeightRequest) Reset() { *x = GetBlockHeightRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockHeightRequest) String() string { @@ -848,7 +820,7 @@ func (*GetBlockHeightRequest) ProtoMessage() {} func (x *GetBlockHeightRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -882,11 +854,9 @@ type GetBlockHeightResponse struct { func (x *GetBlockHeightResponse) Reset() { *x = GetBlockHeightResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockHeightResponse) String() string { @@ -897,7 +867,7 @@ func (*GetBlockHeightResponse) ProtoMessage() {} func (x *GetBlockHeightResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -928,11 +898,9 @@ type GetBlockchainInfoRequest struct { func (x *GetBlockchainInfoRequest) Reset() { *x = GetBlockchainInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockchainInfoRequest) String() string { @@ -943,7 +911,7 @@ func (*GetBlockchainInfoRequest) ProtoMessage() {} func (x *GetBlockchainInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -988,11 +956,9 @@ type GetBlockchainInfoResponse struct { func (x *GetBlockchainInfoResponse) Reset() { *x = GetBlockchainInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetBlockchainInfoResponse) String() string { @@ -1003,7 +969,7 @@ func (*GetBlockchainInfoResponse) ProtoMessage() {} func (x *GetBlockchainInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1097,11 +1063,9 @@ type GetConsensusInfoRequest struct { func (x *GetConsensusInfoRequest) Reset() { *x = GetConsensusInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetConsensusInfoRequest) String() string { @@ -1112,7 +1076,7 @@ func (*GetConsensusInfoRequest) ProtoMessage() {} func (x *GetConsensusInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1141,11 +1105,9 @@ type GetConsensusInfoResponse struct { func (x *GetConsensusInfoResponse) Reset() { *x = GetConsensusInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetConsensusInfoResponse) String() string { @@ -1156,7 +1118,7 @@ func (*GetConsensusInfoResponse) ProtoMessage() {} func (x *GetConsensusInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1198,11 +1160,9 @@ type GetTxPoolContentRequest struct { func (x *GetTxPoolContentRequest) Reset() { *x = GetTxPoolContentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTxPoolContentRequest) String() string { @@ -1213,7 +1173,7 @@ func (*GetTxPoolContentRequest) ProtoMessage() {} func (x *GetTxPoolContentRequest) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1247,11 +1207,9 @@ type GetTxPoolContentResponse struct { func (x *GetTxPoolContentResponse) Reset() { *x = GetTxPoolContentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTxPoolContentResponse) String() string { @@ -1262,7 +1220,7 @@ func (*GetTxPoolContentResponse) ProtoMessage() {} func (x *GetTxPoolContentResponse) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1314,11 +1272,9 @@ type ValidatorInfo struct { func (x *ValidatorInfo) Reset() { *x = ValidatorInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ValidatorInfo) String() string { @@ -1329,7 +1285,7 @@ func (*ValidatorInfo) ProtoMessage() {} func (x *ValidatorInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1434,11 +1390,9 @@ type AccountInfo struct { func (x *AccountInfo) Reset() { *x = AccountInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AccountInfo) String() string { @@ -1449,7 +1403,7 @@ func (*AccountInfo) ProtoMessage() {} func (x *AccountInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1519,11 +1473,9 @@ type BlockHeaderInfo struct { func (x *BlockHeaderInfo) Reset() { *x = BlockHeaderInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BlockHeaderInfo) String() string { @@ -1534,7 +1486,7 @@ func (*BlockHeaderInfo) ProtoMessage() {} func (x *BlockHeaderInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1604,11 +1556,9 @@ type CertificateInfo struct { func (x *CertificateInfo) Reset() { *x = CertificateInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CertificateInfo) String() string { @@ -1619,7 +1569,7 @@ func (*CertificateInfo) ProtoMessage() {} func (x *CertificateInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1691,11 +1641,9 @@ type VoteInfo struct { func (x *VoteInfo) Reset() { *x = VoteInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VoteInfo) String() string { @@ -1706,7 +1654,7 @@ func (*VoteInfo) ProtoMessage() {} func (x *VoteInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1784,11 +1732,9 @@ type ConsensusInfo struct { func (x *ConsensusInfo) Reset() { *x = ConsensusInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConsensusInfo) String() string { @@ -1799,7 +1745,7 @@ func (*ConsensusInfo) ProtoMessage() {} func (x *ConsensusInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1867,11 +1813,9 @@ type ProposalInfo struct { func (x *ProposalInfo) Reset() { *x = ProposalInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_blockchain_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_blockchain_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProposalInfo) String() string { @@ -1882,7 +1826,7 @@ func (*ProposalInfo) ProtoMessage() {} func (x *ProposalInfo) ProtoReflect() protoreflect.Message { mi := &file_blockchain_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2298,344 +2242,6 @@ func file_blockchain_proto_init() { return } file_transaction_proto_init() - if !protoimpl.UnsafeEnabled { - file_blockchain_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetAccountRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetAccountResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorAddressesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorAddressesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorByNumberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*GetPublicKeyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*GetPublicKeyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockHashRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockHashResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockHeightRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockHeightResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockchainInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*GetBlockchainInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*GetConsensusInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*GetConsensusInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*GetTxPoolContentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*GetTxPoolContentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*ValidatorInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*AccountInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*BlockHeaderInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*CertificateInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*VoteInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*ConsensusInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_blockchain_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*ProposalInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/www/grpc/gen/go/blockchain_grpc.pb.go b/www/grpc/gen/go/blockchain_grpc.pb.go index 115ac61a4..e78ae8cba 100644 --- a/www/grpc/gen/go/blockchain_grpc.pb.go +++ b/www/grpc/gen/go/blockchain_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: blockchain.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Blockchain_GetBlock_FullMethodName = "/pactus.Blockchain/GetBlock" @@ -187,7 +187,7 @@ func (c *blockchainClient) GetTxPoolContent(ctx context.Context, in *GetTxPoolCo // BlockchainServer is the server API for Blockchain service. // All implementations should embed UnimplementedBlockchainServer -// for forward compatibility +// for forward compatibility. // // Blockchain service defines RPC methods for interacting with the blockchain. type BlockchainServer interface { @@ -220,9 +220,12 @@ type BlockchainServer interface { GetTxPoolContent(context.Context, *GetTxPoolContentRequest) (*GetTxPoolContentResponse, error) } -// UnimplementedBlockchainServer should be embedded to have forward compatible implementations. -type UnimplementedBlockchainServer struct { -} +// UnimplementedBlockchainServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlockchainServer struct{} func (UnimplementedBlockchainServer) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") @@ -257,6 +260,7 @@ func (UnimplementedBlockchainServer) GetPublicKey(context.Context, *GetPublicKey func (UnimplementedBlockchainServer) GetTxPoolContent(context.Context, *GetTxPoolContentRequest) (*GetTxPoolContentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTxPoolContent not implemented") } +func (UnimplementedBlockchainServer) testEmbeddedByValue() {} // UnsafeBlockchainServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to BlockchainServer will @@ -266,6 +270,13 @@ type UnsafeBlockchainServer interface { } func RegisterBlockchainServer(s grpc.ServiceRegistrar, srv BlockchainServer) { + // If the following call pancis, it indicates UnimplementedBlockchainServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Blockchain_ServiceDesc, srv) } diff --git a/www/grpc/gen/go/network.pb.go b/www/grpc/gen/go/network.pb.go index b6f471294..dcbb39f24 100644 --- a/www/grpc/gen/go/network.pb.go +++ b/www/grpc/gen/go/network.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: network.proto @@ -32,11 +32,9 @@ type GetNetworkInfoRequest struct { func (x *GetNetworkInfoRequest) Reset() { *x = GetNetworkInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNetworkInfoRequest) String() string { @@ -47,7 +45,7 @@ func (*GetNetworkInfoRequest) ProtoMessage() {} func (x *GetNetworkInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -87,11 +85,9 @@ type GetNetworkInfoResponse struct { func (x *GetNetworkInfoResponse) Reset() { *x = GetNetworkInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNetworkInfoResponse) String() string { @@ -102,7 +98,7 @@ func (*GetNetworkInfoResponse) ProtoMessage() {} func (x *GetNetworkInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -154,11 +150,9 @@ type GetNodeInfoRequest struct { func (x *GetNodeInfoRequest) Reset() { *x = GetNodeInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeInfoRequest) String() string { @@ -169,7 +163,7 @@ func (*GetNodeInfoRequest) ProtoMessage() {} func (x *GetNodeInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -216,11 +210,9 @@ type GetNodeInfoResponse struct { func (x *GetNodeInfoResponse) Reset() { *x = GetNodeInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNodeInfoResponse) String() string { @@ -231,7 +223,7 @@ func (*GetNodeInfoResponse) ProtoMessage() {} func (x *GetNodeInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -367,11 +359,9 @@ type PeerInfo struct { func (x *PeerInfo) Reset() { *x = PeerInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PeerInfo) String() string { @@ -382,7 +372,7 @@ func (*PeerInfo) ProtoMessage() {} func (x *PeerInfo) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -532,11 +522,9 @@ type ConnectionInfo struct { func (x *ConnectionInfo) Reset() { *x = ConnectionInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConnectionInfo) String() string { @@ -547,7 +535,7 @@ func (*ConnectionInfo) ProtoMessage() {} func (x *ConnectionInfo) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -603,11 +591,9 @@ type MetricInfo struct { func (x *MetricInfo) Reset() { *x = MetricInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MetricInfo) String() string { @@ -618,7 +604,7 @@ func (*MetricInfo) ProtoMessage() {} func (x *MetricInfo) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -682,11 +668,9 @@ type CounterInfo struct { func (x *CounterInfo) Reset() { *x = CounterInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_network_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_network_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CounterInfo) String() string { @@ -697,7 +681,7 @@ func (*CounterInfo) ProtoMessage() {} func (x *CounterInfo) ProtoReflect() protoreflect.Message { mi := &file_network_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -927,104 +911,6 @@ func file_network_proto_init() { if File_network_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_network_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetNetworkInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetNetworkInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetNodeInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*PeerInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*ConnectionInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*MetricInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_network_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*CounterInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/www/grpc/gen/go/network_grpc.pb.go b/www/grpc/gen/go/network_grpc.pb.go index 19900a7dd..51cba8b78 100644 --- a/www/grpc/gen/go/network_grpc.pb.go +++ b/www/grpc/gen/go/network_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: network.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Network_GetNetworkInfo_FullMethodName = "/pactus.Network/GetNetworkInfo" @@ -65,7 +65,7 @@ func (c *networkClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, // NetworkServer is the server API for Network service. // All implementations should embed UnimplementedNetworkServer -// for forward compatibility +// for forward compatibility. // // Network service provides RPCs for retrieving information about the network. type NetworkServer interface { @@ -75,9 +75,12 @@ type NetworkServer interface { GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) } -// UnimplementedNetworkServer should be embedded to have forward compatible implementations. -type UnimplementedNetworkServer struct { -} +// UnimplementedNetworkServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNetworkServer struct{} func (UnimplementedNetworkServer) GetNetworkInfo(context.Context, *GetNetworkInfoRequest) (*GetNetworkInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNetworkInfo not implemented") @@ -85,6 +88,7 @@ func (UnimplementedNetworkServer) GetNetworkInfo(context.Context, *GetNetworkInf func (UnimplementedNetworkServer) GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") } +func (UnimplementedNetworkServer) testEmbeddedByValue() {} // UnsafeNetworkServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NetworkServer will @@ -94,6 +98,13 @@ type UnsafeNetworkServer interface { } func RegisterNetworkServer(s grpc.ServiceRegistrar, srv NetworkServer) { + // If the following call pancis, it indicates UnimplementedNetworkServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Network_ServiceDesc, srv) } diff --git a/www/grpc/gen/go/transaction.pb.go b/www/grpc/gen/go/transaction.pb.go index 34e0717c3..a7105f43f 100644 --- a/www/grpc/gen/go/transaction.pb.go +++ b/www/grpc/gen/go/transaction.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: transaction.proto @@ -148,11 +148,9 @@ type GetTransactionRequest struct { func (x *GetTransactionRequest) Reset() { *x = GetTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTransactionRequest) String() string { @@ -163,7 +161,7 @@ func (*GetTransactionRequest) ProtoMessage() {} func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -208,11 +206,9 @@ type GetTransactionResponse struct { func (x *GetTransactionResponse) Reset() { *x = GetTransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTransactionResponse) String() string { @@ -223,7 +219,7 @@ func (*GetTransactionResponse) ProtoMessage() {} func (x *GetTransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -275,11 +271,9 @@ type CalculateFeeRequest struct { func (x *CalculateFeeRequest) Reset() { *x = CalculateFeeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CalculateFeeRequest) String() string { @@ -290,7 +284,7 @@ func (*CalculateFeeRequest) ProtoMessage() {} func (x *CalculateFeeRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -340,11 +334,9 @@ type CalculateFeeResponse struct { func (x *CalculateFeeResponse) Reset() { *x = CalculateFeeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CalculateFeeResponse) String() string { @@ -355,7 +347,7 @@ func (*CalculateFeeResponse) ProtoMessage() {} func (x *CalculateFeeResponse) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -396,11 +388,9 @@ type BroadcastTransactionRequest struct { func (x *BroadcastTransactionRequest) Reset() { *x = BroadcastTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BroadcastTransactionRequest) String() string { @@ -411,7 +401,7 @@ func (*BroadcastTransactionRequest) ProtoMessage() {} func (x *BroadcastTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -445,11 +435,9 @@ type BroadcastTransactionResponse struct { func (x *BroadcastTransactionResponse) Reset() { *x = BroadcastTransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BroadcastTransactionResponse) String() string { @@ -460,7 +448,7 @@ func (*BroadcastTransactionResponse) ProtoMessage() {} func (x *BroadcastTransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -505,11 +493,9 @@ type GetRawTransferTransactionRequest struct { func (x *GetRawTransferTransactionRequest) Reset() { *x = GetRawTransferTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetRawTransferTransactionRequest) String() string { @@ -520,7 +506,7 @@ func (*GetRawTransferTransactionRequest) ProtoMessage() {} func (x *GetRawTransferTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -602,11 +588,9 @@ type GetRawBondTransactionRequest struct { func (x *GetRawBondTransactionRequest) Reset() { *x = GetRawBondTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetRawBondTransactionRequest) String() string { @@ -617,7 +601,7 @@ func (*GetRawBondTransactionRequest) ProtoMessage() {} func (x *GetRawBondTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -698,11 +682,9 @@ type GetRawUnbondTransactionRequest struct { func (x *GetRawUnbondTransactionRequest) Reset() { *x = GetRawUnbondTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetRawUnbondTransactionRequest) String() string { @@ -713,7 +695,7 @@ func (*GetRawUnbondTransactionRequest) ProtoMessage() {} func (x *GetRawUnbondTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -772,11 +754,9 @@ type GetRawWithdrawTransactionRequest struct { func (x *GetRawWithdrawTransactionRequest) Reset() { *x = GetRawWithdrawTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetRawWithdrawTransactionRequest) String() string { @@ -787,7 +767,7 @@ func (*GetRawWithdrawTransactionRequest) ProtoMessage() {} func (x *GetRawWithdrawTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -858,11 +838,9 @@ type GetRawTransactionResponse struct { func (x *GetRawTransactionResponse) Reset() { *x = GetRawTransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetRawTransactionResponse) String() string { @@ -873,7 +851,7 @@ func (*GetRawTransactionResponse) ProtoMessage() {} func (x *GetRawTransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -918,11 +896,9 @@ type PayloadTransfer struct { func (x *PayloadTransfer) Reset() { *x = PayloadTransfer{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PayloadTransfer) String() string { @@ -933,7 +909,7 @@ func (*PayloadTransfer) ProtoMessage() {} func (x *PayloadTransfer) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -987,11 +963,9 @@ type PayloadBond struct { func (x *PayloadBond) Reset() { *x = PayloadBond{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PayloadBond) String() string { @@ -1002,7 +976,7 @@ func (*PayloadBond) ProtoMessage() {} func (x *PayloadBond) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1059,11 +1033,9 @@ type PayloadSortition struct { func (x *PayloadSortition) Reset() { *x = PayloadSortition{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PayloadSortition) String() string { @@ -1074,7 +1046,7 @@ func (*PayloadSortition) ProtoMessage() {} func (x *PayloadSortition) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1115,11 +1087,9 @@ type PayloadUnbond struct { func (x *PayloadUnbond) Reset() { *x = PayloadUnbond{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PayloadUnbond) String() string { @@ -1130,7 +1100,7 @@ func (*PayloadUnbond) ProtoMessage() {} func (x *PayloadUnbond) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1168,11 +1138,9 @@ type PayloadWithdraw struct { func (x *PayloadWithdraw) Reset() { *x = PayloadWithdraw{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PayloadWithdraw) String() string { @@ -1183,7 +1151,7 @@ func (*PayloadWithdraw) ProtoMessage() {} func (x *PayloadWithdraw) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1257,11 +1225,9 @@ type TransactionInfo struct { func (x *TransactionInfo) Reset() { *x = TransactionInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactionInfo) String() string { @@ -1272,7 +1238,7 @@ func (*TransactionInfo) ProtoMessage() {} func (x *TransactionInfo) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1728,212 +1694,6 @@ func file_transaction_proto_init() { if File_transaction_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_transaction_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetTransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*CalculateFeeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*CalculateFeeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*BroadcastTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*BroadcastTransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*GetRawTransferTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*GetRawBondTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*GetRawUnbondTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*GetRawWithdrawTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*GetRawTransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*PayloadTransfer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*PayloadBond); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*PayloadSortition); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*PayloadUnbond); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*PayloadWithdraw); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*TransactionInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_transaction_proto_msgTypes[16].OneofWrappers = []any{ (*TransactionInfo_Transfer)(nil), (*TransactionInfo_Bond)(nil), diff --git a/www/grpc/gen/go/transaction_grpc.pb.go b/www/grpc/gen/go/transaction_grpc.pb.go index a561a93da..aa41869d6 100644 --- a/www/grpc/gen/go/transaction_grpc.pb.go +++ b/www/grpc/gen/go/transaction_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: transaction.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Transaction_GetTransaction_FullMethodName = "/pactus.Transaction/GetTransaction" @@ -133,7 +133,7 @@ func (c *transactionClient) GetRawWithdrawTransaction(ctx context.Context, in *G // TransactionServer is the server API for Transaction service. // All implementations should embed UnimplementedTransactionServer -// for forward compatibility +// for forward compatibility. // // Transaction service defines various RPC methods for interacting with // transactions. @@ -156,9 +156,12 @@ type TransactionServer interface { GetRawWithdrawTransaction(context.Context, *GetRawWithdrawTransactionRequest) (*GetRawTransactionResponse, error) } -// UnimplementedTransactionServer should be embedded to have forward compatible implementations. -type UnimplementedTransactionServer struct { -} +// UnimplementedTransactionServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTransactionServer struct{} func (UnimplementedTransactionServer) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTransaction not implemented") @@ -181,6 +184,7 @@ func (UnimplementedTransactionServer) GetRawUnbondTransaction(context.Context, * func (UnimplementedTransactionServer) GetRawWithdrawTransaction(context.Context, *GetRawWithdrawTransactionRequest) (*GetRawTransactionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRawWithdrawTransaction not implemented") } +func (UnimplementedTransactionServer) testEmbeddedByValue() {} // UnsafeTransactionServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TransactionServer will @@ -190,6 +194,13 @@ type UnsafeTransactionServer interface { } func RegisterTransactionServer(s grpc.ServiceRegistrar, srv TransactionServer) { + // If the following call pancis, it indicates UnimplementedTransactionServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Transaction_ServiceDesc, srv) } diff --git a/www/grpc/gen/go/utils.pb.go b/www/grpc/gen/go/utils.pb.go index 83ae6de4c..1e818ca3d 100644 --- a/www/grpc/gen/go/utils.pb.go +++ b/www/grpc/gen/go/utils.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: utils.proto @@ -34,11 +34,9 @@ type SignMessageWithPrivateKeyRequest struct { func (x *SignMessageWithPrivateKeyRequest) Reset() { *x = SignMessageWithPrivateKeyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignMessageWithPrivateKeyRequest) String() string { @@ -49,7 +47,7 @@ func (*SignMessageWithPrivateKeyRequest) ProtoMessage() {} func (x *SignMessageWithPrivateKeyRequest) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -90,11 +88,9 @@ type SignMessageWithPrivateKeyResponse struct { func (x *SignMessageWithPrivateKeyResponse) Reset() { *x = SignMessageWithPrivateKeyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignMessageWithPrivateKeyResponse) String() string { @@ -105,7 +101,7 @@ func (*SignMessageWithPrivateKeyResponse) ProtoMessage() {} func (x *SignMessageWithPrivateKeyResponse) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -143,11 +139,9 @@ type VerifyMessageRequest struct { func (x *VerifyMessageRequest) Reset() { *x = VerifyMessageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VerifyMessageRequest) String() string { @@ -158,7 +152,7 @@ func (*VerifyMessageRequest) ProtoMessage() {} func (x *VerifyMessageRequest) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -206,11 +200,9 @@ type VerifyMessageResponse struct { func (x *VerifyMessageResponse) Reset() { *x = VerifyMessageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VerifyMessageResponse) String() string { @@ -221,7 +213,7 @@ func (*VerifyMessageResponse) ProtoMessage() {} func (x *VerifyMessageResponse) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -255,11 +247,9 @@ type BLSPublicKeyAggregationRequest struct { func (x *BLSPublicKeyAggregationRequest) Reset() { *x = BLSPublicKeyAggregationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BLSPublicKeyAggregationRequest) String() string { @@ -270,7 +260,7 @@ func (*BLSPublicKeyAggregationRequest) ProtoMessage() {} func (x *BLSPublicKeyAggregationRequest) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -304,11 +294,9 @@ type BLSPublicKeyAggregationResponse struct { func (x *BLSPublicKeyAggregationResponse) Reset() { *x = BLSPublicKeyAggregationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BLSPublicKeyAggregationResponse) String() string { @@ -319,7 +307,7 @@ func (*BLSPublicKeyAggregationResponse) ProtoMessage() {} func (x *BLSPublicKeyAggregationResponse) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -353,11 +341,9 @@ type BLSSignatureAggregationRequest struct { func (x *BLSSignatureAggregationRequest) Reset() { *x = BLSSignatureAggregationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BLSSignatureAggregationRequest) String() string { @@ -368,7 +354,7 @@ func (*BLSSignatureAggregationRequest) ProtoMessage() {} func (x *BLSSignatureAggregationRequest) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -402,11 +388,9 @@ type BLSSignatureAggregationResponse struct { func (x *BLSSignatureAggregationResponse) Reset() { *x = BLSSignatureAggregationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_utils_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_utils_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BLSSignatureAggregationResponse) String() string { @@ -417,7 +401,7 @@ func (*BLSSignatureAggregationResponse) ProtoMessage() {} func (x *BLSSignatureAggregationResponse) ProtoReflect() protoreflect.Message { mi := &file_utils_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -557,104 +541,6 @@ func file_utils_proto_init() { if File_utils_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_utils_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*SignMessageWithPrivateKeyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*SignMessageWithPrivateKeyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*VerifyMessageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*VerifyMessageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*BLSPublicKeyAggregationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*BLSPublicKeyAggregationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*BLSSignatureAggregationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_utils_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*BLSSignatureAggregationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/www/grpc/gen/go/utils_grpc.pb.go b/www/grpc/gen/go/utils_grpc.pb.go index c5b424dd3..210089263 100644 --- a/www/grpc/gen/go/utils_grpc.pb.go +++ b/www/grpc/gen/go/utils_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: utils.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Utils_SignMessageWithPrivateKey_FullMethodName = "/pactus.Utils/SignMessageWithPrivateKey" @@ -92,7 +92,7 @@ func (c *utilsClient) BLSSignatureAggregation(ctx context.Context, in *BLSSignat // UtilsServer is the server API for Utils service. // All implementations should embed UnimplementedUtilsServer -// for forward compatibility +// for forward compatibility. // // Utils service defines RPC methods for utility functions such as message // signing and verification. @@ -107,9 +107,12 @@ type UtilsServer interface { BLSSignatureAggregation(context.Context, *BLSSignatureAggregationRequest) (*BLSSignatureAggregationResponse, error) } -// UnimplementedUtilsServer should be embedded to have forward compatible implementations. -type UnimplementedUtilsServer struct { -} +// UnimplementedUtilsServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedUtilsServer struct{} func (UnimplementedUtilsServer) SignMessageWithPrivateKey(context.Context, *SignMessageWithPrivateKeyRequest) (*SignMessageWithPrivateKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignMessageWithPrivateKey not implemented") @@ -123,6 +126,7 @@ func (UnimplementedUtilsServer) BLSPublicKeyAggregation(context.Context, *BLSPub func (UnimplementedUtilsServer) BLSSignatureAggregation(context.Context, *BLSSignatureAggregationRequest) (*BLSSignatureAggregationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BLSSignatureAggregation not implemented") } +func (UnimplementedUtilsServer) testEmbeddedByValue() {} // UnsafeUtilsServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UtilsServer will @@ -132,6 +136,13 @@ type UnsafeUtilsServer interface { } func RegisterUtilsServer(s grpc.ServiceRegistrar, srv UtilsServer) { + // If the following call pancis, it indicates UnimplementedUtilsServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Utils_ServiceDesc, srv) } diff --git a/www/grpc/gen/go/wallet.pb.go b/www/grpc/gen/go/wallet.pb.go index 73e974b69..0256b85d5 100644 --- a/www/grpc/gen/go/wallet.pb.go +++ b/www/grpc/gen/go/wallet.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: wallet.proto @@ -99,11 +99,9 @@ type AddressInfo struct { func (x *AddressInfo) Reset() { *x = AddressInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AddressInfo) String() string { @@ -114,7 +112,7 @@ func (*AddressInfo) ProtoMessage() {} func (x *AddressInfo) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -177,11 +175,9 @@ type HistoryInfo struct { func (x *HistoryInfo) Reset() { *x = HistoryInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *HistoryInfo) String() string { @@ -192,7 +188,7 @@ func (*HistoryInfo) ProtoMessage() {} func (x *HistoryInfo) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -256,11 +252,9 @@ type GetAddressHistoryRequest struct { func (x *GetAddressHistoryRequest) Reset() { *x = GetAddressHistoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAddressHistoryRequest) String() string { @@ -271,7 +265,7 @@ func (*GetAddressHistoryRequest) ProtoMessage() {} func (x *GetAddressHistoryRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -312,11 +306,9 @@ type GetAddressHistoryResponse struct { func (x *GetAddressHistoryResponse) Reset() { *x = GetAddressHistoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAddressHistoryResponse) String() string { @@ -327,7 +319,7 @@ func (*GetAddressHistoryResponse) ProtoMessage() {} func (x *GetAddressHistoryResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -367,11 +359,9 @@ type GetNewAddressRequest struct { func (x *GetNewAddressRequest) Reset() { *x = GetNewAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNewAddressRequest) String() string { @@ -382,7 +372,7 @@ func (*GetNewAddressRequest) ProtoMessage() {} func (x *GetNewAddressRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -439,11 +429,9 @@ type GetNewAddressResponse struct { func (x *GetNewAddressResponse) Reset() { *x = GetNewAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetNewAddressResponse) String() string { @@ -454,7 +442,7 @@ func (*GetNewAddressResponse) ProtoMessage() {} func (x *GetNewAddressResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -499,11 +487,9 @@ type RestoreWalletRequest struct { func (x *RestoreWalletRequest) Reset() { *x = RestoreWalletRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RestoreWalletRequest) String() string { @@ -514,7 +500,7 @@ func (*RestoreWalletRequest) ProtoMessage() {} func (x *RestoreWalletRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -562,11 +548,9 @@ type RestoreWalletResponse struct { func (x *RestoreWalletResponse) Reset() { *x = RestoreWalletResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RestoreWalletResponse) String() string { @@ -577,7 +561,7 @@ func (*RestoreWalletResponse) ProtoMessage() {} func (x *RestoreWalletResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -613,11 +597,9 @@ type CreateWalletRequest struct { func (x *CreateWalletRequest) Reset() { *x = CreateWalletRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateWalletRequest) String() string { @@ -628,7 +610,7 @@ func (*CreateWalletRequest) ProtoMessage() {} func (x *CreateWalletRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -669,11 +651,9 @@ type CreateWalletResponse struct { func (x *CreateWalletResponse) Reset() { *x = CreateWalletResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CreateWalletResponse) String() string { @@ -684,7 +664,7 @@ func (*CreateWalletResponse) ProtoMessage() {} func (x *CreateWalletResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -718,11 +698,9 @@ type LoadWalletRequest struct { func (x *LoadWalletRequest) Reset() { *x = LoadWalletRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LoadWalletRequest) String() string { @@ -733,7 +711,7 @@ func (*LoadWalletRequest) ProtoMessage() {} func (x *LoadWalletRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -767,11 +745,9 @@ type LoadWalletResponse struct { func (x *LoadWalletResponse) Reset() { *x = LoadWalletResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LoadWalletResponse) String() string { @@ -782,7 +758,7 @@ func (*LoadWalletResponse) ProtoMessage() {} func (x *LoadWalletResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -816,11 +792,9 @@ type UnloadWalletRequest struct { func (x *UnloadWalletRequest) Reset() { *x = UnloadWalletRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnloadWalletRequest) String() string { @@ -831,7 +805,7 @@ func (*UnloadWalletRequest) ProtoMessage() {} func (x *UnloadWalletRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -865,11 +839,9 @@ type UnloadWalletResponse struct { func (x *UnloadWalletResponse) Reset() { *x = UnloadWalletResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnloadWalletResponse) String() string { @@ -880,7 +852,7 @@ func (*UnloadWalletResponse) ProtoMessage() {} func (x *UnloadWalletResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -915,11 +887,9 @@ type GetValidatorAddressRequest struct { func (x *GetValidatorAddressRequest) Reset() { *x = GetValidatorAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorAddressRequest) String() string { @@ -930,7 +900,7 @@ func (*GetValidatorAddressRequest) ProtoMessage() {} func (x *GetValidatorAddressRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -965,11 +935,9 @@ type GetValidatorAddressResponse struct { func (x *GetValidatorAddressResponse) Reset() { *x = GetValidatorAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetValidatorAddressResponse) String() string { @@ -980,7 +948,7 @@ func (*GetValidatorAddressResponse) ProtoMessage() {} func (x *GetValidatorAddressResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1018,11 +986,9 @@ type SignRawTransactionRequest struct { func (x *SignRawTransactionRequest) Reset() { *x = SignRawTransactionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignRawTransactionRequest) String() string { @@ -1033,7 +999,7 @@ func (*SignRawTransactionRequest) ProtoMessage() {} func (x *SignRawTransactionRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1083,11 +1049,9 @@ type SignRawTransactionResponse struct { func (x *SignRawTransactionResponse) Reset() { *x = SignRawTransactionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignRawTransactionResponse) String() string { @@ -1098,7 +1062,7 @@ func (*SignRawTransactionResponse) ProtoMessage() {} func (x *SignRawTransactionResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1139,11 +1103,9 @@ type GetTotalBalanceRequest struct { func (x *GetTotalBalanceRequest) Reset() { *x = GetTotalBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTotalBalanceRequest) String() string { @@ -1154,7 +1116,7 @@ func (*GetTotalBalanceRequest) ProtoMessage() {} func (x *GetTotalBalanceRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1190,11 +1152,9 @@ type GetTotalBalanceResponse struct { func (x *GetTotalBalanceResponse) Reset() { *x = GetTotalBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTotalBalanceResponse) String() string { @@ -1205,7 +1165,7 @@ func (*GetTotalBalanceResponse) ProtoMessage() {} func (x *GetTotalBalanceResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1252,11 +1212,9 @@ type SignMessageRequest struct { func (x *SignMessageRequest) Reset() { *x = SignMessageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignMessageRequest) String() string { @@ -1267,7 +1225,7 @@ func (*SignMessageRequest) ProtoMessage() {} func (x *SignMessageRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1322,11 +1280,9 @@ type SignMessageResponse struct { func (x *SignMessageResponse) Reset() { *x = SignMessageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SignMessageResponse) String() string { @@ -1337,7 +1293,7 @@ func (*SignMessageResponse) ProtoMessage() {} func (x *SignMessageResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1371,11 +1327,9 @@ type GetTotalStakeRequest struct { func (x *GetTotalStakeRequest) Reset() { *x = GetTotalStakeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTotalStakeRequest) String() string { @@ -1386,7 +1340,7 @@ func (*GetTotalStakeRequest) ProtoMessage() {} func (x *GetTotalStakeRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1420,11 +1374,9 @@ type GetTotalStakeResponse struct { func (x *GetTotalStakeResponse) Reset() { *x = GetTotalStakeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetTotalStakeResponse) String() string { @@ -1435,7 +1387,7 @@ func (*GetTotalStakeResponse) ProtoMessage() {} func (x *GetTotalStakeResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1477,11 +1429,9 @@ type GetAddressInfoRequest struct { func (x *GetAddressInfoRequest) Reset() { *x = GetAddressInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAddressInfoRequest) String() string { @@ -1492,7 +1442,7 @@ func (*GetAddressInfoRequest) ProtoMessage() {} func (x *GetAddressInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1536,11 +1486,9 @@ type GetAddressInfoResponse struct { func (x *GetAddressInfoResponse) Reset() { *x = GetAddressInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetAddressInfoResponse) String() string { @@ -1551,7 +1499,7 @@ func (*GetAddressInfoResponse) ProtoMessage() {} func (x *GetAddressInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1617,11 +1565,9 @@ type SetLabelRequest struct { func (x *SetLabelRequest) Reset() { *x = SetLabelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetLabelRequest) String() string { @@ -1632,7 +1578,7 @@ func (*SetLabelRequest) ProtoMessage() {} func (x *SetLabelRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1684,11 +1630,9 @@ type SetLabelResponse struct { func (x *SetLabelResponse) Reset() { *x = SetLabelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SetLabelResponse) String() string { @@ -1699,7 +1643,7 @@ func (*SetLabelResponse) ProtoMessage() {} func (x *SetLabelResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1722,11 +1666,9 @@ type ListWalletRequest struct { func (x *ListWalletRequest) Reset() { *x = ListWalletRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListWalletRequest) String() string { @@ -1737,7 +1679,7 @@ func (*ListWalletRequest) ProtoMessage() {} func (x *ListWalletRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1763,11 +1705,9 @@ type ListWalletResponse struct { func (x *ListWalletResponse) Reset() { *x = ListWalletResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListWalletResponse) String() string { @@ -1778,7 +1718,7 @@ func (*ListWalletResponse) ProtoMessage() {} func (x *ListWalletResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1811,11 +1751,9 @@ type GetWalletInfoRequest struct { func (x *GetWalletInfoRequest) Reset() { *x = GetWalletInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetWalletInfoRequest) String() string { @@ -1826,7 +1764,7 @@ func (*GetWalletInfoRequest) ProtoMessage() {} func (x *GetWalletInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1864,11 +1802,9 @@ type GetWalletInfoResponse struct { func (x *GetWalletInfoResponse) Reset() { *x = GetWalletInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetWalletInfoResponse) String() string { @@ -1879,7 +1815,7 @@ func (*GetWalletInfoResponse) ProtoMessage() {} func (x *GetWalletInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1947,11 +1883,9 @@ type ListAddressRequest struct { func (x *ListAddressRequest) Reset() { *x = ListAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListAddressRequest) String() string { @@ -1962,7 +1896,7 @@ func (*ListAddressRequest) ProtoMessage() {} func (x *ListAddressRequest) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1995,11 +1929,9 @@ type ListAddressResponse struct { func (x *ListAddressResponse) Reset() { *x = ListAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_wallet_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_wallet_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListAddressResponse) String() string { @@ -2010,7 +1942,7 @@ func (*ListAddressResponse) ProtoMessage() {} func (x *ListAddressResponse) ProtoReflect() protoreflect.Message { mi := &file_wallet_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2418,416 +2350,6 @@ func file_wallet_proto_init() { return } file_transaction_proto_init() - if !protoimpl.UnsafeEnabled { - file_wallet_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*AddressInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*HistoryInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetAddressHistoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetAddressHistoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetNewAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetNewAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*RestoreWalletRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*RestoreWalletResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*CreateWalletRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*CreateWalletResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*LoadWalletRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*LoadWalletResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*UnloadWalletRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*UnloadWalletResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*GetValidatorAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*SignRawTransactionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*SignRawTransactionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*GetTotalBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*GetTotalBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*SignMessageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*SignMessageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*GetTotalStakeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*GetTotalStakeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*GetAddressInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*GetAddressInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*SetLabelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*SetLabelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*ListWalletRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*ListWalletResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*GetWalletInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*GetWalletInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*ListAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_wallet_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*ListAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/www/grpc/gen/go/wallet_grpc.pb.go b/www/grpc/gen/go/wallet_grpc.pb.go index 1398c2d9e..d20da693a 100644 --- a/www/grpc/gen/go/wallet_grpc.pb.go +++ b/www/grpc/gen/go/wallet_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: wallet.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Wallet_CreateWallet_FullMethodName = "/pactus.Wallet/CreateWallet" @@ -250,7 +250,7 @@ func (c *walletClient) ListAddress(ctx context.Context, in *ListAddressRequest, // WalletServer is the server API for Wallet service. // All implementations should embed UnimplementedWalletServer -// for forward compatibility +// for forward compatibility. // // Define the Wallet service with various RPC methods for wallet management. type WalletServer interface { @@ -289,9 +289,12 @@ type WalletServer interface { ListAddress(context.Context, *ListAddressRequest) (*ListAddressResponse, error) } -// UnimplementedWalletServer should be embedded to have forward compatible implementations. -type UnimplementedWalletServer struct { -} +// UnimplementedWalletServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWalletServer struct{} func (UnimplementedWalletServer) CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateWallet not implemented") @@ -341,6 +344,7 @@ func (UnimplementedWalletServer) GetWalletInfo(context.Context, *GetWalletInfoRe func (UnimplementedWalletServer) ListAddress(context.Context, *ListAddressRequest) (*ListAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") } +func (UnimplementedWalletServer) testEmbeddedByValue() {} // UnsafeWalletServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to WalletServer will @@ -350,6 +354,13 @@ type UnsafeWalletServer interface { } func RegisterWalletServer(s grpc.ServiceRegistrar, srv WalletServer) { + // If the following call pancis, it indicates UnimplementedWalletServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Wallet_ServiceDesc, srv) } From 7c2fcc7b8ed72a6d6d52272a415146f08daa7e1e Mon Sep 17 00:00:00 2001 From: b00f Date: Sun, 24 Nov 2024 16:51:16 +0800 Subject: [PATCH 2/5] Update grpc-md.tmpl --- www/grpc/buf/grpc-md.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/grpc/buf/grpc-md.tmpl b/www/grpc/buf/grpc-md.tmpl index 51600f200..b6d7871e8 100644 --- a/www/grpc/buf/grpc-md.tmpl +++ b/www/grpc/buf/grpc-md.tmpl @@ -3,8 +3,7 @@ title: GRPC API Reference weight: 1 --- -Each node in the Pactus network -can be configured to use the +Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. Here you can find the list of all gRPC methods and messages. From ac158c8d5ed95776d2cbe22fea8e8df55d011999 Mon Sep 17 00:00:00 2001 From: b00f Date: Sun, 24 Nov 2024 16:51:55 +0800 Subject: [PATCH 3/5] Update json-rpc-md.tmpl --- www/grpc/buf/json-rpc-md.tmpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/www/grpc/buf/json-rpc-md.tmpl b/www/grpc/buf/json-rpc-md.tmpl index ecca37541..f5c5ba617 100644 --- a/www/grpc/buf/json-rpc-md.tmpl +++ b/www/grpc/buf/json-rpc-md.tmpl @@ -3,9 +3,8 @@ title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured -to use the [JSON-RPC](https://www.jsonrpc.org/specification) -protocol for communication. +Each node in the Pactus network can be configured to use the +[JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. Here, you can find the list of all JSON-RPC methods and messages. All the amounts and values in JSON-RPC endpoints are in NanoPAC units, From 4f809782e67b85dbbd36847cde4d2f8daa435c58 Mon Sep 17 00:00:00 2001 From: b00f Date: Sun, 24 Nov 2024 16:52:20 +0800 Subject: [PATCH 4/5] Update grpc.md --- www/grpc/gen/docs/grpc.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/grpc/gen/docs/grpc.md b/www/grpc/gen/docs/grpc.md index f980093c6..67818d84b 100644 --- a/www/grpc/gen/docs/grpc.md +++ b/www/grpc/gen/docs/grpc.md @@ -3,8 +3,7 @@ title: GRPC API Reference weight: 1 --- -Each node in the Pactus network -can be configured to use the +Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. Here you can find the list of all gRPC methods and messages. From a5b4322c06bed3fdcd7cadb2956752527fb74635 Mon Sep 17 00:00:00 2001 From: b00f Date: Sun, 24 Nov 2024 16:53:18 +0800 Subject: [PATCH 5/5] Update json-rpc.md --- www/grpc/gen/docs/json-rpc.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/www/grpc/gen/docs/json-rpc.md b/www/grpc/gen/docs/json-rpc.md index 9493f092f..4f0193bf0 100644 --- a/www/grpc/gen/docs/json-rpc.md +++ b/www/grpc/gen/docs/json-rpc.md @@ -3,9 +3,8 @@ title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured -to use the [JSON-RPC](https://www.jsonrpc.org/specification) -protocol for communication. +Each node in the Pactus network can be configured to use the +[JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. Here, you can find the list of all JSON-RPC methods and messages. All the amounts and values in JSON-RPC endpoints are in NanoPAC units,