From f1ec30c3427ce506dd51457c9189cc8089f2e4e5 Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:03:00 -0500 Subject: [PATCH] Update `error_code` to be int32 instead of uint32. (#2322) Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Co-authored-by: Stephen Buttolph --- proto/p2p/p2p.proto | 4 ++-- proto/pb/p2p/p2p.pb.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proto/p2p/p2p.proto b/proto/p2p/p2p.proto index 09618923a866..9b45148e3344 100644 --- a/proto/p2p/p2p.proto +++ b/proto/p2p/p2p.proto @@ -415,8 +415,8 @@ message AppError { bytes chain_id = 1; // Request id of the original AppRequest uint32 request_id = 2; - // VM defined error code - uint32 error_code = 3; + // VM defined error code. VMs may define error codes > 0. + sint32 error_code = 3; // VM defined error message string error_message = 4; } diff --git a/proto/pb/p2p/p2p.pb.go b/proto/pb/p2p/p2p.pb.go index e2761bed03aa..8b804d1ceb02 100644 --- a/proto/pb/p2p/p2p.pb.go +++ b/proto/pb/p2p/p2p.pb.go @@ -2394,8 +2394,8 @@ type AppError struct { ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Request id of the original AppRequest RequestId uint32 `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - // VM defined error code - ErrorCode uint32 `protobuf:"varint,3,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` + // VM defined error code. VMs may define error codes > 0. + ErrorCode int32 `protobuf:"zigzag32,3,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` // VM defined error message ErrorMessage string `protobuf:"bytes,4,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` } @@ -2446,7 +2446,7 @@ func (x *AppError) GetRequestId() uint32 { return 0 } -func (x *AppError) GetErrorCode() uint32 { +func (x *AppError) GetErrorCode() int32 { if x != nil { return x.ErrorCode } @@ -2831,7 +2831,7 @@ var file_p2p_p2p_proto_rawDesc = []byte{ 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x65, + 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x43, 0x0a,