diff --git a/bridgectrl/pb/query.pb.go b/bridgectrl/pb/query.pb.go index 8335fd59..9d437d85 100644 --- a/bridgectrl/pb/query.pb.go +++ b/bridgectrl/pb/query.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.5 +// protoc-gen-go v1.28.1 +// protoc v5.27.1 // source: query.proto package pb @@ -3689,6 +3689,131 @@ func (x *LargeTxsResponse) GetData() []*LargeTxInfo { return nil } +type GetWstEthTokenNotWithdrawnRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetWstEthTokenNotWithdrawnRequest) Reset() { + *x = GetWstEthTokenNotWithdrawnRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_query_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWstEthTokenNotWithdrawnRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWstEthTokenNotWithdrawnRequest) ProtoMessage() {} + +func (x *GetWstEthTokenNotWithdrawnRequest) ProtoReflect() protoreflect.Message { + mi := &file_query_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetWstEthTokenNotWithdrawnRequest.ProtoReflect.Descriptor instead. +func (*GetWstEthTokenNotWithdrawnRequest) Descriptor() ([]byte, []int) { + return file_query_proto_rawDescGZIP(), []int{49} +} + +type GetWstEthTokenNotWithdrawnResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + ErrorCode string `protobuf:"bytes,3,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` + ErrorMessage string `protobuf:"bytes,4,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + DetailMsg string `protobuf:"bytes,5,opt,name=detailMsg,proto3" json:"detailMsg,omitempty"` + Data []string `protobuf:"bytes,6,rep,name=data,proto3" json:"data,omitempty"` // Big integer +} + +func (x *GetWstEthTokenNotWithdrawnResponse) Reset() { + *x = GetWstEthTokenNotWithdrawnResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_query_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWstEthTokenNotWithdrawnResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWstEthTokenNotWithdrawnResponse) ProtoMessage() {} + +func (x *GetWstEthTokenNotWithdrawnResponse) ProtoReflect() protoreflect.Message { + mi := &file_query_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetWstEthTokenNotWithdrawnResponse.ProtoReflect.Descriptor instead. +func (*GetWstEthTokenNotWithdrawnResponse) Descriptor() ([]byte, []int) { + return file_query_proto_rawDescGZIP(), []int{50} +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetErrorCode() string { + if x != nil { + return x.ErrorCode + } + return "" +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetDetailMsg() string { + if x != nil { + return x.DetailMsg + } + return "" +} + +func (x *GetWstEthTokenNotWithdrawnResponse) GetData() []string { + if x != nil { + return x.Data + } + return nil +} + var File_query_proto protoreflect.FileDescriptor var file_query_proto_rawDesc = []byte{ @@ -4141,157 +4266,182 @@ var file_query_proto_rawDesc = []byte{ 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4d, 0x73, 0x67, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x72, - 0x67, 0x65, 0x54, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x86, - 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x58, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x58, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x10, 0x01, 0x12, - 0x0e, 0x0a, 0x0a, 0x54, 0x58, 0x5f, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x19, 0x0a, 0x15, 0x54, 0x58, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x55, - 0x54, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, - 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0x5c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x4b, - 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0d, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x41, - 0x55, 0x4c, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, - 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45, 0x53, 0x53, 0x10, 0xe9, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x50, 0x5f, 0x52, 0x45, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, - 0x45, 0x44, 0x10, 0xf1, 0x07, 0x32, 0xad, 0x10, 0x0a, 0x0d, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x41, 0x50, 0x49, 0x12, 0x1a, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x50, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x41, 0x50, 0x49, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x06, 0x12, 0x04, 0x2f, 0x61, 0x70, 0x69, 0x12, 0x67, 0x0a, 0x0a, 0x47, 0x65, - 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x7d, 0x12, 0x5a, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, - 0x1a, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, - 0x12, 0x0d, 0x2f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, - 0x57, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x62, - 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x72, 0x69, 0x64, - 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, - 0x07, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x6f, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, - 0x12, 0x21, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, - 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x12, 0x6b, - 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, - 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, - 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0b, 0x2f, 0x63, 0x6f, - 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x69, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x6f, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x1e, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x43, - 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2d, 0x63, 0x6f, 0x69, 0x6e, 0x73, - 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x7d, 0x12, 0x86, 0x01, 0x0a, - 0x16, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x67, 0x65, 0x54, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x23, + 0x0a, 0x21, 0x47, 0x65, 0x74, 0x57, 0x73, 0x74, 0x45, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x4e, 0x6f, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0xc0, 0x01, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x57, 0x73, 0x74, 0x45, 0x74, + 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4e, 0x6f, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 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, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4d, 0x73, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x4d, + 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x86, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x0a, + 0x54, 0x58, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, + 0x54, 0x58, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, + 0x43, 0x4c, 0x41, 0x49, 0x4d, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x58, 0x5f, 0x43, 0x4c, + 0x41, 0x49, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x58, 0x5f, 0x50, 0x45, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x49, 0x4d, + 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, + 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, + 0x5c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0c, 0x0a, 0x08, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0d, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x13, + 0x0a, 0x0e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45, 0x53, 0x53, + 0x10, 0xe9, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x50, 0x5f, + 0x52, 0x45, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0xf1, 0x07, 0x32, 0xce, 0x11, + 0x0a, 0x0d, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x51, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x50, 0x49, 0x12, 0x1a, 0x2e, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x50, 0x49, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x50, 0x49, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x06, 0x12, 0x04, 0x2f, 0x61, + 0x70, 0x69, 0x12, 0x67, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, + 0x12, 0x1c, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x2f, + 0x7b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x5a, 0x0a, 0x08, 0x47, + 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1a, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x57, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x12, 0x63, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x1b, 0x2e, + 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, - 0x12, 0x13, 0x2f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, - 0x41, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x7a, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, - 0x12, 0x0f, 0x2f, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, - 0x7d, 0x12, 0x60, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x6d, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x12, 0x1d, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x6d, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x73, 0x6d, 0x74, 0x2d, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x7f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x61, - 0x64, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, - 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, - 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x12, 0x13, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x12, 0x21, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x12, 0x6b, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x69, + 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x10, 0x22, 0x0b, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x3a, 0x01, 0x2a, 0x12, 0x6f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x6f, + 0x69, 0x6e, 0x73, 0x12, 0x1e, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x6d, 0x61, + 0x69, 0x6e, 0x2d, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x49, 0x64, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x28, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x6e, 0x6f, 0x74, 0x2d, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x12, 0x93, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x29, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x42, 0x79, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x6d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x2d, 0x74, 0x78, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x7d, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x2e, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, - 0x69, 0x6d, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, - 0x0e, 0x2f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x12, - 0x6c, 0x0a, 0x0b, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1d, - 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x75, 0x61, - 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x6d, 0x61, - 0x6e, 0x75, 0x61, 0x6c, 0x2d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x01, 0x2a, 0x12, 0x97, 0x01, - 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x2e, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, + 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x70, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x2f, 0x7b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x7a, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x6c, 0x6c, 0x2f, 0x7b, + 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x7d, 0x12, 0x60, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x53, 0x6d, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6d, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, + 0x0a, 0x2f, 0x73, 0x6d, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x7f, 0x0a, 0x17, 0x47, + 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, + 0x12, 0x0a, 0x2f, 0x6e, 0x6f, 0x74, 0x2d, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x93, 0x01, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x78, 0x73, + 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, + 0x64, 0x54, 0x78, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x54, + 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x2d, 0x74, + 0x78, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x7d, 0x12, 0x73, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x45, 0x73, 0x74, 0x69, 0x6d, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x65, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x6c, 0x0a, 0x0b, 0x4d, 0x61, 0x6e, 0x75, 0x61, + 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1d, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x2d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x3a, 0x01, 0x2a, 0x12, 0x97, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, - 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x72, 0x65, - 0x61, 0x64, 0x79, 0x2d, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x46, - 0x61, 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, - 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, - 0x61, 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x2d, 0x70, 0x75, - 0x73, 0x68, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x7d, 0x12, 0x70, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, - 0x1a, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x72, 0x67, - 0x65, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, 0x78, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, - 0x12, 0x13, 0x2f, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, 0x65, 0x72, - 0x6d, 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, 0x76, 0x6d, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x74, - 0x72, 0x65, 0x65, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2d, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x7d, 0x12, + 0x89, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x46, 0x61, 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x61, + 0x6b, 0x65, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, + 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x2d, 0x70, 0x75, 0x73, 0x68, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x7d, 0x12, 0x70, 0x0a, 0x18, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1a, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x61, 0x72, 0x67, 0x65, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x6c, 0x61, 0x72, 0x67, 0x65, + 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x9e, 0x01, + 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x73, 0x74, 0x45, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x4e, 0x6f, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x12, 0x2c, 0x2e, 0x62, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x73, 0x74, 0x45, + 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4e, 0x6f, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x73, 0x74, 0x45, 0x74, 0x68, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4e, 0x6f, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x12, 0x1b, 0x2f, 0x77, 0x73, 0x74, 0x65, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x2d, 0x6e, 0x6f, 0x74, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x42, 0x3f, + 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, + 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, + 0x76, 0x6d, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4307,7 +4457,7 @@ func file_query_proto_rawDescGZIP() []byte { } var file_query_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 49) +var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 51) var file_query_proto_goTypes = []interface{}{ (TransactionStatus)(0), // 0: bridge.v1.TransactionStatus (ErrorCode)(0), // 1: bridge.v1.ErrorCode @@ -4360,6 +4510,8 @@ var file_query_proto_goTypes = []interface{}{ (*LargeTxInfo)(nil), // 48: bridge.v1.LargeTxInfo (*LargeTxsRequest)(nil), // 49: bridge.v1.LargeTxsRequest (*LargeTxsResponse)(nil), // 50: bridge.v1.LargeTxsResponse + (*GetWstEthTokenNotWithdrawnRequest)(nil), // 51: bridge.v1.GetWstEthTokenNotWithdrawnRequest + (*GetWstEthTokenNotWithdrawnResponse)(nil), // 52: bridge.v1.GetWstEthTokenNotWithdrawnResponse } var file_query_proto_depIdxs = []int32{ 3, // 0: bridge.v1.GetBridgesResponse.deposits:type_name -> bridge.v1.Deposit @@ -4396,26 +4548,28 @@ var file_query_proto_depIdxs = []int32{ 44, // 31: bridge.v1.BridgeService.GetReadyPendingTransactions:input_type -> bridge.v1.GetReadyPendingTransactionsRequest 45, // 32: bridge.v1.BridgeService.GetFakePushMessages:input_type -> bridge.v1.GetFakePushMessagesRequest 49, // 33: bridge.v1.BridgeService.GetLargeTransactionInfos:input_type -> bridge.v1.LargeTxsRequest - 12, // 34: bridge.v1.BridgeService.CheckAPI:output_type -> bridge.v1.CheckAPIResponse - 13, // 35: bridge.v1.BridgeService.GetBridges:output_type -> bridge.v1.GetBridgesResponse - 14, // 36: bridge.v1.BridgeService.GetProof:output_type -> bridge.v1.GetProofResponse - 16, // 37: bridge.v1.BridgeService.GetBridge:output_type -> bridge.v1.GetBridgeResponse - 17, // 38: bridge.v1.BridgeService.GetClaims:output_type -> bridge.v1.GetClaimsResponse - 15, // 39: bridge.v1.BridgeService.GetTokenWrapped:output_type -> bridge.v1.GetTokenWrappedResponse - 25, // 40: bridge.v1.BridgeService.GetCoinPrice:output_type -> bridge.v1.CommonCoinPricesResponse - 27, // 41: bridge.v1.BridgeService.GetMainCoins:output_type -> bridge.v1.CommonCoinsResponse - 29, // 42: bridge.v1.BridgeService.GetPendingTransactions:output_type -> bridge.v1.CommonTransactionsResponse - 29, // 43: bridge.v1.BridgeService.GetAllTransactions:output_type -> bridge.v1.CommonTransactionsResponse - 33, // 44: bridge.v1.BridgeService.GetSmtProof:output_type -> bridge.v1.CommonProofResponse - 29, // 45: bridge.v1.BridgeService.GetNotReadyTransactions:output_type -> bridge.v1.CommonTransactionsResponse - 37, // 46: bridge.v1.BridgeService.GetMonitoredTxsByStatus:output_type -> bridge.v1.CommonMonitoredTxsResponse - 40, // 47: bridge.v1.BridgeService.GetEstimateTime:output_type -> bridge.v1.CommonEstimateTimeResponse - 43, // 48: bridge.v1.BridgeService.ManualClaim:output_type -> bridge.v1.CommonManualClaimResponse - 29, // 49: bridge.v1.BridgeService.GetReadyPendingTransactions:output_type -> bridge.v1.CommonTransactionsResponse - 46, // 50: bridge.v1.BridgeService.GetFakePushMessages:output_type -> bridge.v1.GetFakePushMessagesResponse - 50, // 51: bridge.v1.BridgeService.GetLargeTransactionInfos:output_type -> bridge.v1.LargeTxsResponse - 34, // [34:52] is the sub-list for method output_type - 16, // [16:34] is the sub-list for method input_type + 51, // 34: bridge.v1.BridgeService.GetWstEthTokenNotWithdrawn:input_type -> bridge.v1.GetWstEthTokenNotWithdrawnRequest + 12, // 35: bridge.v1.BridgeService.CheckAPI:output_type -> bridge.v1.CheckAPIResponse + 13, // 36: bridge.v1.BridgeService.GetBridges:output_type -> bridge.v1.GetBridgesResponse + 14, // 37: bridge.v1.BridgeService.GetProof:output_type -> bridge.v1.GetProofResponse + 16, // 38: bridge.v1.BridgeService.GetBridge:output_type -> bridge.v1.GetBridgeResponse + 17, // 39: bridge.v1.BridgeService.GetClaims:output_type -> bridge.v1.GetClaimsResponse + 15, // 40: bridge.v1.BridgeService.GetTokenWrapped:output_type -> bridge.v1.GetTokenWrappedResponse + 25, // 41: bridge.v1.BridgeService.GetCoinPrice:output_type -> bridge.v1.CommonCoinPricesResponse + 27, // 42: bridge.v1.BridgeService.GetMainCoins:output_type -> bridge.v1.CommonCoinsResponse + 29, // 43: bridge.v1.BridgeService.GetPendingTransactions:output_type -> bridge.v1.CommonTransactionsResponse + 29, // 44: bridge.v1.BridgeService.GetAllTransactions:output_type -> bridge.v1.CommonTransactionsResponse + 33, // 45: bridge.v1.BridgeService.GetSmtProof:output_type -> bridge.v1.CommonProofResponse + 29, // 46: bridge.v1.BridgeService.GetNotReadyTransactions:output_type -> bridge.v1.CommonTransactionsResponse + 37, // 47: bridge.v1.BridgeService.GetMonitoredTxsByStatus:output_type -> bridge.v1.CommonMonitoredTxsResponse + 40, // 48: bridge.v1.BridgeService.GetEstimateTime:output_type -> bridge.v1.CommonEstimateTimeResponse + 43, // 49: bridge.v1.BridgeService.ManualClaim:output_type -> bridge.v1.CommonManualClaimResponse + 29, // 50: bridge.v1.BridgeService.GetReadyPendingTransactions:output_type -> bridge.v1.CommonTransactionsResponse + 46, // 51: bridge.v1.BridgeService.GetFakePushMessages:output_type -> bridge.v1.GetFakePushMessagesResponse + 50, // 52: bridge.v1.BridgeService.GetLargeTransactionInfos:output_type -> bridge.v1.LargeTxsResponse + 52, // 53: bridge.v1.BridgeService.GetWstEthTokenNotWithdrawn:output_type -> bridge.v1.GetWstEthTokenNotWithdrawnResponse + 35, // [35:54] is the sub-list for method output_type + 16, // [16:35] is the sub-list for method input_type 16, // [16:16] is the sub-list for extension type_name 16, // [16:16] is the sub-list for extension extendee 0, // [0:16] is the sub-list for field type_name @@ -5015,6 +5169,30 @@ func file_query_proto_init() { return nil } } + file_query_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWstEthTokenNotWithdrawnRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_query_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWstEthTokenNotWithdrawnResponse); 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{ @@ -5022,7 +5200,7 @@ func file_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_query_proto_rawDesc, NumEnums: 2, - NumMessages: 49, + NumMessages: 51, NumExtensions: 0, NumServices: 1, }, diff --git a/bridgectrl/pb/query.pb.gw.go b/bridgectrl/pb/query.pb.gw.go index 59313bf1..38c85ffe 100644 --- a/bridgectrl/pb/query.pb.gw.go +++ b/bridgectrl/pb/query.pb.gw.go @@ -875,6 +875,24 @@ func local_request_BridgeService_GetLargeTransactionInfos_0(ctx context.Context, } +func request_BridgeService_GetWstEthTokenNotWithdrawn_0(ctx context.Context, marshaler runtime.Marshaler, client BridgeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetWstEthTokenNotWithdrawnRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetWstEthTokenNotWithdrawn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_BridgeService_GetWstEthTokenNotWithdrawn_0(ctx context.Context, marshaler runtime.Marshaler, server BridgeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetWstEthTokenNotWithdrawnRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetWstEthTokenNotWithdrawn(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterBridgeServiceHandlerServer registers the http handlers for service BridgeService to "mux". // UnaryRPC :call BridgeServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1331,6 +1349,31 @@ func RegisterBridgeServiceHandlerServer(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_BridgeService_GetWstEthTokenNotWithdrawn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bridge.v1.BridgeService/GetWstEthTokenNotWithdrawn", runtime.WithHTTPPathPattern("/wsteth/token-not-withdrawn")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_BridgeService_GetWstEthTokenNotWithdrawn_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_BridgeService_GetWstEthTokenNotWithdrawn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1768,6 +1811,28 @@ func RegisterBridgeServiceHandlerClient(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_BridgeService_GetWstEthTokenNotWithdrawn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bridge.v1.BridgeService/GetWstEthTokenNotWithdrawn", runtime.WithHTTPPathPattern("/wsteth/token-not-withdrawn")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_BridgeService_GetWstEthTokenNotWithdrawn_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_BridgeService_GetWstEthTokenNotWithdrawn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1807,6 +1872,8 @@ var ( pattern_BridgeService_GetFakePushMessages_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"fake-push-messages", "topic"}, "")) pattern_BridgeService_GetLargeTransactionInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"large-transactions"}, "")) + + pattern_BridgeService_GetWstEthTokenNotWithdrawn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"wsteth", "token-not-withdrawn"}, "")) ) var ( @@ -1845,4 +1912,6 @@ var ( forward_BridgeService_GetFakePushMessages_0 = runtime.ForwardResponseMessage forward_BridgeService_GetLargeTransactionInfos_0 = runtime.ForwardResponseMessage + + forward_BridgeService_GetWstEthTokenNotWithdrawn_0 = runtime.ForwardResponseMessage ) diff --git a/bridgectrl/pb/query_grpc.pb.go b/bridgectrl/pb/query_grpc.pb.go index 4bba7242..1c35b483 100644 --- a/bridgectrl/pb/query_grpc.pb.go +++ b/bridgectrl/pb/query_grpc.pb.go @@ -1,10 +1,7 @@ -//* -// Bridge service. - // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.5 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v5.27.1 // source: query.proto package pb @@ -21,27 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - BridgeService_CheckAPI_FullMethodName = "/bridge.v1.BridgeService/CheckAPI" - BridgeService_GetBridges_FullMethodName = "/bridge.v1.BridgeService/GetBridges" - BridgeService_GetProof_FullMethodName = "/bridge.v1.BridgeService/GetProof" - BridgeService_GetBridge_FullMethodName = "/bridge.v1.BridgeService/GetBridge" - BridgeService_GetClaims_FullMethodName = "/bridge.v1.BridgeService/GetClaims" - BridgeService_GetTokenWrapped_FullMethodName = "/bridge.v1.BridgeService/GetTokenWrapped" - BridgeService_GetCoinPrice_FullMethodName = "/bridge.v1.BridgeService/GetCoinPrice" - BridgeService_GetMainCoins_FullMethodName = "/bridge.v1.BridgeService/GetMainCoins" - BridgeService_GetPendingTransactions_FullMethodName = "/bridge.v1.BridgeService/GetPendingTransactions" - BridgeService_GetAllTransactions_FullMethodName = "/bridge.v1.BridgeService/GetAllTransactions" - BridgeService_GetSmtProof_FullMethodName = "/bridge.v1.BridgeService/GetSmtProof" - BridgeService_GetNotReadyTransactions_FullMethodName = "/bridge.v1.BridgeService/GetNotReadyTransactions" - BridgeService_GetMonitoredTxsByStatus_FullMethodName = "/bridge.v1.BridgeService/GetMonitoredTxsByStatus" - BridgeService_GetEstimateTime_FullMethodName = "/bridge.v1.BridgeService/GetEstimateTime" - BridgeService_ManualClaim_FullMethodName = "/bridge.v1.BridgeService/ManualClaim" - BridgeService_GetReadyPendingTransactions_FullMethodName = "/bridge.v1.BridgeService/GetReadyPendingTransactions" - BridgeService_GetFakePushMessages_FullMethodName = "/bridge.v1.BridgeService/GetFakePushMessages" - BridgeService_GetLargeTransactionInfos_FullMethodName = "/bridge.v1.BridgeService/GetLargeTransactionInfos" -) - // BridgeServiceClient is the client API for BridgeService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -82,6 +58,7 @@ type BridgeServiceClient interface { GetFakePushMessages(ctx context.Context, in *GetFakePushMessagesRequest, opts ...grpc.CallOption) (*GetFakePushMessagesResponse, error) // / Return large transaction infos GetLargeTransactionInfos(ctx context.Context, in *LargeTxsRequest, opts ...grpc.CallOption) (*LargeTxsResponse, error) + GetWstEthTokenNotWithdrawn(ctx context.Context, in *GetWstEthTokenNotWithdrawnRequest, opts ...grpc.CallOption) (*GetWstEthTokenNotWithdrawnResponse, error) } type bridgeServiceClient struct { @@ -94,7 +71,7 @@ func NewBridgeServiceClient(cc grpc.ClientConnInterface) BridgeServiceClient { func (c *bridgeServiceClient) CheckAPI(ctx context.Context, in *CheckAPIRequest, opts ...grpc.CallOption) (*CheckAPIResponse, error) { out := new(CheckAPIResponse) - err := c.cc.Invoke(ctx, BridgeService_CheckAPI_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/CheckAPI", in, out, opts...) if err != nil { return nil, err } @@ -103,7 +80,7 @@ func (c *bridgeServiceClient) CheckAPI(ctx context.Context, in *CheckAPIRequest, func (c *bridgeServiceClient) GetBridges(ctx context.Context, in *GetBridgesRequest, opts ...grpc.CallOption) (*GetBridgesResponse, error) { out := new(GetBridgesResponse) - err := c.cc.Invoke(ctx, BridgeService_GetBridges_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetBridges", in, out, opts...) if err != nil { return nil, err } @@ -112,7 +89,7 @@ func (c *bridgeServiceClient) GetBridges(ctx context.Context, in *GetBridgesRequ func (c *bridgeServiceClient) GetProof(ctx context.Context, in *GetProofRequest, opts ...grpc.CallOption) (*GetProofResponse, error) { out := new(GetProofResponse) - err := c.cc.Invoke(ctx, BridgeService_GetProof_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetProof", in, out, opts...) if err != nil { return nil, err } @@ -121,7 +98,7 @@ func (c *bridgeServiceClient) GetProof(ctx context.Context, in *GetProofRequest, func (c *bridgeServiceClient) GetBridge(ctx context.Context, in *GetBridgeRequest, opts ...grpc.CallOption) (*GetBridgeResponse, error) { out := new(GetBridgeResponse) - err := c.cc.Invoke(ctx, BridgeService_GetBridge_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetBridge", in, out, opts...) if err != nil { return nil, err } @@ -130,7 +107,7 @@ func (c *bridgeServiceClient) GetBridge(ctx context.Context, in *GetBridgeReques func (c *bridgeServiceClient) GetClaims(ctx context.Context, in *GetClaimsRequest, opts ...grpc.CallOption) (*GetClaimsResponse, error) { out := new(GetClaimsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetClaims_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetClaims", in, out, opts...) if err != nil { return nil, err } @@ -139,7 +116,7 @@ func (c *bridgeServiceClient) GetClaims(ctx context.Context, in *GetClaimsReques func (c *bridgeServiceClient) GetTokenWrapped(ctx context.Context, in *GetTokenWrappedRequest, opts ...grpc.CallOption) (*GetTokenWrappedResponse, error) { out := new(GetTokenWrappedResponse) - err := c.cc.Invoke(ctx, BridgeService_GetTokenWrapped_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetTokenWrapped", in, out, opts...) if err != nil { return nil, err } @@ -148,7 +125,7 @@ func (c *bridgeServiceClient) GetTokenWrapped(ctx context.Context, in *GetTokenW func (c *bridgeServiceClient) GetCoinPrice(ctx context.Context, in *GetCoinPriceRequest, opts ...grpc.CallOption) (*CommonCoinPricesResponse, error) { out := new(CommonCoinPricesResponse) - err := c.cc.Invoke(ctx, BridgeService_GetCoinPrice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetCoinPrice", in, out, opts...) if err != nil { return nil, err } @@ -157,7 +134,7 @@ func (c *bridgeServiceClient) GetCoinPrice(ctx context.Context, in *GetCoinPrice func (c *bridgeServiceClient) GetMainCoins(ctx context.Context, in *GetMainCoinsRequest, opts ...grpc.CallOption) (*CommonCoinsResponse, error) { out := new(CommonCoinsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetMainCoins_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetMainCoins", in, out, opts...) if err != nil { return nil, err } @@ -166,7 +143,7 @@ func (c *bridgeServiceClient) GetMainCoins(ctx context.Context, in *GetMainCoins func (c *bridgeServiceClient) GetPendingTransactions(ctx context.Context, in *GetPendingTransactionsRequest, opts ...grpc.CallOption) (*CommonTransactionsResponse, error) { out := new(CommonTransactionsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetPendingTransactions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetPendingTransactions", in, out, opts...) if err != nil { return nil, err } @@ -175,7 +152,7 @@ func (c *bridgeServiceClient) GetPendingTransactions(ctx context.Context, in *Ge func (c *bridgeServiceClient) GetAllTransactions(ctx context.Context, in *GetAllTransactionsRequest, opts ...grpc.CallOption) (*CommonTransactionsResponse, error) { out := new(CommonTransactionsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetAllTransactions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetAllTransactions", in, out, opts...) if err != nil { return nil, err } @@ -184,7 +161,7 @@ func (c *bridgeServiceClient) GetAllTransactions(ctx context.Context, in *GetAll func (c *bridgeServiceClient) GetSmtProof(ctx context.Context, in *GetSmtProofRequest, opts ...grpc.CallOption) (*CommonProofResponse, error) { out := new(CommonProofResponse) - err := c.cc.Invoke(ctx, BridgeService_GetSmtProof_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetSmtProof", in, out, opts...) if err != nil { return nil, err } @@ -193,7 +170,7 @@ func (c *bridgeServiceClient) GetSmtProof(ctx context.Context, in *GetSmtProofRe func (c *bridgeServiceClient) GetNotReadyTransactions(ctx context.Context, in *GetNotReadyTransactionsRequest, opts ...grpc.CallOption) (*CommonTransactionsResponse, error) { out := new(CommonTransactionsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetNotReadyTransactions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetNotReadyTransactions", in, out, opts...) if err != nil { return nil, err } @@ -202,7 +179,7 @@ func (c *bridgeServiceClient) GetNotReadyTransactions(ctx context.Context, in *G func (c *bridgeServiceClient) GetMonitoredTxsByStatus(ctx context.Context, in *GetMonitoredTxsByStatusRequest, opts ...grpc.CallOption) (*CommonMonitoredTxsResponse, error) { out := new(CommonMonitoredTxsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetMonitoredTxsByStatus_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetMonitoredTxsByStatus", in, out, opts...) if err != nil { return nil, err } @@ -211,7 +188,7 @@ func (c *bridgeServiceClient) GetMonitoredTxsByStatus(ctx context.Context, in *G func (c *bridgeServiceClient) GetEstimateTime(ctx context.Context, in *GetEstimateTimeRequest, opts ...grpc.CallOption) (*CommonEstimateTimeResponse, error) { out := new(CommonEstimateTimeResponse) - err := c.cc.Invoke(ctx, BridgeService_GetEstimateTime_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetEstimateTime", in, out, opts...) if err != nil { return nil, err } @@ -220,7 +197,7 @@ func (c *bridgeServiceClient) GetEstimateTime(ctx context.Context, in *GetEstima func (c *bridgeServiceClient) ManualClaim(ctx context.Context, in *ManualClaimRequest, opts ...grpc.CallOption) (*CommonManualClaimResponse, error) { out := new(CommonManualClaimResponse) - err := c.cc.Invoke(ctx, BridgeService_ManualClaim_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/ManualClaim", in, out, opts...) if err != nil { return nil, err } @@ -229,7 +206,7 @@ func (c *bridgeServiceClient) ManualClaim(ctx context.Context, in *ManualClaimRe func (c *bridgeServiceClient) GetReadyPendingTransactions(ctx context.Context, in *GetReadyPendingTransactionsRequest, opts ...grpc.CallOption) (*CommonTransactionsResponse, error) { out := new(CommonTransactionsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetReadyPendingTransactions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetReadyPendingTransactions", in, out, opts...) if err != nil { return nil, err } @@ -238,7 +215,7 @@ func (c *bridgeServiceClient) GetReadyPendingTransactions(ctx context.Context, i func (c *bridgeServiceClient) GetFakePushMessages(ctx context.Context, in *GetFakePushMessagesRequest, opts ...grpc.CallOption) (*GetFakePushMessagesResponse, error) { out := new(GetFakePushMessagesResponse) - err := c.cc.Invoke(ctx, BridgeService_GetFakePushMessages_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetFakePushMessages", in, out, opts...) if err != nil { return nil, err } @@ -247,7 +224,16 @@ func (c *bridgeServiceClient) GetFakePushMessages(ctx context.Context, in *GetFa func (c *bridgeServiceClient) GetLargeTransactionInfos(ctx context.Context, in *LargeTxsRequest, opts ...grpc.CallOption) (*LargeTxsResponse, error) { out := new(LargeTxsResponse) - err := c.cc.Invoke(ctx, BridgeService_GetLargeTransactionInfos_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetLargeTransactionInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *bridgeServiceClient) GetWstEthTokenNotWithdrawn(ctx context.Context, in *GetWstEthTokenNotWithdrawnRequest, opts ...grpc.CallOption) (*GetWstEthTokenNotWithdrawnResponse, error) { + out := new(GetWstEthTokenNotWithdrawnResponse) + err := c.cc.Invoke(ctx, "/bridge.v1.BridgeService/GetWstEthTokenNotWithdrawn", in, out, opts...) if err != nil { return nil, err } @@ -294,6 +280,7 @@ type BridgeServiceServer interface { GetFakePushMessages(context.Context, *GetFakePushMessagesRequest) (*GetFakePushMessagesResponse, error) // / Return large transaction infos GetLargeTransactionInfos(context.Context, *LargeTxsRequest) (*LargeTxsResponse, error) + GetWstEthTokenNotWithdrawn(context.Context, *GetWstEthTokenNotWithdrawnRequest) (*GetWstEthTokenNotWithdrawnResponse, error) mustEmbedUnimplementedBridgeServiceServer() } @@ -355,6 +342,9 @@ func (UnimplementedBridgeServiceServer) GetFakePushMessages(context.Context, *Ge func (UnimplementedBridgeServiceServer) GetLargeTransactionInfos(context.Context, *LargeTxsRequest) (*LargeTxsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLargeTransactionInfos not implemented") } +func (UnimplementedBridgeServiceServer) GetWstEthTokenNotWithdrawn(context.Context, *GetWstEthTokenNotWithdrawnRequest) (*GetWstEthTokenNotWithdrawnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWstEthTokenNotWithdrawn not implemented") +} func (UnimplementedBridgeServiceServer) mustEmbedUnimplementedBridgeServiceServer() {} // UnsafeBridgeServiceServer may be embedded to opt out of forward compatibility for this service. @@ -378,7 +368,7 @@ func _BridgeService_CheckAPI_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_CheckAPI_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/CheckAPI", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).CheckAPI(ctx, req.(*CheckAPIRequest)) @@ -396,7 +386,7 @@ func _BridgeService_GetBridges_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetBridges_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetBridges", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetBridges(ctx, req.(*GetBridgesRequest)) @@ -414,7 +404,7 @@ func _BridgeService_GetProof_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetProof_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetProof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetProof(ctx, req.(*GetProofRequest)) @@ -432,7 +422,7 @@ func _BridgeService_GetBridge_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetBridge_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetBridge", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetBridge(ctx, req.(*GetBridgeRequest)) @@ -450,7 +440,7 @@ func _BridgeService_GetClaims_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetClaims_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetClaims", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetClaims(ctx, req.(*GetClaimsRequest)) @@ -468,7 +458,7 @@ func _BridgeService_GetTokenWrapped_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetTokenWrapped_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetTokenWrapped", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetTokenWrapped(ctx, req.(*GetTokenWrappedRequest)) @@ -486,7 +476,7 @@ func _BridgeService_GetCoinPrice_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetCoinPrice_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetCoinPrice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetCoinPrice(ctx, req.(*GetCoinPriceRequest)) @@ -504,7 +494,7 @@ func _BridgeService_GetMainCoins_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetMainCoins_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetMainCoins", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetMainCoins(ctx, req.(*GetMainCoinsRequest)) @@ -522,7 +512,7 @@ func _BridgeService_GetPendingTransactions_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetPendingTransactions_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetPendingTransactions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetPendingTransactions(ctx, req.(*GetPendingTransactionsRequest)) @@ -540,7 +530,7 @@ func _BridgeService_GetAllTransactions_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetAllTransactions_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetAllTransactions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetAllTransactions(ctx, req.(*GetAllTransactionsRequest)) @@ -558,7 +548,7 @@ func _BridgeService_GetSmtProof_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetSmtProof_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetSmtProof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetSmtProof(ctx, req.(*GetSmtProofRequest)) @@ -576,7 +566,7 @@ func _BridgeService_GetNotReadyTransactions_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetNotReadyTransactions_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetNotReadyTransactions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetNotReadyTransactions(ctx, req.(*GetNotReadyTransactionsRequest)) @@ -594,7 +584,7 @@ func _BridgeService_GetMonitoredTxsByStatus_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetMonitoredTxsByStatus_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetMonitoredTxsByStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetMonitoredTxsByStatus(ctx, req.(*GetMonitoredTxsByStatusRequest)) @@ -612,7 +602,7 @@ func _BridgeService_GetEstimateTime_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetEstimateTime_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetEstimateTime", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetEstimateTime(ctx, req.(*GetEstimateTimeRequest)) @@ -630,7 +620,7 @@ func _BridgeService_ManualClaim_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_ManualClaim_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/ManualClaim", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).ManualClaim(ctx, req.(*ManualClaimRequest)) @@ -648,7 +638,7 @@ func _BridgeService_GetReadyPendingTransactions_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetReadyPendingTransactions_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetReadyPendingTransactions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetReadyPendingTransactions(ctx, req.(*GetReadyPendingTransactionsRequest)) @@ -666,7 +656,7 @@ func _BridgeService_GetFakePushMessages_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetFakePushMessages_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetFakePushMessages", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetFakePushMessages(ctx, req.(*GetFakePushMessagesRequest)) @@ -684,7 +674,7 @@ func _BridgeService_GetLargeTransactionInfos_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BridgeService_GetLargeTransactionInfos_FullMethodName, + FullMethod: "/bridge.v1.BridgeService/GetLargeTransactionInfos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BridgeServiceServer).GetLargeTransactionInfos(ctx, req.(*LargeTxsRequest)) @@ -692,6 +682,24 @@ func _BridgeService_GetLargeTransactionInfos_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +func _BridgeService_GetWstEthTokenNotWithdrawn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWstEthTokenNotWithdrawnRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BridgeServiceServer).GetWstEthTokenNotWithdrawn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bridge.v1.BridgeService/GetWstEthTokenNotWithdrawn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BridgeServiceServer).GetWstEthTokenNotWithdrawn(ctx, req.(*GetWstEthTokenNotWithdrawnRequest)) + } + return interceptor(ctx, in, info, handler) +} + // BridgeService_ServiceDesc is the grpc.ServiceDesc for BridgeService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -771,6 +779,10 @@ var BridgeService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetLargeTransactionInfos", Handler: _BridgeService_GetLargeTransactionInfos_Handler, }, + { + MethodName: "GetWstEthTokenNotWithdrawn", + Handler: _BridgeService_GetWstEthTokenNotWithdrawn_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "query.proto", diff --git a/cmd/run_xlayer.go b/cmd/run_xlayer.go index 3afb0b48..bef6577f 100644 --- a/cmd/run_xlayer.go +++ b/cmd/run_xlayer.go @@ -24,6 +24,7 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/server/tokenlogoinfo" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" "github.com/0xPolygonHermez/zkevm-bridge-service/utils/gerror" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils/messagebridge" "github.com/0xPolygonHermez/zkevm-node/jsonrpc/client" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/urfave/cli/v2" @@ -90,7 +91,8 @@ func startServer(ctx *cli.Context, opts ...runOptionFunc) error { return err } - utils.InitUSDCLxLyMapping(c.BusinessConfig.USDCContractAddresses, c.BusinessConfig.USDCTokenAddresses) + messagebridge.InitUSDCLxLyProcessor(c.BusinessConfig.USDCContractAddresses, c.BusinessConfig.USDCTokenAddresses) + messagebridge.InitWstETHProcessor(c.BusinessConfig.WstETHContractAddresses, c.BusinessConfig.WstETHTokenAddresses) l1ChainId := c.Etherman.L1ChainId l2ChainIds := c.Etherman.L2ChainIds @@ -212,6 +214,8 @@ func startServer(ctx *cli.Context, opts ...runOptionFunc) error { // Initialize inner chain id conf utils.InnitOkInnerChainIdMapper(c.BusinessConfig) + server.RegisterNacos(c.NacosConfig) + // ---------- Run API ---------- if opt.runAPI { // Init sentinel @@ -223,7 +227,6 @@ func startServer(ctx *cli.Context, opts ...runOptionFunc) error { if err != nil { log.Infof("init sentinel error[%v]; ignored and proceed with no sentinel config", err) } - server.RegisterNacos(c.NacosConfig) iprestriction.InitClient(c.IPRestriction) tokenlogoinfo.InitClient(c.TokenLogoServiceConfig) diff --git a/config/businessconfig/config.go b/config/businessconfig/config.go index 185ca079..73d60fec 100644 --- a/config/businessconfig/config.go +++ b/config/businessconfig/config.go @@ -8,6 +8,8 @@ type Config struct { StandardChainIds []uint64 `mapstructure:"StandardChainIds"` InnerChainIds []uint64 `mapstructure:"InnerChainIds"` - USDCContractAddresses []common.Address `mapstructure:"USDCContractAddresses"` - USDCTokenAddresses []common.Address `mapstructure:"USDCTokenAddresses"` + USDCContractAddresses []common.Address `mapstructure:"USDCContractAddresses"` + USDCTokenAddresses []common.Address `mapstructure:"USDCTokenAddresses"` + WstETHContractAddresses []common.Address `mapstructure:"WstETHContractAddresses"` + WstETHTokenAddresses []common.Address `mapstructure:"WstETHTokenAddresses"` } diff --git a/db/pgstorage/migrations/1004.sql b/db/pgstorage/migrations/1004.sql new file mode 100644 index 00000000..1fadbcc3 --- /dev/null +++ b/db/pgstorage/migrations/1004.sql @@ -0,0 +1,16 @@ +-- +migrate Down + +DROP TABLE IF EXISTS sync.bridge_balance; + +-- +migrate Up + +CREATE TABLE IF NOT EXISTS sync.bridge_balance +( + id SERIAL PRIMARY KEY, + original_token_addr BYTEA NOT NULL, + network_id INTEGER NOT NULL, + balance VARCHAR NOT NULL DEFAULT '0', + create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), + modify_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), + CONSTRAINT bridge_balance_uidx UNIQUE (original_token_addr, network_id) +); diff --git a/db/pgstorage/pgstorage_xlayer.go b/db/pgstorage/pgstorage_xlayer.go index f9ac154c..9e86a350 100644 --- a/db/pgstorage/pgstorage_xlayer.go +++ b/db/pgstorage/pgstorage_xlayer.go @@ -249,7 +249,7 @@ func (p *PostgresStorage) GetClaimTxsByStatusWithLimit(ctx context.Context, stat // GetClaimTxById gets the monitored transactions by id (depositCount) func (p *PostgresStorage) GetClaimTxById(ctx context.Context, id uint, dbTx pgx.Tx) (*ctmtypes.MonitoredTx, error) { - getClaimSql := "SELECT deposit_id, from_addr, to_addr, nonce, value, data, gas, status, history, created_at, updated_at FROM sync.monitored_txs WHERE id = $1" + getClaimSql := "SELECT deposit_id, from_addr, to_addr, nonce, value, data, gas, status, history, created_at, updated_at FROM sync.monitored_txs WHERE deposit_id = $1" var ( value string history [][]byte @@ -369,3 +369,32 @@ func (p *PostgresStorage) GetDepositsForUnitTest(ctx context.Context, destAddr s ORDER BY d.block_id DESC, d.deposit_cnt DESC LIMIT $2 OFFSET $3` return p.getDepositList(ctx, getDepositsSQL, dbTx, common.FromHex(destAddr), limit, offset) } + +func (p *PostgresStorage) GetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, forUpdate bool, dbTx pgx.Tx) (*big.Int, error) { + var getBridgeBalanceSQL = "SELECT balance FROM sync.bridge_balance WHERE original_token_addr = $1 AND network_id = $2" + if forUpdate { + getBridgeBalanceSQL += " FOR UPDATE" + } + var s string + err := p.getExecQuerier(dbTx).QueryRow(ctx, getBridgeBalanceSQL, originalTokenAddr, networkID).Scan(&s) + if err != nil { + if errors.Is(err, pgx.ErrNoRows) { + return big.NewInt(0), nil + } + return nil, err + } + + balance, _ := new(big.Int).SetString(s, 10) //nolint:gomnd + return balance, nil +} + +func (p *PostgresStorage) SetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, balance *big.Int, dbTx pgx.Tx) error { + var setBridgeBalanceSQL = ` + INSERT INTO sync.bridge_balance (original_token_addr, network_id, balance) + VALUES ($1, $2, $3) + ON CONFLICT ON CONSTRAINT bridge_balance_uidx + DO UPDATE SET balance = EXCLUDED.balance, modify_time = $4` + + _, err := p.getExecQuerier(dbTx).Exec(ctx, setBridgeBalanceSQL, originalTokenAddr, networkID, balance.String(), time.Now()) + return err +} diff --git a/db/pgstorage/pgstorage_xlayer_test.go b/db/pgstorage/pgstorage_xlayer_test.go index e6d6be37..d44c8da0 100644 --- a/db/pgstorage/pgstorage_xlayer_test.go +++ b/db/pgstorage/pgstorage_xlayer_test.go @@ -2,6 +2,7 @@ package pgstorage import ( "context" + "math/big" "testing" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" @@ -46,3 +47,42 @@ func TestGetDepositsXLayer(t *testing.T) { require.NoError(t, err) require.Len(t, deposits, 2) } + +func TestBridgeBalance(t *testing.T) { + dbCfg := NewConfigFromEnv() + ctx := context.Background() + err := InitOrReset(dbCfg) + require.NoError(t, err) + + store, err := NewPostgresStorage(dbCfg) + require.NoError(t, err) + + addr := common.HexToAddress("0xB36c9325294CBd1b6BF5ECB33d9b035F1f0e9B8A") + networkID := uint(1) + + dbTx, err := store.Begin(ctx) + require.NoError(t, err) + + balance, err := store.GetBridgeBalance(ctx, addr, networkID, false, nil) + require.NoError(t, err) + require.Equal(t, 0, balance.Cmp(big.NewInt(0))) + + balance.SetInt64(123456) + err = store.SetBridgeBalance(ctx, addr, networkID, balance, nil) + require.NoError(t, err) + + balance, err = store.GetBridgeBalance(ctx, addr, networkID, true, nil) + require.NoError(t, err) + require.Equal(t, 0, balance.Cmp(big.NewInt(123456))) + + balance.SetInt64(10000000) + err = store.SetBridgeBalance(ctx, addr, networkID, balance, nil) + require.NoError(t, err) + + balance, err = store.GetBridgeBalance(ctx, addr, networkID, false, nil) + require.NoError(t, err) + require.Equal(t, 0, balance.Cmp(big.NewInt(10000000))) + + err = dbTx.Rollback(ctx) + require.NoError(t, err) +} diff --git a/proto/src/proto/bridge/v1/query.proto b/proto/src/proto/bridge/v1/query.proto index ad1582e2..ca6b0b1d 100644 --- a/proto/src/proto/bridge/v1/query.proto +++ b/proto/src/proto/bridge/v1/query.proto @@ -141,6 +141,12 @@ service BridgeService { get: "/large-transactions", }; } + + rpc GetWstEthTokenNotWithdrawn(GetWstEthTokenNotWithdrawnRequest) returns (GetWstEthTokenNotWithdrawnResponse) { + option (google.api.http) = { + get: "/wsteth/token-not-withdrawn", + }; + } } // TokenWrapped message @@ -522,4 +528,15 @@ message LargeTxsResponse { string error_message = 4; string detailMsg = 5; repeated LargeTxInfo data = 6; +} + +message GetWstEthTokenNotWithdrawnRequest {} + +message GetWstEthTokenNotWithdrawnResponse { + uint32 code = 1; + string msg = 2; + string error_code = 3; + string error_message = 4; + string detailMsg = 5; + repeated string data = 6; // Big integer } \ No newline at end of file diff --git a/pushtask/committedbatchtask.go b/pushtask/committedbatchtask.go index ddf3a15d..9ea5740b 100644 --- a/pushtask/committedbatchtask.go +++ b/pushtask/committedbatchtask.go @@ -11,6 +11,7 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/messagepush" "github.com/0xPolygonHermez/zkevm-bridge-service/redisstorage" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils/messagebridge" "github.com/ethereum/go-ethereum/ethclient" "github.com/pkg/errors" "github.com/redis/go-redis/v9" @@ -274,7 +275,7 @@ func (ins *CommittedBatchHandler) pushMsgForDeposit(deposit *etherman.Deposit, l log.Errorf("kafka push producer is nil, so can't push tx status change msg!") return } - if deposit.LeafType != uint8(utils.LeafTypeAsset) && !utils.IsUSDCContractAddress(deposit.OriginalAddress) { + if deposit.LeafType != uint8(utils.LeafTypeAsset) && !messagebridge.IsAllowedContractAddress(deposit.OriginalAddress) { log.Infof("transaction is not asset, so skip push update change, hash: %v", deposit.TxHash) return } diff --git a/pushtask/l1blocknumtask.go b/pushtask/l1blocknumtask.go index 9a2e8a07..29ef457e 100644 --- a/pushtask/l1blocknumtask.go +++ b/pushtask/l1blocknumtask.go @@ -10,6 +10,7 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/messagepush" "github.com/0xPolygonHermez/zkevm-bridge-service/redisstorage" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils/messagebridge" "github.com/ethereum/go-ethereum/ethclient" "github.com/pkg/errors" "github.com/redis/go-redis/v9" @@ -129,7 +130,7 @@ func (t *L1BlockNumTask) doTask(ctx context.Context) { if t.messagePushProducer == nil { return } - if deposit.LeafType != uint8(utils.LeafTypeAsset) && !utils.IsUSDCContractAddress(deposit.OriginalAddress) { + if deposit.LeafType != uint8(utils.LeafTypeAsset) && !messagebridge.IsAllowedContractAddress(deposit.OriginalAddress) { log.Infof("transaction is not asset, so skip push update change, hash: %v", deposit.TxHash) return } diff --git a/redisstorage/redisstorage.go b/redisstorage/redisstorage.go index f8191672..a54fab69 100644 --- a/redisstorage/redisstorage.go +++ b/redisstorage/redisstorage.go @@ -278,7 +278,7 @@ func (s *redisStorageImpl) TryLock(ctx context.Context, lockKey string) (bool, e return false, errors.New("redis client is nil") } success, err := s.client.SetNX(ctx, s.addKeyPrefix(lockKey), true, lockExpire).Result() - return success, errors.Wrap(err, "TryLock error") + return success, errors.Wrap(err, "SetNX error") } func (s *redisStorageImpl) ReleaseLock(ctx context.Context, lockKey string) error { diff --git a/server/interfaces.go b/server/interfaces.go index 78d5c573..1c15acee 100644 --- a/server/interfaces.go +++ b/server/interfaces.go @@ -2,6 +2,7 @@ package server import ( "context" + "math/big" "time" ctmtypes "github.com/0xPolygonHermez/zkevm-bridge-service/claimtxman/types" @@ -33,4 +34,6 @@ type bridgeServiceStorage interface { GetClaimTxById(ctx context.Context, id uint, dbTx pgx.Tx) (*ctmtypes.MonitoredTx, error) GetClaimTxsByStatusWithLimit(ctx context.Context, statuses []ctmtypes.MonitoredTxStatus, limit uint, offset uint, dbTx pgx.Tx) ([]ctmtypes.MonitoredTx, error) GetDepositsForUnitTest(ctx context.Context, destAddr string, limit uint, offset uint, dbTx pgx.Tx) ([]*etherman.Deposit, error) + GetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, forUpdate bool, dbTx pgx.Tx) (*big.Int, error) + SetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, balance *big.Int, dbTx pgx.Tx) error } diff --git a/server/service_xlayer.go b/server/service_xlayer.go index 23ef8236..30f4c170 100644 --- a/server/service_xlayer.go +++ b/server/service_xlayer.go @@ -20,6 +20,7 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/server/tokenlogoinfo" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" "github.com/0xPolygonHermez/zkevm-bridge-service/utils/gerror" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils/messagebridge" "github.com/pkg/errors" "github.com/redis/go-redis/v9" ) @@ -134,7 +135,7 @@ func (s *bridgeService) GetPendingTransactions(ctx context.Context, req *pb.GetP limit = s.maxPageLimit.Get() } - deposits, err := s.storage.GetPendingTransactions(ctx, req.DestAddr, uint(limit+1), uint(req.Offset), utils.GetUSDCContractAddressList(), nil) + deposits, err := s.storage.GetPendingTransactions(ctx, req.DestAddr, uint(limit+1), uint(req.Offset), messagebridge.GetContractAddressList(), nil) if err != nil { log.Errorf("get pending tx failed for address: %v, limit: %v, offset: %v, error: %v", req.DestAddr, limit, req.Offset, err) return &pb.CommonTransactionsResponse{ @@ -158,7 +159,7 @@ func (s *bridgeService) GetPendingTransactions(ctx context.Context, req *pb.GetP transactionMap := make(map[string][]*pb.Transaction) for _, deposit := range deposits { // replace contract address to real token address - utils.ReplaceUSDCDepositInfo(deposit, false) + messagebridge.ReplaceDepositInfo(deposit, false) transaction := utils.EthermanDepositToPbTransaction(deposit) transaction.EstimateTime = estimatetime.GetDefaultCalculator().Get(deposit.NetworkID) transaction.Status = uint32(pb.TransactionStatus_TX_CREATED) @@ -233,7 +234,7 @@ func (s *bridgeService) GetAllTransactions(ctx context.Context, req *pb.GetAllTr limit = s.maxPageLimit.Get() } - deposits, err := s.storage.GetDepositsXLayer(ctx, req.DestAddr, uint(limit+1), uint(req.Offset), utils.GetUSDCContractAddressList(), nil) + deposits, err := s.storage.GetDepositsXLayer(ctx, req.DestAddr, uint(limit+1), uint(req.Offset), messagebridge.GetContractAddressList(), nil) if err != nil { log.Errorf("get deposits from db failed for address: %v, limit: %v, offset: %v, error: %v", req.DestAddr, limit, req.Offset, err) return &pb.CommonTransactionsResponse{ @@ -257,7 +258,7 @@ func (s *bridgeService) GetAllTransactions(ctx context.Context, req *pb.GetAllTr transactionMap := make(map[string][]*pb.Transaction) for _, deposit := range deposits { // replace contract address to real token address - utils.ReplaceUSDCDepositInfo(deposit, false) + messagebridge.ReplaceDepositInfo(deposit, false) transaction := utils.EthermanDepositToPbTransaction(deposit) transaction.EstimateTime = estimatetime.GetDefaultCalculator().Get(deposit.NetworkID) transaction.Status = uint32(pb.TransactionStatus_TX_CREATED) // Not ready for claim @@ -385,8 +386,8 @@ func (s *bridgeService) GetMonitoredTxsByStatus(ctx context.Context, req *pb.Get for _, mTx := range mTxs { transaction := &pb.MonitoredTx{ Id: uint64(mTx.DepositID), - From: "0x" + mTx.From.String(), - To: "0x" + mTx.To.String(), + From: mTx.From.String(), + To: mTx.To.String(), Nonce: mTx.Nonce, Value: mTx.Value.String(), Data: "0x" + hex.EncodeToString(mTx.Data), @@ -569,3 +570,27 @@ func (s *bridgeService) GetLargeTransactionInfos(ctx context.Context, req *pb.La } return &pb.LargeTxsResponse{Code: uint32(pb.ErrorCode_ERROR_OK), Data: txInfos}, nil } + +func (s *bridgeService) GetWstEthTokenNotWithdrawn(ctx context.Context, req *pb.GetWstEthTokenNotWithdrawnRequest) (*pb.GetWstEthTokenNotWithdrawnResponse, error) { + processor := messagebridge.GetProcessorByType(messagebridge.WstETH) + if processor == nil { + return &pb.GetWstEthTokenNotWithdrawnResponse{ + Code: uint32(pb.ErrorCode_ERROR_DEFAULT), + Msg: "internal: wstETH processor is not inited", + }, nil + } + tokenAddr := processor.GetTokenAddressList()[0] + valueL1, errL1 := s.storage.GetBridgeBalance(ctx, tokenAddr, utils.GetMainNetworkId(), false, nil) + valueL2, errL2 := s.storage.GetBridgeBalance(ctx, tokenAddr, utils.GetRollupNetworkId(), false, nil) + if errL1 != nil || errL2 != nil { + log.Errorf("failed to get wstETH TokenNotWithdrawn, errL1: %v, errL2: %v", errL1, errL2) + return &pb.GetWstEthTokenNotWithdrawnResponse{ + Code: uint32(pb.ErrorCode_ERROR_DEFAULT), + Msg: "failed to get from DB", + }, nil + } + return &pb.GetWstEthTokenNotWithdrawnResponse{ + Code: uint32(pb.ErrorCode_ERROR_OK), + Data: []string{valueL1.String(), valueL2.String()}, + }, nil +} diff --git a/synchronizer/interfaces.go b/synchronizer/interfaces.go index 37f6fa6b..bbeb6869 100644 --- a/synchronizer/interfaces.go +++ b/synchronizer/interfaces.go @@ -41,6 +41,8 @@ type storageInterface interface { // XLayer GetDeposit(ctx context.Context, depositCounterUser uint, networkID uint, dbTx pgx.Tx) (*etherman.Deposit, error) AddDepositXLayer(ctx context.Context, deposit *etherman.Deposit, dbTx pgx.Tx) (uint64, error) + GetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, forUpdate bool, dbTx pgx.Tx) (*big.Int, error) + SetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, balance *big.Int, dbTx pgx.Tx) error } type bridgectrlInterface interface { diff --git a/synchronizer/mock_storage.go b/synchronizer/mock_storage.go index ac974019..bafb4fed 100644 --- a/synchronizer/mock_storage.go +++ b/synchronizer/mock_storage.go @@ -4,8 +4,12 @@ package synchronizer import ( context "context" + big "math/big" + + common "github.com/ethereum/go-ethereum/common" etherman "github.com/0xPolygonHermez/zkevm-bridge-service/etherman" + mock "github.com/stretchr/testify/mock" pgx "github.com/jackc/pgx/v4" @@ -218,6 +222,32 @@ func (_m *storageMock) Commit(ctx context.Context, dbTx pgx.Tx) error { return r0 } +// GetBridgeBalance provides a mock function with given fields: ctx, originalTokenAddr, networkID, forUpdate, dbTx +func (_m *storageMock) GetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, forUpdate bool, dbTx pgx.Tx) (*big.Int, error) { + ret := _m.Called(ctx, originalTokenAddr, networkID, forUpdate, dbTx) + + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint, bool, pgx.Tx) (*big.Int, error)); ok { + return rf(ctx, originalTokenAddr, networkID, forUpdate, dbTx) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint, bool, pgx.Tx) *big.Int); ok { + r0 = rf(ctx, originalTokenAddr, networkID, forUpdate, dbTx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*big.Int) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint, bool, pgx.Tx) error); ok { + r1 = rf(ctx, originalTokenAddr, networkID, forUpdate, dbTx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // GetDeposit provides a mock function with given fields: ctx, depositCounterUser, networkID, dbTx func (_m *storageMock) GetDeposit(ctx context.Context, depositCounterUser uint, networkID uint, dbTx pgx.Tx) (*etherman.Deposit, error) { ret := _m.Called(ctx, depositCounterUser, networkID, dbTx) @@ -398,6 +428,20 @@ func (_m *storageMock) Rollback(ctx context.Context, dbTx pgx.Tx) error { return r0 } +// SetBridgeBalance provides a mock function with given fields: ctx, originalTokenAddr, networkID, balance, dbTx +func (_m *storageMock) SetBridgeBalance(ctx context.Context, originalTokenAddr common.Address, networkID uint, balance *big.Int, dbTx pgx.Tx) error { + ret := _m.Called(ctx, originalTokenAddr, networkID, balance, dbTx) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint, *big.Int, pgx.Tx) error); ok { + r0 = rf(ctx, originalTokenAddr, networkID, balance, dbTx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + type mockConstructorTestingTnewStorageMock interface { mock.TestingT Cleanup(func()) diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index 8e84b313..96fc3383 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -649,7 +649,7 @@ func (s *ClientSynchronizer) processClaim(claim etherman.Claim, blockID uint64, return err } - return s.afterProcessClaim(&claim) + return s.afterProcessClaim(&claim, dbTx) } func (s *ClientSynchronizer) processTokenWrapped(tokenWrapped etherman.TokenWrapped, blockID uint64, dbTx pgx.Tx) error { diff --git a/synchronizer/synchronizer_xlayer.go b/synchronizer/synchronizer_xlayer.go index 0bcbeaf8..15674cd1 100644 --- a/synchronizer/synchronizer_xlayer.go +++ b/synchronizer/synchronizer_xlayer.go @@ -15,11 +15,14 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/pushtask" "github.com/0xPolygonHermez/zkevm-bridge-service/server/tokenlogoinfo" "github.com/0xPolygonHermez/zkevm-bridge-service/utils" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils/messagebridge" "github.com/jackc/pgx/v4" + "github.com/pkg/errors" ) const ( - num1 = 1 + num1 = 1 + wstETHRedisLockKey = "wst_eth_l2_token_not_withdrawn_lock_" ) var ( @@ -27,17 +30,13 @@ var ( ) func (s *ClientSynchronizer) beforeProcessDeposit(deposit *etherman.Deposit) { - // If the deposit is USDC LxLy message, extract the user address from the metadata - if deposit.LeafType == uint8(utils.LeafTypeMessage) && utils.IsUSDCContractAddress(deposit.OriginalAddress) { - deposit.DestContractAddress = deposit.DestinationAddress - deposit.DestinationAddress, _ = utils.DecodeUSDCBridgeMetadata(deposit.Metadata) - } + messagebridge.ReplaceDepositDestAddresses(deposit) } func (s *ClientSynchronizer) afterProcessDeposit(deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error { // Add the deposit to Redis for L1 if deposit.NetworkID == 0 { - err := s.redisStorage.AddBlockDeposit(context.Background(), deposit) + err := s.redisStorage.AddBlockDeposit(s.ctx, deposit) if err != nil { log.Errorf("networkID: %d, failed to add block deposit to Redis, BlockNumber: %d, Deposit: %+v, err: %s", s.networkID, deposit.BlockNumber, deposit, err) rollbackErr := s.storage.Rollback(s.ctx, dbTx) @@ -50,10 +49,22 @@ func (s *ClientSynchronizer) afterProcessDeposit(deposit *etherman.Deposit, depo } } + err := s.processWstETHDeposit(deposit, dbTx) + if err != nil { + log.Errorf("networkID: %d, failed to process wstETH deposit, BlockNumber: %d, Deposit: %+v, err: %s", s.networkID, deposit.BlockNumber, deposit, err) + rollbackErr := s.storage.Rollback(s.ctx, dbTx) + if rollbackErr != nil { + log.Errorf("networkID: %d, error rolling back state to store block. BlockNumber: %v, rollbackErr: %v, err: %s", + s.networkID, deposit.BlockNumber, rollbackErr, err.Error()) + return rollbackErr + } + return err + } + // Original address is needed for message allow list check, but it may be changed when we replace USDC info origAddress := deposit.OriginalAddress // Replace the USDC info here so that the metrics can report the correct token info - utils.ReplaceUSDCDepositInfo(deposit, true) + messagebridge.ReplaceDepositInfo(deposit, true) // Notify FE about a new deposit go func() { @@ -62,7 +73,7 @@ func (s *ClientSynchronizer) afterProcessDeposit(deposit *etherman.Deposit, depo return } if deposit.LeafType != uint8(utils.LeafTypeAsset) { - if !utils.IsUSDCContractAddress(origAddress) { + if !messagebridge.IsAllowedContractAddress(origAddress) { log.Infof("transaction is not asset, so skip push update change, hash: %v", deposit.TxHash) return } @@ -108,6 +119,7 @@ func (s *ClientSynchronizer) afterProcessDeposit(deposit *etherman.Deposit, depo metrics.RecordOrder(uint32(deposit.NetworkID), uint32(deposit.DestinationNetwork), uint32(deposit.LeafType), uint32(deposit.OriginalNetwork), deposit.OriginalAddress, deposit.Amount) return nil } + func (s *ClientSynchronizer) filterLargeTransaction(ctx context.Context, transaction *pb.Transaction, chainId uint) { if transaction.LogoInfo == nil { log.Infof("failed to get logo info, so skip filter large transaction, tx: %v", transaction.GetTxHash()) @@ -170,7 +182,37 @@ func (s *ClientSynchronizer) getEstimateTimeForDepositCreated(networkId uint) ui return uint32(pushtask.GetAvgCommitDuration(s.ctx, s.redisStorage)) } -func (s *ClientSynchronizer) afterProcessClaim(claim *etherman.Claim) error { +func (s *ClientSynchronizer) afterProcessClaim(claim *etherman.Claim, dbTx pgx.Tx) error { + originNetwork := uint(0) + if !claim.MainnetFlag { + originNetwork = uint(claim.RollupIndex + 1) + } + + // Retrieve deposit transaction info + deposit, err := s.storage.GetDeposit(s.ctx, claim.Index, originNetwork, nil) + if err != nil { + log.Errorf("networkID: %d, get deposit error, BlockNumber: %d, Deposit: %+v, err: %s", s.networkID, deposit.BlockNumber, deposit, err) + rollbackErr := s.storage.Rollback(s.ctx, dbTx) + if rollbackErr != nil { + log.Errorf("networkID: %d, error rolling back state to store block. BlockNumber: %v, rollbackErr: %v, err: %s", + s.networkID, deposit.BlockNumber, rollbackErr, err.Error()) + return rollbackErr + } + return err + } + + err = s.processWstETHClaim(deposit, dbTx) + if err != nil { + log.Errorf("networkID: %d, processWstETHClaim error, BlockNumber: %d, Deposit: %+v, err: %s", s.networkID, deposit.BlockNumber, deposit, err) + rollbackErr := s.storage.Rollback(s.ctx, dbTx) + if rollbackErr != nil { + log.Errorf("networkID: %d, error rolling back state to store block. BlockNumber: %v, rollbackErr: %v, err: %s", + s.networkID, deposit.BlockNumber, rollbackErr, err.Error()) + return rollbackErr + } + return err + } + // Notify FE that the tx has been claimed go func() { if s.messagePushProducer == nil { @@ -178,19 +220,8 @@ func (s *ClientSynchronizer) afterProcessClaim(claim *etherman.Claim) error { return } - originNetwork := uint(0) - if !claim.MainnetFlag { - originNetwork = uint(claim.RollupIndex + 1) - } - - // Retrieve deposit transaction info - deposit, err := s.storage.GetDeposit(s.ctx, claim.Index, originNetwork, nil) - if err != nil { - log.Errorf("push message: GetDeposit error: %v", err) - return - } if deposit.LeafType != uint8(utils.LeafTypeAsset) { - if !utils.IsUSDCContractAddress(deposit.OriginalAddress) { + if !messagebridge.IsAllowedContractAddress(deposit.OriginalAddress) { log.Infof("transaction is not asset, so skip push update change, hash: %v", deposit.TxHash) return } @@ -234,3 +265,52 @@ func (s *ClientSynchronizer) recordLatestBlockNum() { metrics.RecordLatestBlockNum(uint32(s.networkID), header.Number.Uint64()) } } + +// processWstETHDeposit increases the l2TokenNotWithdrawn value for wstETH bridge, used for reconciliation purpose +func (s *ClientSynchronizer) processWstETHDeposit(deposit *etherman.Deposit, dbTx pgx.Tx) error { + amount := deposit.Amount + processor := messagebridge.GetProcessorByType(messagebridge.WstETH) + if processor == nil || !processor.CheckContractAddress(deposit.OriginalAddress) { + return nil + } + _, amount = processor.DecodeMetadataFn(deposit.Metadata) + return s.processWstETHCommon(deposit, func(value *big.Int) { + value.Add(value, amount) + }, dbTx) +} + +// processWstETHClaim decrease the l2TokenNotWithdrawn value for wstETH bridge, used for reconciliation purpose +func (s *ClientSynchronizer) processWstETHClaim(deposit *etherman.Deposit, dbTx pgx.Tx) error { + amount := deposit.Amount + processor := messagebridge.GetProcessorByType(messagebridge.WstETH) + if processor == nil || !processor.CheckContractAddress(deposit.OriginalAddress) { + return nil + } + _, amount = processor.DecodeMetadataFn(deposit.Metadata) + return s.processWstETHCommon(deposit, func(value *big.Int) { + value.Sub(value, amount) + }, dbTx) +} + +func (s *ClientSynchronizer) processWstETHCommon(deposit *etherman.Deposit, valueUpdateFn func(*big.Int), dbTx pgx.Tx) error { + processor := messagebridge.GetProcessorByType(messagebridge.WstETH) + if processor == nil { + return nil + } + // Check if this deposit is for wstETH + if !processor.CheckContractAddress(deposit.OriginalAddress) { + return nil + } + + // Update DB using the token original address + tokenAddr := processor.GetTokenAddressList()[0] + value, err := s.storage.GetBridgeBalance(s.ctx, tokenAddr, deposit.NetworkID, true, dbTx) + if err != nil { + return errors.Wrap(err, "GetBridgeBalance from DB err") + } + // Update the value + valueUpdateFn(value) + log.Debugf("setting wstETH bridgeBalance to %v, network_id = %v", value.String(), deposit.NetworkID) + err = s.storage.SetBridgeBalance(s.ctx, tokenAddr, deposit.NetworkID, value, dbTx) + return errors.Wrap(err, "SetBridgeBalance to DB err") +} diff --git a/utils/messagebridge/processor.go b/utils/messagebridge/processor.go new file mode 100644 index 00000000..237cdd67 --- /dev/null +++ b/utils/messagebridge/processor.go @@ -0,0 +1,133 @@ +package messagebridge + +import ( + "math/big" + + "github.com/0xPolygonHermez/zkevm-bridge-service/etherman" + "github.com/0xPolygonHermez/zkevm-bridge-service/utils" + "github.com/ethereum/go-ethereum/common" +) + +type ProcessorType int + +const ( + USDC ProcessorType = iota + WstETH +) + +var ( + emptyAddress = common.Address{} + processorMap = make(map[ProcessorType]*Processor) +) + +// Processor hosts the processing functions for an LxLy bridge using the message bridge feature +// Each Processor object should be used for one type of bridged token only +// Current supported tokens: USDC, wstETH +type Processor struct { + contractToTokenMapping map[common.Address]common.Address + // DecodeMetadata decodes the metadata of the message bridge, returns the actual destination address and bridged amount + DecodeMetadataFn func(metadata []byte) (common.Address, *big.Int) +} + +// GetContractAddressList returns the list of contract addresses that need to be processed through this struct +func (u *Processor) GetContractAddressList() []common.Address { + result := make([]common.Address, 0) + for addr := range u.contractToTokenMapping { + result = append(result, addr) + } + return result +} + +// GetTokenAddressList returns the list of original token addresses +func (u *Processor) GetTokenAddressList() []common.Address { + result := make([]common.Address, 0) + for _, addr := range u.contractToTokenMapping { + result = append(result, addr) + } + return result +} + +// CheckContractAddress returns true if the input address is in the contract address list of this bridge +func (u *Processor) CheckContractAddress(address common.Address) bool { + if _, ok := u.contractToTokenMapping[address]; ok { + return true + } + return false +} + +// GetTokenFromContract return the token address from the bridge contract address, for displaying +func (u *Processor) GetTokenFromContract(contractAddress common.Address) (common.Address, bool) { + if token, ok := u.contractToTokenMapping[contractAddress]; ok { + return token, true + } + return common.Address{}, false +} + +// ReplaceDepositInfo replaces the info of the deposit based on the address mapping +// Info to be replaced: amount, original token address +func (u *Processor) ReplaceDepositInfo(deposit *etherman.Deposit, overwriteOrigNetworkID bool) { + token, ok := u.GetTokenFromContract(deposit.OriginalAddress) + if !ok { + return + } + deposit.OriginalAddress = token + if overwriteOrigNetworkID { + deposit.OriginalNetwork = 0 // Always use 0 for this case when reporting metrics + } + _, deposit.Amount = u.DecodeMetadataFn(deposit.Metadata) +} + +// getProcessor returns the correct message bridge processor for the address +func getProcessor(address common.Address) *Processor { + for _, processor := range processorMap { + if processor.CheckContractAddress(address) { + return processor + } + } + return nil +} + +func GetProcessorByType(t ProcessorType) *Processor { + return processorMap[t] +} + +func GetContractAddressList() []common.Address { + result := make([]common.Address, 0) + // Get all contract addresses from the lists + for _, processor := range processorMap { + result = append(result, processor.GetContractAddressList()...) + } + return result +} + +func IsAllowedContractAddress(address common.Address) bool { + for _, processor := range processorMap { + if processor.CheckContractAddress(address) { + return true + } + } + return false +} + +// ReplaceDepositDestAddresses swaps the actual dest address and the contract address so that we can query using the user's address from DB +func ReplaceDepositDestAddresses(deposit *etherman.Deposit) { + if deposit.LeafType != uint8(utils.LeafTypeMessage) { + // Only process message bridges + return + } + processor := getProcessor(deposit.OriginalAddress) + if processor == nil { + // Cannot find any valid processor + return + } + deposit.DestContractAddress = deposit.DestinationAddress + deposit.DestinationAddress, _ = processor.DecodeMetadataFn(deposit.Metadata) +} + +func ReplaceDepositInfo(deposit *etherman.Deposit, overwriteOrigNetworkID bool) { + processor := getProcessor(deposit.OriginalAddress) + if processor == nil { + return + } + processor.ReplaceDepositInfo(deposit, overwriteOrigNetworkID) +} diff --git a/utils/messagebridge/usdclxly.go b/utils/messagebridge/usdclxly.go new file mode 100644 index 00000000..92c0ebf5 --- /dev/null +++ b/utils/messagebridge/usdclxly.go @@ -0,0 +1,37 @@ +package messagebridge + +import ( + "math/big" + + "github.com/0xPolygonHermez/zkevm-bridge-service/log" + "github.com/ethereum/go-ethereum/common" +) + +func InitUSDCLxLyProcessor(usdcContractAddresses, usdcTokenAddresses []common.Address) { + log.Debugf("USDCLxLyMapping: contracts[%v] tokens[%v]", usdcContractAddresses, usdcTokenAddresses) + if len(usdcContractAddresses) != len(usdcTokenAddresses) { + log.Errorf("InitUSDCLxLyProcessor: contract addresses (%v) and token addresses (%v) have different length", len(usdcContractAddresses), len(usdcTokenAddresses)) + } + + contractToTokenMapping := make(map[common.Address]common.Address) + l := min(len(usdcContractAddresses), len(usdcTokenAddresses)) + for i := 0; i < l; i++ { + if usdcTokenAddresses[i] == emptyAddress { + continue + } + contractToTokenMapping[usdcContractAddresses[i]] = usdcTokenAddresses[i] + } + + if len(contractToTokenMapping) > 0 { + processorMap[USDC] = &Processor{ + contractToTokenMapping: contractToTokenMapping, + DecodeMetadataFn: func(metadata []byte) (common.Address, *big.Int) { + // Metadata structure: + // - Destination address: 32 bytes + // - Bridging amount: 32 bytes + // Maybe there's a more elegant way? + return common.BytesToAddress(metadata[:32]), new(big.Int).SetBytes(metadata[32:]) //nolint:gomnd + }, + } + } +} diff --git a/utils/messagebridge/usdclxly_test.go b/utils/messagebridge/usdclxly_test.go new file mode 100644 index 00000000..64ce9349 --- /dev/null +++ b/utils/messagebridge/usdclxly_test.go @@ -0,0 +1,37 @@ +package messagebridge + +import ( + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestUSDCLxLyMapping(t *testing.T) { + contractAddr1 := common.HexToAddress("0xfe3240995c771f10D2583e8fa95F92ee40E15150") + contractAddr2 := common.HexToAddress("0x1A8C4999D32F05B63A227517Be0824AeD47e4728") + contractAddr3 := common.HexToAddress("0xfe3240995c771f10D2583e8fa95F92ee40E15151") + tokenAddr1 := common.HexToAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48") + tokenAddr2 := common.HexToAddress("0x00d69D72a429d4985b34A8E1A6C9e47997F0aFA3") + + InitUSDCLxLyProcessor([]common.Address{contractAddr1, contractAddr2}, []common.Address{tokenAddr1, tokenAddr2}) + require.Len(t, processorMap, 1) + processor := GetProcessorByType(USDC) + require.NotNil(t, processor) + + list := processor.GetContractAddressList() + require.Len(t, list, 2) + require.Contains(t, list, contractAddr1) + require.Contains(t, list, contractAddr2) + + require.True(t, processor.CheckContractAddress(contractAddr1)) + require.True(t, processor.CheckContractAddress(contractAddr2)) + require.False(t, processor.CheckContractAddress(contractAddr3)) + + token, ok := processor.GetTokenFromContract(contractAddr2) + require.True(t, ok) + require.Equal(t, tokenAddr2, token) + + _, ok = processor.GetTokenFromContract(contractAddr3) + require.False(t, ok) +} diff --git a/utils/messagebridge/wsteth.go b/utils/messagebridge/wsteth.go new file mode 100644 index 00000000..7d8f27af --- /dev/null +++ b/utils/messagebridge/wsteth.go @@ -0,0 +1,37 @@ +package messagebridge + +import ( + "math/big" + + "github.com/0xPolygonHermez/zkevm-bridge-service/log" + "github.com/ethereum/go-ethereum/common" +) + +func InitWstETHProcessor(wstETHContractAddresses, wstETHTokenAddresses []common.Address) { + log.Debugf("WstETHMapping: contracts[%v] tokens[%v]", wstETHContractAddresses, wstETHTokenAddresses) + if len(wstETHContractAddresses) != len(wstETHTokenAddresses) { + log.Errorf("InitWstETHProcessor: contract addresses (%v) and token addresses (%v) have different length", len(wstETHContractAddresses), len(wstETHTokenAddresses)) + } + + contractToTokenMapping := make(map[common.Address]common.Address) + l := min(len(wstETHContractAddresses), len(wstETHTokenAddresses)) + for i := 0; i < l; i++ { + if wstETHTokenAddresses[i] == emptyAddress { + continue + } + contractToTokenMapping[wstETHContractAddresses[i]] = wstETHTokenAddresses[i] + } + + if len(contractToTokenMapping) > 0 { + processorMap[WstETH] = &Processor{ + contractToTokenMapping: contractToTokenMapping, + DecodeMetadataFn: func(metadata []byte) (common.Address, *big.Int) { + // Metadata structure: + // - Destination address: 32 bytes + // - Bridging amount: 32 bytes + // Maybe there's a more elegant way? + return common.BytesToAddress(metadata[:32]), new(big.Int).SetBytes(metadata[32:]) //nolint:gomnd + }, + } + } +} diff --git a/utils/usdclxly.go b/utils/usdclxly.go deleted file mode 100644 index c05e4919..00000000 --- a/utils/usdclxly.go +++ /dev/null @@ -1,74 +0,0 @@ -package utils - -import ( - "math/big" - - "github.com/0xPolygonHermez/zkevm-bridge-service/etherman" - "github.com/0xPolygonHermez/zkevm-bridge-service/log" - "github.com/ethereum/go-ethereum/common" -) - -var ( - usdcContractToTokenMapping map[common.Address]common.Address - emptyAddress = common.Address{} -) - -func InitUSDCLxLyMapping(usdcContractAddresses, usdcTokenAddresses []common.Address) { - log.Debugf("USDCLxLyMapping: contracts[%v] tokens[%v]", usdcContractAddresses, usdcTokenAddresses) - if len(usdcContractAddresses) != len(usdcTokenAddresses) { - log.Errorf("InitUSDCLxLyMapping: contract addresses (%v) and token addresses (%v) have different length", len(usdcContractAddresses), len(usdcTokenAddresses)) - } - - usdcContractToTokenMapping = make(map[common.Address]common.Address) - l := min(len(usdcContractAddresses), len(usdcTokenAddresses)) - for i := 0; i < l; i++ { - if usdcTokenAddresses[i] == emptyAddress { - continue - } - usdcContractToTokenMapping[usdcContractAddresses[i]] = usdcTokenAddresses[i] - } -} - -func GetUSDCContractAddressList() []common.Address { - result := make([]common.Address, 0) - for addr := range usdcContractToTokenMapping { - result = append(result, addr) - } - return result -} - -func IsUSDCContractAddress(address common.Address) bool { - if _, ok := usdcContractToTokenMapping[address]; ok { - return true - } - return false -} - -func GetUSDCTokenFromContract(contractAddress common.Address) (common.Address, bool) { - if token, ok := usdcContractToTokenMapping[contractAddress]; ok { - return token, true - } - return common.Address{}, false -} - -// DecodeUSDCBridgeMetadata extracts the user's account address from the metadata of USDC bridge -// Metadata structure: -// - Destination address: 32 bytes -// - Bridging amount: 32 bytes -func DecodeUSDCBridgeMetadata(metadata []byte) (common.Address, *big.Int) { - // Convert the first 32 bytes to address, and last 32 bytes to big int - // Maybe there's a more elegant way? - return common.BytesToAddress(metadata[:32]), new(big.Int).SetBytes(metadata[32:]) //nolint:gomnd -} - -func ReplaceUSDCDepositInfo(deposit *etherman.Deposit, overwriteOrigNetworkID bool) { - token, ok := GetUSDCTokenFromContract(deposit.OriginalAddress) - if !ok { - return - } - deposit.OriginalAddress = token - if overwriteOrigNetworkID { - deposit.OriginalNetwork = 0 // Always use 0 for this case when reporting metrics - } - _, deposit.Amount = DecodeUSDCBridgeMetadata(deposit.Metadata) -} diff --git a/utils/usdclxly_test.go b/utils/usdclxly_test.go deleted file mode 100644 index 494909ae..00000000 --- a/utils/usdclxly_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package utils - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/require" -) - -func TestUSDCLxLyMapping(t *testing.T) { - contractAddr1 := common.HexToAddress("0xfe3240995c771f10D2583e8fa95F92ee40E15150") - contractAddr2 := common.HexToAddress("0x1A8C4999D32F05B63A227517Be0824AeD47e4728") - contractAddr3 := common.HexToAddress("0xfe3240995c771f10D2583e8fa95F92ee40E15151") - tokenAddr1 := common.HexToAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48") - tokenAddr2 := common.HexToAddress("0x00d69D72a429d4985b34A8E1A6C9e47997F0aFA3") - - InitUSDCLxLyMapping([]common.Address{contractAddr1, contractAddr2}, []common.Address{tokenAddr1, tokenAddr2}) - - list := GetUSDCContractAddressList() - require.Len(t, list, 2) - require.Contains(t, list, contractAddr1) - require.Contains(t, list, contractAddr2) - - require.True(t, IsUSDCContractAddress(contractAddr1)) - require.True(t, IsUSDCContractAddress(contractAddr2)) - require.False(t, IsUSDCContractAddress(contractAddr3)) - - token, ok := GetUSDCTokenFromContract(contractAddr2) - require.True(t, ok) - require.Equal(t, tokenAddr2, token) - - _, ok = GetUSDCTokenFromContract(contractAddr3) - require.False(t, ok) -} - -func TestDecodeUSDCBridgeMetadata(t *testing.T) { - metadata := common.Hex2Bytes("00000000000000000000000023335657622dcc27bb1914e51cdc30871d6d04d300000000000000000000000000000000000000000000000000000000000f4240") - addr := common.HexToAddress("0x23335657622dcc27bb1914e51cdc30871d6d04d3") - amount := new(big.Int).SetUint64(1000000) - - addr1, amount1 := DecodeUSDCBridgeMetadata(metadata) - require.Equal(t, addr, addr1) - require.Equal(t, amount, amount1) -}