node: remove batchVAA remnants
This commit is contained in:
parent
62ce7d48f3
commit
937af99b94
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -175,132 +175,6 @@ func local_request_PublicRPCService_GetSignedVAA_0(ctx context.Context, marshale
|
|||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_PublicRPCService_GetSignedBatchVAA_0 = &utilities.DoubleArray{Encoding: map[string]int{"batch_id": 0, "emitter_chain": 1, "tx_id": 2, "nonce": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}}
|
||||
)
|
||||
|
||||
func request_PublicRPCService_GetSignedBatchVAA_0(ctx context.Context, marshaler runtime.Marshaler, client PublicRPCServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetSignedBatchVAARequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
e int32
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["batch_id.emitter_chain"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.emitter_chain")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.emitter_chain", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.emitter_chain", err)
|
||||
}
|
||||
|
||||
e, err = runtime.Enum(val, ChainID_value)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "could not parse path as enum value, parameter: %s, error: %v", "batch_id.emitter_chain", err)
|
||||
}
|
||||
|
||||
protoReq.BatchId.EmitterChain = ChainID(e)
|
||||
|
||||
val, ok = pathParams["batch_id.tx_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.tx_id")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.tx_id", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.tx_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["batch_id.nonce"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.nonce")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.nonce", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.nonce", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PublicRPCService_GetSignedBatchVAA_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetSignedBatchVAA(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_PublicRPCService_GetSignedBatchVAA_0(ctx context.Context, marshaler runtime.Marshaler, server PublicRPCServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetSignedBatchVAARequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
e int32
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["batch_id.emitter_chain"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.emitter_chain")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.emitter_chain", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.emitter_chain", err)
|
||||
}
|
||||
|
||||
e, err = runtime.Enum(val, ChainID_value)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "could not parse path as enum value, parameter: %s, error: %v", "batch_id.emitter_chain", err)
|
||||
}
|
||||
|
||||
protoReq.BatchId.EmitterChain = ChainID(e)
|
||||
|
||||
val, ok = pathParams["batch_id.tx_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.tx_id")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.tx_id", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.tx_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["batch_id.nonce"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_id.nonce")
|
||||
}
|
||||
|
||||
err = runtime.PopulateFieldFromPath(&protoReq, "batch_id.nonce", val)
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_id.nonce", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PublicRPCService_GetSignedBatchVAA_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetSignedBatchVAA(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_PublicRPCService_GetCurrentGuardianSet_0(ctx context.Context, marshaler runtime.Marshaler, client PublicRPCServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetCurrentGuardianSetRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
@ -551,29 +425,6 @@ func RegisterPublicRPCServiceHandlerServer(ctx context.Context, mux *runtime.Ser
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_PublicRPCService_GetSignedBatchVAA_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)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/publicrpc.v1.PublicRPCService/GetSignedBatchVAA", runtime.WithHTTPPathPattern("/v1/signed_batch_vaa/{batch_id.emitter_chain}/{batch_id.tx_id}/{batch_id.nonce}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_PublicRPCService_GetSignedBatchVAA_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_PublicRPCService_GetSignedBatchVAA_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_PublicRPCService_GetCurrentGuardianSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
|
@ -770,26 +621,6 @@ func RegisterPublicRPCServiceHandlerClient(ctx context.Context, mux *runtime.Ser
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_PublicRPCService_GetSignedBatchVAA_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)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/publicrpc.v1.PublicRPCService/GetSignedBatchVAA", runtime.WithHTTPPathPattern("/v1/signed_batch_vaa/{batch_id.emitter_chain}/{batch_id.tx_id}/{batch_id.nonce}"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_PublicRPCService_GetSignedBatchVAA_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_PublicRPCService_GetSignedBatchVAA_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_PublicRPCService_GetCurrentGuardianSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
|
@ -898,8 +729,6 @@ var (
|
|||
|
||||
pattern_PublicRPCService_GetSignedVAA_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "signed_vaa", "message_id.emitter_chain", "message_id.emitter_address", "message_id.sequence"}, ""))
|
||||
|
||||
pattern_PublicRPCService_GetSignedBatchVAA_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "signed_batch_vaa", "batch_id.emitter_chain", "batch_id.tx_id", "batch_id.nonce"}, ""))
|
||||
|
||||
pattern_PublicRPCService_GetCurrentGuardianSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "guardianset", "current"}, ""))
|
||||
|
||||
pattern_PublicRPCService_GovernorGetAvailableNotionalByChain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "governor", "available_notional_by_chain"}, ""))
|
||||
|
@ -916,8 +745,6 @@ var (
|
|||
|
||||
forward_PublicRPCService_GetSignedVAA_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_PublicRPCService_GetSignedBatchVAA_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_PublicRPCService_GetCurrentGuardianSet_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_PublicRPCService_GovernorGetAvailableNotionalByChain_0 = runtime.ForwardResponseMessage
|
||||
|
|
|
@ -23,7 +23,6 @@ type PublicRPCServiceClient interface {
|
|||
// The heartbeat value is null if no heartbeat has yet been received.
|
||||
GetLastHeartbeats(ctx context.Context, in *GetLastHeartbeatsRequest, opts ...grpc.CallOption) (*GetLastHeartbeatsResponse, error)
|
||||
GetSignedVAA(ctx context.Context, in *GetSignedVAARequest, opts ...grpc.CallOption) (*GetSignedVAAResponse, error)
|
||||
GetSignedBatchVAA(ctx context.Context, in *GetSignedBatchVAARequest, opts ...grpc.CallOption) (*GetSignedBatchVAAResponse, error)
|
||||
GetCurrentGuardianSet(ctx context.Context, in *GetCurrentGuardianSetRequest, opts ...grpc.CallOption) (*GetCurrentGuardianSetResponse, error)
|
||||
GovernorGetAvailableNotionalByChain(ctx context.Context, in *GovernorGetAvailableNotionalByChainRequest, opts ...grpc.CallOption) (*GovernorGetAvailableNotionalByChainResponse, error)
|
||||
GovernorGetEnqueuedVAAs(ctx context.Context, in *GovernorGetEnqueuedVAAsRequest, opts ...grpc.CallOption) (*GovernorGetEnqueuedVAAsResponse, error)
|
||||
|
@ -57,15 +56,6 @@ func (c *publicRPCServiceClient) GetSignedVAA(ctx context.Context, in *GetSigned
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publicRPCServiceClient) GetSignedBatchVAA(ctx context.Context, in *GetSignedBatchVAARequest, opts ...grpc.CallOption) (*GetSignedBatchVAAResponse, error) {
|
||||
out := new(GetSignedBatchVAAResponse)
|
||||
err := c.cc.Invoke(ctx, "/publicrpc.v1.PublicRPCService/GetSignedBatchVAA", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *publicRPCServiceClient) GetCurrentGuardianSet(ctx context.Context, in *GetCurrentGuardianSetRequest, opts ...grpc.CallOption) (*GetCurrentGuardianSetResponse, error) {
|
||||
out := new(GetCurrentGuardianSetResponse)
|
||||
err := c.cc.Invoke(ctx, "/publicrpc.v1.PublicRPCService/GetCurrentGuardianSet", in, out, opts...)
|
||||
|
@ -120,7 +110,6 @@ type PublicRPCServiceServer interface {
|
|||
// The heartbeat value is null if no heartbeat has yet been received.
|
||||
GetLastHeartbeats(context.Context, *GetLastHeartbeatsRequest) (*GetLastHeartbeatsResponse, error)
|
||||
GetSignedVAA(context.Context, *GetSignedVAARequest) (*GetSignedVAAResponse, error)
|
||||
GetSignedBatchVAA(context.Context, *GetSignedBatchVAARequest) (*GetSignedBatchVAAResponse, error)
|
||||
GetCurrentGuardianSet(context.Context, *GetCurrentGuardianSetRequest) (*GetCurrentGuardianSetResponse, error)
|
||||
GovernorGetAvailableNotionalByChain(context.Context, *GovernorGetAvailableNotionalByChainRequest) (*GovernorGetAvailableNotionalByChainResponse, error)
|
||||
GovernorGetEnqueuedVAAs(context.Context, *GovernorGetEnqueuedVAAsRequest) (*GovernorGetEnqueuedVAAsResponse, error)
|
||||
|
@ -139,9 +128,6 @@ func (UnimplementedPublicRPCServiceServer) GetLastHeartbeats(context.Context, *G
|
|||
func (UnimplementedPublicRPCServiceServer) GetSignedVAA(context.Context, *GetSignedVAARequest) (*GetSignedVAAResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSignedVAA not implemented")
|
||||
}
|
||||
func (UnimplementedPublicRPCServiceServer) GetSignedBatchVAA(context.Context, *GetSignedBatchVAARequest) (*GetSignedBatchVAAResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSignedBatchVAA not implemented")
|
||||
}
|
||||
func (UnimplementedPublicRPCServiceServer) GetCurrentGuardianSet(context.Context, *GetCurrentGuardianSetRequest) (*GetCurrentGuardianSetResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCurrentGuardianSet not implemented")
|
||||
}
|
||||
|
@ -206,24 +192,6 @@ func _PublicRPCService_GetSignedVAA_Handler(srv interface{}, ctx context.Context
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublicRPCService_GetSignedBatchVAA_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSignedBatchVAARequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PublicRPCServiceServer).GetSignedBatchVAA(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/publicrpc.v1.PublicRPCService/GetSignedBatchVAA",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PublicRPCServiceServer).GetSignedBatchVAA(ctx, req.(*GetSignedBatchVAARequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PublicRPCService_GetCurrentGuardianSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCurrentGuardianSetRequest)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -329,10 +297,6 @@ var PublicRPCService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "GetSignedVAA",
|
||||
Handler: _PublicRPCService_GetSignedVAA_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSignedBatchVAA",
|
||||
Handler: _PublicRPCService_GetSignedBatchVAA_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCurrentGuardianSet",
|
||||
Handler: _PublicRPCService_GetCurrentGuardianSet_Handler,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
package spyv1
|
||||
|
||||
import (
|
||||
v11 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1"
|
||||
_ "github.com/certusone/wormhole/node/pkg/proto/gossip/v1"
|
||||
v1 "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
@ -348,55 +348,6 @@ func (x *SubscribeSignedVAARequest) GetFilters() []*FilterEntry {
|
|||
return nil
|
||||
}
|
||||
|
||||
type SubscribeSignedVAAByTypeRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// List of filters to apply to the stream (OR).
|
||||
// If empty, all messages are streamed.
|
||||
Filters []*FilterEntry `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeRequest) Reset() {
|
||||
*x = SubscribeSignedVAAByTypeRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SubscribeSignedVAAByTypeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[5]
|
||||
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 SubscribeSignedVAAByTypeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SubscribeSignedVAAByTypeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_spy_v1_spy_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeRequest) GetFilters() []*FilterEntry {
|
||||
if x != nil {
|
||||
return x.Filters
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SubscribeSignedVAAResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
@ -409,7 +360,7 @@ type SubscribeSignedVAAResponse struct {
|
|||
func (x *SubscribeSignedVAAResponse) Reset() {
|
||||
*x = SubscribeSignedVAAResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[6]
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
@ -422,7 +373,7 @@ func (x *SubscribeSignedVAAResponse) String() string {
|
|||
func (*SubscribeSignedVAAResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SubscribeSignedVAAResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[6]
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
@ -435,7 +386,7 @@ func (x *SubscribeSignedVAAResponse) ProtoReflect() protoreflect.Message {
|
|||
|
||||
// Deprecated: Use SubscribeSignedVAAResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SubscribeSignedVAAResponse) Descriptor() ([]byte, []int) {
|
||||
return file_spy_v1_spy_proto_rawDescGZIP(), []int{6}
|
||||
return file_spy_v1_spy_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAResponse) GetVaaBytes() []byte {
|
||||
|
@ -445,88 +396,6 @@ func (x *SubscribeSignedVAAResponse) GetVaaBytes() []byte {
|
|||
return nil
|
||||
}
|
||||
|
||||
type SubscribeSignedVAAByTypeResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to VaaType:
|
||||
//
|
||||
// *SubscribeSignedVAAByTypeResponse_SignedVaa
|
||||
// *SubscribeSignedVAAByTypeResponse_SignedBatchVaa
|
||||
VaaType isSubscribeSignedVAAByTypeResponse_VaaType `protobuf_oneof:"vaa_type"`
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeResponse) Reset() {
|
||||
*x = SubscribeSignedVAAByTypeResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SubscribeSignedVAAByTypeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_spy_v1_spy_proto_msgTypes[7]
|
||||
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 SubscribeSignedVAAByTypeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SubscribeSignedVAAByTypeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_spy_v1_spy_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (m *SubscribeSignedVAAByTypeResponse) GetVaaType() isSubscribeSignedVAAByTypeResponse_VaaType {
|
||||
if m != nil {
|
||||
return m.VaaType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeResponse) GetSignedVaa() *v11.SignedVAAWithQuorum {
|
||||
if x, ok := x.GetVaaType().(*SubscribeSignedVAAByTypeResponse_SignedVaa); ok {
|
||||
return x.SignedVaa
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SubscribeSignedVAAByTypeResponse) GetSignedBatchVaa() *v11.SignedBatchVAAWithQuorum {
|
||||
if x, ok := x.GetVaaType().(*SubscribeSignedVAAByTypeResponse_SignedBatchVaa); ok {
|
||||
return x.SignedBatchVaa
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isSubscribeSignedVAAByTypeResponse_VaaType interface {
|
||||
isSubscribeSignedVAAByTypeResponse_VaaType()
|
||||
}
|
||||
|
||||
type SubscribeSignedVAAByTypeResponse_SignedVaa struct {
|
||||
SignedVaa *v11.SignedVAAWithQuorum `protobuf:"bytes,1,opt,name=signed_vaa,json=signedVaa,proto3,oneof"`
|
||||
}
|
||||
|
||||
type SubscribeSignedVAAByTypeResponse_SignedBatchVaa struct {
|
||||
SignedBatchVaa *v11.SignedBatchVAAWithQuorum `protobuf:"bytes,2,opt,name=signed_batch_vaa,json=signedBatchVaa,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*SubscribeSignedVAAByTypeResponse_SignedVaa) isSubscribeSignedVAAByTypeResponse_VaaType() {}
|
||||
|
||||
func (*SubscribeSignedVAAByTypeResponse_SignedBatchVaa) isSubscribeSignedVAAByTypeResponse_VaaType() {
|
||||
}
|
||||
|
||||
var File_spy_v1_spy_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_spy_v1_spy_proto_rawDesc = []byte{
|
||||
|
@ -576,51 +445,24 @@ var file_spy_v1_spy_proto_rawDesc = []byte{
|
|||
0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18,
|
||||
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x46,
|
||||
0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74,
|
||||
0x65, 0x72, 0x73, 0x22, 0x50, 0x0a, 0x1f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||
0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x42, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
|
||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x66, 0x69,
|
||||
0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x39, 0x0a, 0x1a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x61, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x76, 0x61, 0x61, 0x42, 0x79, 0x74, 0x65, 0x73,
|
||||
0x22, 0xc0, 0x01, 0x0a, 0x20, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x42, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f,
|
||||
0x76, 0x61, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x73,
|
||||
0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x57,
|
||||
0x69, 0x74, 0x68, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67,
|
||||
0x6e, 0x65, 0x64, 0x56, 0x61, 0x61, 0x12, 0x4f, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64,
|
||||
0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x76, 0x61, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x23, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x65, 0x64, 0x42, 0x61, 0x74, 0x63, 0x68, 0x56, 0x41, 0x41, 0x57, 0x69, 0x74, 0x68, 0x51,
|
||||
0x75, 0x6f, 0x72, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42,
|
||||
0x61, 0x74, 0x63, 0x68, 0x56, 0x61, 0x61, 0x42, 0x0a, 0x0a, 0x08, 0x76, 0x61, 0x61, 0x5f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x32, 0xb3, 0x02, 0x0a, 0x0d, 0x53, 0x70, 0x79, 0x52, 0x50, 0x43, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
|
||||
0x69, 0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x12, 0x21, 0x2e, 0x73,
|
||||
0x70, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53,
|
||||
0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x22, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||
0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x76, 0x31,
|
||||
0x3a, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65,
|
||||
0x64, 0x5f, 0x76, 0x61, 0x61, 0x3a, 0x01, 0x2a, 0x30, 0x01, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x53,
|
||||
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41,
|
||||
0x41, 0x42, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31,
|
||||
0x65, 0x72, 0x73, 0x22, 0x39, 0x0a, 0x1a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||
0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x61, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x76, 0x61, 0x61, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x94,
|
||||
0x01, 0x0a, 0x0d, 0x53, 0x70, 0x79, 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x12, 0x82, 0x01, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x12, 0x21, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64,
|
||||
0x56, 0x41, 0x41, 0x42, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x28, 0x2e, 0x73, 0x70, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
|
||||
0x69, 0x62, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x42, 0x79, 0x54, 0x79,
|
||||
0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93,
|
||||
0x02, 0x25, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x3a, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
|
||||
0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x61, 0x5f, 0x62, 0x79, 0x5f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x3a, 0x01, 0x2a, 0x30, 0x01, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, 0x6f, 0x6e,
|
||||
0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f,
|
||||
0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x70, 0x79, 0x2f, 0x76, 0x31,
|
||||
0x3b, 0x73, 0x70, 0x79, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x56, 0x41, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x70, 0x79,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x65, 0x64, 0x56, 0x41, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x3a, 0x73, 0x75, 0x62, 0x73,
|
||||
0x63, 0x72, 0x69, 0x62, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x61,
|
||||
0x3a, 0x01, 0x2a, 0x30, 0x01, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x75, 0x73, 0x6f, 0x6e, 0x65, 0x2f, 0x77, 0x6f,
|
||||
0x72, 0x6d, 0x68, 0x6f, 0x6c, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x70, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x70, 0x79,
|
||||
0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -635,40 +477,31 @@ func file_spy_v1_spy_proto_rawDescGZIP() []byte {
|
|||
return file_spy_v1_spy_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_spy_v1_spy_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_spy_v1_spy_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_spy_v1_spy_proto_goTypes = []interface{}{
|
||||
(*EmitterFilter)(nil), // 0: spy.v1.EmitterFilter
|
||||
(*BatchFilter)(nil), // 1: spy.v1.BatchFilter
|
||||
(*BatchTransactionFilter)(nil), // 2: spy.v1.BatchTransactionFilter
|
||||
(*FilterEntry)(nil), // 3: spy.v1.FilterEntry
|
||||
(*SubscribeSignedVAARequest)(nil), // 4: spy.v1.SubscribeSignedVAARequest
|
||||
(*SubscribeSignedVAAByTypeRequest)(nil), // 5: spy.v1.SubscribeSignedVAAByTypeRequest
|
||||
(*SubscribeSignedVAAResponse)(nil), // 6: spy.v1.SubscribeSignedVAAResponse
|
||||
(*SubscribeSignedVAAByTypeResponse)(nil), // 7: spy.v1.SubscribeSignedVAAByTypeResponse
|
||||
(v1.ChainID)(0), // 8: publicrpc.v1.ChainID
|
||||
(*v11.SignedVAAWithQuorum)(nil), // 9: gossip.v1.SignedVAAWithQuorum
|
||||
(*v11.SignedBatchVAAWithQuorum)(nil), // 10: gossip.v1.SignedBatchVAAWithQuorum
|
||||
(*EmitterFilter)(nil), // 0: spy.v1.EmitterFilter
|
||||
(*BatchFilter)(nil), // 1: spy.v1.BatchFilter
|
||||
(*BatchTransactionFilter)(nil), // 2: spy.v1.BatchTransactionFilter
|
||||
(*FilterEntry)(nil), // 3: spy.v1.FilterEntry
|
||||
(*SubscribeSignedVAARequest)(nil), // 4: spy.v1.SubscribeSignedVAARequest
|
||||
(*SubscribeSignedVAAResponse)(nil), // 5: spy.v1.SubscribeSignedVAAResponse
|
||||
(v1.ChainID)(0), // 6: publicrpc.v1.ChainID
|
||||
}
|
||||
var file_spy_v1_spy_proto_depIdxs = []int32{
|
||||
8, // 0: spy.v1.EmitterFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
8, // 1: spy.v1.BatchFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
8, // 2: spy.v1.BatchTransactionFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
0, // 3: spy.v1.FilterEntry.emitter_filter:type_name -> spy.v1.EmitterFilter
|
||||
1, // 4: spy.v1.FilterEntry.batch_filter:type_name -> spy.v1.BatchFilter
|
||||
2, // 5: spy.v1.FilterEntry.batch_transaction_filter:type_name -> spy.v1.BatchTransactionFilter
|
||||
3, // 6: spy.v1.SubscribeSignedVAARequest.filters:type_name -> spy.v1.FilterEntry
|
||||
3, // 7: spy.v1.SubscribeSignedVAAByTypeRequest.filters:type_name -> spy.v1.FilterEntry
|
||||
9, // 8: spy.v1.SubscribeSignedVAAByTypeResponse.signed_vaa:type_name -> gossip.v1.SignedVAAWithQuorum
|
||||
10, // 9: spy.v1.SubscribeSignedVAAByTypeResponse.signed_batch_vaa:type_name -> gossip.v1.SignedBatchVAAWithQuorum
|
||||
4, // 10: spy.v1.SpyRPCService.SubscribeSignedVAA:input_type -> spy.v1.SubscribeSignedVAARequest
|
||||
5, // 11: spy.v1.SpyRPCService.SubscribeSignedVAAByType:input_type -> spy.v1.SubscribeSignedVAAByTypeRequest
|
||||
6, // 12: spy.v1.SpyRPCService.SubscribeSignedVAA:output_type -> spy.v1.SubscribeSignedVAAResponse
|
||||
7, // 13: spy.v1.SpyRPCService.SubscribeSignedVAAByType:output_type -> spy.v1.SubscribeSignedVAAByTypeResponse
|
||||
12, // [12:14] is the sub-list for method output_type
|
||||
10, // [10:12] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
6, // 0: spy.v1.EmitterFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
6, // 1: spy.v1.BatchFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
6, // 2: spy.v1.BatchTransactionFilter.chain_id:type_name -> publicrpc.v1.ChainID
|
||||
0, // 3: spy.v1.FilterEntry.emitter_filter:type_name -> spy.v1.EmitterFilter
|
||||
1, // 4: spy.v1.FilterEntry.batch_filter:type_name -> spy.v1.BatchFilter
|
||||
2, // 5: spy.v1.FilterEntry.batch_transaction_filter:type_name -> spy.v1.BatchTransactionFilter
|
||||
3, // 6: spy.v1.SubscribeSignedVAARequest.filters:type_name -> spy.v1.FilterEntry
|
||||
4, // 7: spy.v1.SpyRPCService.SubscribeSignedVAA:input_type -> spy.v1.SubscribeSignedVAARequest
|
||||
5, // 8: spy.v1.SpyRPCService.SubscribeSignedVAA:output_type -> spy.v1.SubscribeSignedVAAResponse
|
||||
8, // [8:9] is the sub-list for method output_type
|
||||
7, // [7:8] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_spy_v1_spy_proto_init() }
|
||||
|
@ -738,18 +571,6 @@ func file_spy_v1_spy_proto_init() {
|
|||
}
|
||||
}
|
||||
file_spy_v1_spy_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SubscribeSignedVAAByTypeRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_spy_v1_spy_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SubscribeSignedVAAResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -761,35 +582,19 @@ func file_spy_v1_spy_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_spy_v1_spy_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SubscribeSignedVAAByTypeResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_spy_v1_spy_proto_msgTypes[3].OneofWrappers = []interface{}{
|
||||
(*FilterEntry_EmitterFilter)(nil),
|
||||
(*FilterEntry_BatchFilter)(nil),
|
||||
(*FilterEntry_BatchTransactionFilter)(nil),
|
||||
}
|
||||
file_spy_v1_spy_proto_msgTypes[7].OneofWrappers = []interface{}{
|
||||
(*SubscribeSignedVAAByTypeResponse_SignedVaa)(nil),
|
||||
(*SubscribeSignedVAAByTypeResponse_SignedBatchVaa)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_spy_v1_spy_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 8,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
@ -56,31 +56,6 @@ func request_SpyRPCService_SubscribeSignedVAA_0(ctx context.Context, marshaler r
|
|||
|
||||
}
|
||||
|
||||
func request_SpyRPCService_SubscribeSignedVAAByType_0(ctx context.Context, marshaler runtime.Marshaler, client SpyRPCServiceClient, req *http.Request, pathParams map[string]string) (SpyRPCService_SubscribeSignedVAAByTypeClient, runtime.ServerMetadata, error) {
|
||||
var protoReq SubscribeSignedVAAByTypeRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
stream, err := client.SubscribeSignedVAAByType(ctx, &protoReq)
|
||||
if err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
header, err := stream.Header()
|
||||
if err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
metadata.HeaderMD = header
|
||||
return stream, metadata, nil
|
||||
|
||||
}
|
||||
|
||||
// RegisterSpyRPCServiceHandlerServer registers the http handlers for service SpyRPCService to "mux".
|
||||
// UnaryRPC :call SpyRPCServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
|
@ -94,13 +69,6 @@ func RegisterSpyRPCServiceHandlerServer(ctx context.Context, mux *runtime.ServeM
|
|||
return
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_SpyRPCService_SubscribeSignedVAAByType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
|
||||
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -162,37 +130,13 @@ func RegisterSpyRPCServiceHandlerClient(ctx context.Context, mux *runtime.ServeM
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_SpyRPCService_SubscribeSignedVAAByType_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)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/spy.v1.SpyRPCService/SubscribeSignedVAAByType", runtime.WithHTTPPathPattern("/v1:subscribe_signed_vaa_by_type"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_SpyRPCService_SubscribeSignedVAAByType_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_SpyRPCService_SubscribeSignedVAAByType_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_SpyRPCService_SubscribeSignedVAA_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"v1"}, "subscribe_signed_vaa"))
|
||||
|
||||
pattern_SpyRPCService_SubscribeSignedVAAByType_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"v1"}, "subscribe_signed_vaa_by_type"))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_SpyRPCService_SubscribeSignedVAA_0 = runtime.ForwardResponseStream
|
||||
|
||||
forward_SpyRPCService_SubscribeSignedVAAByType_0 = runtime.ForwardResponseStream
|
||||
)
|
||||
|
|
|
@ -20,8 +20,6 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
type SpyRPCServiceClient interface {
|
||||
// SubscribeSignedVAA returns a stream of signed VAA messages received on the network.
|
||||
SubscribeSignedVAA(ctx context.Context, in *SubscribeSignedVAARequest, opts ...grpc.CallOption) (SpyRPCService_SubscribeSignedVAAClient, error)
|
||||
// SubscribeSignedBatchVAA returns a stream of signed VAA messages, by type, received on the network.
|
||||
SubscribeSignedVAAByType(ctx context.Context, in *SubscribeSignedVAAByTypeRequest, opts ...grpc.CallOption) (SpyRPCService_SubscribeSignedVAAByTypeClient, error)
|
||||
}
|
||||
|
||||
type spyRPCServiceClient struct {
|
||||
|
@ -64,46 +62,12 @@ func (x *spyRPCServiceSubscribeSignedVAAClient) Recv() (*SubscribeSignedVAARespo
|
|||
return m, nil
|
||||
}
|
||||
|
||||
func (c *spyRPCServiceClient) SubscribeSignedVAAByType(ctx context.Context, in *SubscribeSignedVAAByTypeRequest, opts ...grpc.CallOption) (SpyRPCService_SubscribeSignedVAAByTypeClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &SpyRPCService_ServiceDesc.Streams[1], "/spy.v1.SpyRPCService/SubscribeSignedVAAByType", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &spyRPCServiceSubscribeSignedVAAByTypeClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type SpyRPCService_SubscribeSignedVAAByTypeClient interface {
|
||||
Recv() (*SubscribeSignedVAAByTypeResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type spyRPCServiceSubscribeSignedVAAByTypeClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *spyRPCServiceSubscribeSignedVAAByTypeClient) Recv() (*SubscribeSignedVAAByTypeResponse, error) {
|
||||
m := new(SubscribeSignedVAAByTypeResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// SpyRPCServiceServer is the server API for SpyRPCService service.
|
||||
// All implementations must embed UnimplementedSpyRPCServiceServer
|
||||
// for forward compatibility
|
||||
type SpyRPCServiceServer interface {
|
||||
// SubscribeSignedVAA returns a stream of signed VAA messages received on the network.
|
||||
SubscribeSignedVAA(*SubscribeSignedVAARequest, SpyRPCService_SubscribeSignedVAAServer) error
|
||||
// SubscribeSignedBatchVAA returns a stream of signed VAA messages, by type, received on the network.
|
||||
SubscribeSignedVAAByType(*SubscribeSignedVAAByTypeRequest, SpyRPCService_SubscribeSignedVAAByTypeServer) error
|
||||
mustEmbedUnimplementedSpyRPCServiceServer()
|
||||
}
|
||||
|
||||
|
@ -114,9 +78,6 @@ type UnimplementedSpyRPCServiceServer struct {
|
|||
func (UnimplementedSpyRPCServiceServer) SubscribeSignedVAA(*SubscribeSignedVAARequest, SpyRPCService_SubscribeSignedVAAServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SubscribeSignedVAA not implemented")
|
||||
}
|
||||
func (UnimplementedSpyRPCServiceServer) SubscribeSignedVAAByType(*SubscribeSignedVAAByTypeRequest, SpyRPCService_SubscribeSignedVAAByTypeServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SubscribeSignedVAAByType not implemented")
|
||||
}
|
||||
func (UnimplementedSpyRPCServiceServer) mustEmbedUnimplementedSpyRPCServiceServer() {}
|
||||
|
||||
// UnsafeSpyRPCServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
|
@ -151,27 +112,6 @@ func (x *spyRPCServiceSubscribeSignedVAAServer) Send(m *SubscribeSignedVAARespon
|
|||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _SpyRPCService_SubscribeSignedVAAByType_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(SubscribeSignedVAAByTypeRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(SpyRPCServiceServer).SubscribeSignedVAAByType(m, &spyRPCServiceSubscribeSignedVAAByTypeServer{stream})
|
||||
}
|
||||
|
||||
type SpyRPCService_SubscribeSignedVAAByTypeServer interface {
|
||||
Send(*SubscribeSignedVAAByTypeResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type spyRPCServiceSubscribeSignedVAAByTypeServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *spyRPCServiceSubscribeSignedVAAByTypeServer) Send(m *SubscribeSignedVAAByTypeResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
// SpyRPCService_ServiceDesc is the grpc.ServiceDesc for SpyRPCService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
@ -185,11 +125,6 @@ var SpyRPCService_ServiceDesc = grpc.ServiceDesc{
|
|||
Handler: _SpyRPCService_SubscribeSignedVAA_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "SubscribeSignedVAAByType",
|
||||
Handler: _SpyRPCService_SubscribeSignedVAAByType_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "spy/v1/spy.proto",
|
||||
}
|
||||
|
|
|
@ -105,11 +105,6 @@ func (s *PublicrpcServer) GetSignedVAA(ctx context.Context, req *publicrpcv1.Get
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (s *PublicrpcServer) GetSignedBatchVAA(ctx context.Context, req *publicrpcv1.GetSignedBatchVAARequest) (*publicrpcv1.GetSignedBatchVAAResponse, error) {
|
||||
// TEMP - noop implementaion to satisfy inclusion requirement
|
||||
return nil, status.Error(codes.Unimplemented, "not yet implemented")
|
||||
}
|
||||
|
||||
func (s *PublicrpcServer) GetCurrentGuardianSet(ctx context.Context, req *publicrpcv1.GetCurrentGuardianSetRequest) (*publicrpcv1.GetCurrentGuardianSetResponse, error) {
|
||||
gs := s.gst.Get()
|
||||
if gs == nil {
|
||||
|
|
|
@ -10,8 +10,6 @@ message GossipMessage {
|
|||
SignedHeartbeat signed_heartbeat = 3;
|
||||
SignedVAAWithQuorum signed_vaa_with_quorum = 4;
|
||||
SignedObservationRequest signed_observation_request = 5;
|
||||
SignedBatchObservation signed_batch_observation = 6;
|
||||
SignedBatchVAAWithQuorum signed_batch_vaa_with_quorum = 7;
|
||||
SignedChainGovernorConfig signed_chain_governor_config = 8;
|
||||
SignedChainGovernorStatus signed_chain_governor_status = 9;
|
||||
SignedQueryRequest signed_query_request = 10;
|
||||
|
@ -128,46 +126,6 @@ message ObservationRequest {
|
|||
bytes tx_hash = 2;
|
||||
}
|
||||
|
||||
// A SignedBatchObservation is a signed statement by a given guardian node
|
||||
// that they observed a series of messages originating from a transaction.
|
||||
//
|
||||
// BatcheObervations are emitted when all the Observations from a tx reach quorum.
|
||||
//
|
||||
// The event is uniquely identified by its hash (made from hashing all the
|
||||
// individual Observation hashes).
|
||||
//
|
||||
// Messages without valid signature are dropped unceremoniously.
|
||||
message SignedBatchObservation {
|
||||
// Guardian pubkey as truncated eth address.
|
||||
bytes addr = 1;
|
||||
// The observation batch's deterministic, unique hash.
|
||||
bytes hash = 2;
|
||||
// ECSDA signature of the hash using the node's guardian key.
|
||||
bytes signature = 3;
|
||||
// Unique identifier of the transaction that produced the observation.
|
||||
bytes tx_id = 4;
|
||||
// Chain ID for this observation.
|
||||
uint32 chain_id = 5;
|
||||
// Nonce of the messages in the batch.
|
||||
uint32 nonce = 6;
|
||||
// Batch ID - emitterChain/transactionID/nonce
|
||||
string batch_id = 7;
|
||||
}
|
||||
|
||||
|
||||
message SignedBatchVAAWithQuorum {
|
||||
// batch_vaa bytes are the binary encoding of the BatchVAA
|
||||
bytes batch_vaa = 1;
|
||||
// Emitter Chain ID of the messages
|
||||
uint32 chain_id = 2;
|
||||
// Transaction identifier of the observation
|
||||
bytes tx_id = 3;
|
||||
// Nonce of the messages in the batch
|
||||
uint32 nonce = 4;
|
||||
// Batch ID - emitterChain/transactionID/nonce string, for convenience
|
||||
string batch_id = 5;
|
||||
}
|
||||
|
||||
// This message is published every five minutes.
|
||||
message SignedChainGovernorConfig {
|
||||
// Serialized ChainGovernorConfig message.
|
||||
|
|
|
@ -67,15 +67,6 @@ message MessageID {
|
|||
uint64 sequence = 3;
|
||||
}
|
||||
|
||||
message BatchID {
|
||||
// Emitter chain ID.
|
||||
ChainID emitter_chain = 1;
|
||||
// Transaction's unique identifier.
|
||||
bytes tx_id = 2;
|
||||
// Nonce of the messages in the batch.
|
||||
uint32 nonce = 3;
|
||||
}
|
||||
|
||||
// PublicRPCService service exposes endpoints to be consumed externally; GUIs, historical record keeping, etc.
|
||||
service PublicRPCService {
|
||||
// GetLastHeartbeats returns the last heartbeat received for each guardian node in the
|
||||
|
@ -93,12 +84,6 @@ service PublicRPCService {
|
|||
};
|
||||
}
|
||||
|
||||
rpc GetSignedBatchVAA (GetSignedBatchVAARequest) returns (GetSignedBatchVAAResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/signed_batch_vaa/{batch_id.emitter_chain}/{batch_id.tx_id}/{batch_id.nonce}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetCurrentGuardianSet (GetCurrentGuardianSetRequest) returns (GetCurrentGuardianSetResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/guardianset/current"
|
||||
|
@ -139,14 +124,6 @@ message GetSignedVAAResponse {
|
|||
bytes vaa_bytes = 1;
|
||||
}
|
||||
|
||||
message GetSignedBatchVAARequest {
|
||||
BatchID batch_id = 1;
|
||||
}
|
||||
|
||||
message GetSignedBatchVAAResponse {
|
||||
gossip.v1.SignedBatchVAAWithQuorum signed_batch_vaa = 1;
|
||||
}
|
||||
|
||||
message GetLastHeartbeatsRequest {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,13 +17,6 @@ service SpyRPCService {
|
|||
body: "*"
|
||||
};
|
||||
}
|
||||
// SubscribeSignedBatchVAA returns a stream of signed VAA messages, by type, received on the network.
|
||||
rpc SubscribeSignedVAAByType (SubscribeSignedVAAByTypeRequest) returns (stream SubscribeSignedVAAByTypeResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1:subscribe_signed_vaa_by_type"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// A MessageFilter represents an exact match for an emitter.
|
||||
|
@ -65,20 +58,7 @@ message SubscribeSignedVAARequest {
|
|||
repeated FilterEntry filters = 1;
|
||||
}
|
||||
|
||||
message SubscribeSignedVAAByTypeRequest {
|
||||
// List of filters to apply to the stream (OR).
|
||||
// If empty, all messages are streamed.
|
||||
repeated FilterEntry filters = 1;
|
||||
}
|
||||
|
||||
message SubscribeSignedVAAResponse {
|
||||
// Raw VAA bytes
|
||||
bytes vaa_bytes = 1;
|
||||
}
|
||||
|
||||
message SubscribeSignedVAAByTypeResponse {
|
||||
oneof vaa_type {
|
||||
gossip.v1.SignedVAAWithQuorum signed_vaa = 1;
|
||||
gossip.v1.SignedBatchVAAWithQuorum signed_batch_vaa = 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,27 +43,6 @@ type (
|
|||
Payload []byte
|
||||
}
|
||||
|
||||
BatchVAA struct {
|
||||
// Version of the VAA schema
|
||||
Version uint8
|
||||
// GuardianSetIndex is the index of the guardian set that signed this VAA
|
||||
GuardianSetIndex uint32
|
||||
// SignatureData is the signature of the guardian set
|
||||
Signatures []*Signature
|
||||
|
||||
// EmitterChain the VAAs were emitted on
|
||||
EmitterChain ChainID
|
||||
|
||||
// The chain-native identifier of the transaction that created the batch VAA.
|
||||
TransactionID common.Hash
|
||||
|
||||
// array of Observation VAA hashes
|
||||
Hashes []common.Hash
|
||||
|
||||
// Observations in the batch
|
||||
Observations []*Observation
|
||||
}
|
||||
|
||||
// ChainID of a Wormhole chain
|
||||
ChainID uint16
|
||||
// Action of a VAA
|
||||
|
@ -521,14 +500,12 @@ const (
|
|||
// More details here: https://docs.wormholenetwork.com/wormhole/vaas
|
||||
minHeadlessVAALength = 51 // HEADER
|
||||
minVAALength = 57 // HEADER + BODY
|
||||
minBatchVAALength = 94 // HEADER + BATCH
|
||||
|
||||
SupportedVAAVersion = 0x01
|
||||
BatchVAAVersion = 0x02
|
||||
)
|
||||
|
||||
// UnmarshalBody deserializes the binary representation of a VAA's "BODY" properties
|
||||
// The BODY fields are common among multiple types of VAA - v1, v2 (BatchVAA), etc
|
||||
// The BODY fields are common among multiple types of VAA - v1, v2, etc
|
||||
func UnmarshalBody(data []byte, reader *bytes.Reader, v *VAA) (*VAA, error) {
|
||||
unixSeconds := uint32(0)
|
||||
if err := binary.Read(reader, binary.BigEndian, &unixSeconds); err != nil {
|
||||
|
@ -618,155 +595,11 @@ func Unmarshal(data []byte) (*VAA, error) {
|
|||
return UnmarshalBody(data, reader, v)
|
||||
}
|
||||
|
||||
// UnmarshalBatch deserializes the binary representation of a BatchVAA
|
||||
func UnmarshalBatch(data []byte) (*BatchVAA, error) {
|
||||
if len(data) < minBatchVAALength {
|
||||
return nil, fmt.Errorf("BatchVAA.Observation is too short")
|
||||
}
|
||||
v := &BatchVAA{}
|
||||
|
||||
v.Version = data[0]
|
||||
if v.Version != BatchVAAVersion {
|
||||
return nil, fmt.Errorf("unsupported VAA version: %d", v.Version)
|
||||
}
|
||||
|
||||
reader := bytes.NewReader(data[1:])
|
||||
|
||||
if err := binary.Read(reader, binary.BigEndian, &v.GuardianSetIndex); err != nil {
|
||||
return nil, fmt.Errorf("failed to read guardian set index: %w", err)
|
||||
}
|
||||
|
||||
lenSignatures, er := reader.ReadByte()
|
||||
if er != nil {
|
||||
return nil, fmt.Errorf("failed to read signature length")
|
||||
}
|
||||
|
||||
v.Signatures = make([]*Signature, int(lenSignatures))
|
||||
for i := 0; i < int(lenSignatures); i++ {
|
||||
index, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read validator index [%d]", i)
|
||||
}
|
||||
|
||||
signature := [65]byte{}
|
||||
if n, err := reader.Read(signature[:]); err != nil || n != 65 {
|
||||
return nil, fmt.Errorf("failed to read signature [%d]: %w", i, err)
|
||||
}
|
||||
|
||||
v.Signatures[i] = &Signature{
|
||||
Index: uint8(index),
|
||||
Signature: signature,
|
||||
}
|
||||
}
|
||||
|
||||
lenHashes, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read hashes length [%w]", err)
|
||||
}
|
||||
numHashes := int(lenHashes)
|
||||
|
||||
v.Hashes = make([]common.Hash, numHashes)
|
||||
for i := 0; i < int(lenHashes); i++ {
|
||||
hash := [32]byte{}
|
||||
if n, err := reader.Read(hash[:]); err != nil || n != 32 {
|
||||
return nil, fmt.Errorf("failed to read hash [%d]: %w", i, err)
|
||||
}
|
||||
v.Hashes[i] = common.BytesToHash(hash[:])
|
||||
}
|
||||
|
||||
lenObservations, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read observations length: %w", err)
|
||||
}
|
||||
numObservations := int(lenObservations)
|
||||
|
||||
if numHashes != numObservations {
|
||||
// should never happen, check anyway
|
||||
return nil, fmt.Errorf(
|
||||
"failed unmarshaling BatchVAA, observations differs from hashes")
|
||||
}
|
||||
|
||||
v.Observations = make([]*Observation, numObservations)
|
||||
for i := 0; i < int(lenObservations); i++ {
|
||||
index, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read Observation index [%d]: %w", i, err)
|
||||
}
|
||||
var obsvIndex uint8 = index
|
||||
|
||||
obsvLength := uint32(0)
|
||||
if err := binary.Read(reader, binary.BigEndian, &obsvLength); err != nil {
|
||||
return nil, fmt.Errorf("failed to read Observation length: %w", err)
|
||||
}
|
||||
numBytes := int(obsvLength)
|
||||
|
||||
// ensure numBytes is within expected bounds before allocating arrays
|
||||
// cannot be negative
|
||||
if numBytes < 0 {
|
||||
return nil, fmt.Errorf(
|
||||
"failed to read Observation index: %v, byte length is negative", i)
|
||||
}
|
||||
// cannot be longer than what is left in the array
|
||||
if numBytes > reader.Len() {
|
||||
return nil, fmt.Errorf(
|
||||
"failed to read Observation index: %v, byte length is erroneous", i)
|
||||
}
|
||||
|
||||
obs := make([]byte, numBytes)
|
||||
if n, err := reader.Read(obs[:]); err != nil || n == 0 {
|
||||
return nil, fmt.Errorf("failed to read Observation bytes [%d]: %w", n, err)
|
||||
}
|
||||
|
||||
// ensure the observation meets the minimum length of headless VAAs
|
||||
if len(obs) < minHeadlessVAALength {
|
||||
return nil, fmt.Errorf(
|
||||
"BatchVAA.Observation is too short. Index: %v", obsvIndex)
|
||||
}
|
||||
|
||||
// decode the observation, which is just the "BODY" fields of a v1 VAA
|
||||
headless, err := UnmarshalBody(data, bytes.NewReader(obs[:]), &VAA{})
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal Observation VAA. %w", err)
|
||||
}
|
||||
|
||||
// check for malformed data - verify that the hash of the observation matches what was supplied
|
||||
// the guardian has no interest in or use for observations after the batch has been signed, but still check
|
||||
obsHash := headless.SigningDigest()
|
||||
if obsHash != v.Hashes[obsvIndex] {
|
||||
return nil, fmt.Errorf(
|
||||
"BatchVAA Observation %v does not match supplied hash", obsvIndex)
|
||||
}
|
||||
|
||||
v.Observations[i] = &Observation{
|
||||
Index: obsvIndex,
|
||||
Observation: headless,
|
||||
}
|
||||
}
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// signingBody returns the binary representation of the data that is relevant for signing and verifying the VAA
|
||||
func (v *VAA) signingBody() []byte {
|
||||
return v.serializeBody()
|
||||
}
|
||||
|
||||
// signingBody returns the binary representation of the data that is relevant for signing and verifying the VAA
|
||||
func (v *BatchVAA) signingBody() []byte {
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
// add the VAA version
|
||||
MustWrite(buf, binary.BigEndian, v.Version)
|
||||
|
||||
// create the hash array from the Observations of the BatchVAA
|
||||
hashes := v.ObsvHashArray()
|
||||
|
||||
MustWrite(buf, binary.BigEndian, hashes)
|
||||
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func doubleKeccak(bz []byte) common.Hash {
|
||||
// In order to save space in the solana signature verification instruction, we hash twice so we only need to pass in
|
||||
// the first hash (32 bytes) vs the full body data.
|
||||
|
@ -799,24 +632,6 @@ func (v *VAA) SigningDigest() common.Hash {
|
|||
return doubleKeccak(v.signingBody())
|
||||
}
|
||||
|
||||
// BatchSigningDigest returns the hash of the batch vaa hash to be signed directly.
|
||||
// This is used for signature generation and verification
|
||||
func (v *BatchVAA) SigningDigest() common.Hash {
|
||||
return doubleKeccak(v.signingBody())
|
||||
}
|
||||
|
||||
// ObsvHashArray creates an array of hashes of Observation.
|
||||
// hashes in the array have the index position of their Observation.Index.
|
||||
func (v *BatchVAA) ObsvHashArray() []common.Hash {
|
||||
hashes := make([]common.Hash, len(v.Observations))
|
||||
for _, msg := range v.Observations {
|
||||
obsIndex := msg.Index
|
||||
hashes[obsIndex] = msg.Observation.SigningDigest()
|
||||
}
|
||||
|
||||
return hashes
|
||||
}
|
||||
|
||||
// Verify Signature checks that the provided address matches the address that created the signature for the provided digest
|
||||
// Digest should be the output of SigningMsg(data).Bytes()
|
||||
// Should not be public as other message types should be verified using a message prefix.
|
||||
|
@ -896,55 +711,6 @@ func (v *VAA) VerifySignatures(addresses []common.Address) bool {
|
|||
return verifySignatures(v.SigningDigest().Bytes(), v.Signatures, addresses)
|
||||
}
|
||||
|
||||
// VerifySignatures verifies the signature of the BatchVAA given the signer addresses.
|
||||
// Returns true if the signatures were verified successfully.
|
||||
func (v *BatchVAA) VerifySignatures(addresses []common.Address) bool {
|
||||
return verifySignatures(v.SigningDigest().Bytes(), v.Signatures, addresses)
|
||||
}
|
||||
|
||||
// Marshal returns the binary representation of the BatchVAA
|
||||
func (v *BatchVAA) Marshal() ([]byte, error) {
|
||||
buf := new(bytes.Buffer)
|
||||
MustWrite(buf, binary.BigEndian, v.Version)
|
||||
MustWrite(buf, binary.BigEndian, v.GuardianSetIndex)
|
||||
|
||||
// Write signatures
|
||||
MustWrite(buf, binary.BigEndian, uint8(len(v.Signatures)))
|
||||
for _, sig := range v.Signatures {
|
||||
MustWrite(buf, binary.BigEndian, sig.Index)
|
||||
buf.Write(sig.Signature[:])
|
||||
}
|
||||
|
||||
// Write Body
|
||||
buf.Write(v.serializeBody())
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
// Serializes the body of the BatchVAA.
|
||||
func (v *BatchVAA) serializeBody() []byte {
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
hashes := v.ObsvHashArray()
|
||||
|
||||
MustWrite(buf, binary.BigEndian, uint8(len(hashes)))
|
||||
MustWrite(buf, binary.BigEndian, hashes)
|
||||
|
||||
MustWrite(buf, binary.BigEndian, uint8(len(v.Observations)))
|
||||
for _, obsv := range v.Observations {
|
||||
|
||||
MustWrite(buf, binary.BigEndian, obsv.Index)
|
||||
|
||||
obsvBytes := obsv.Observation.serializeBody()
|
||||
|
||||
lenBytes := len(obsvBytes)
|
||||
MustWrite(buf, binary.BigEndian, uint32(lenBytes))
|
||||
buf.Write(obsvBytes)
|
||||
}
|
||||
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
// Verify is a function on the VAA that takes a complete set of guardian keys as input and attempts certain checks with respect to this guardian.
|
||||
// Verify will return nil if the VAA passes checks. Otherwise, Verify will return an error containing the text of the first check to fail.
|
||||
// NOTE: Verify will not work correctly if a subset of the guardian set keys is passed in. The complete guardian set must be passed in.
|
||||
|
@ -1012,64 +778,22 @@ func (v *VAA) UnmarshalBinary(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// implement encoding.BinaryMarshaler interface for BatchVAA struct
|
||||
func (b BatchVAA) MarshalBinary() ([]byte, error) {
|
||||
return b.Marshal()
|
||||
}
|
||||
|
||||
// implement encoding.BinaryUnmarshaler interface for BatchVAA struct
|
||||
func (b *BatchVAA) UnmarshalBinary(data []byte) error {
|
||||
batch, err := UnmarshalBatch(data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// derefernce the stuct created by Unmarshal, and assign it to the method's context
|
||||
*b = *batch
|
||||
return nil
|
||||
}
|
||||
|
||||
// MessageID returns a human-readable emitter_chain/emitter_address/sequence tuple.
|
||||
func (v *VAA) MessageID() string {
|
||||
return fmt.Sprintf("%d/%s/%d", v.EmitterChain, v.EmitterAddress, v.Sequence)
|
||||
}
|
||||
|
||||
// BatchID returns a human-readable emitter_chain/transaction_hex
|
||||
func (v *BatchVAA) BatchID() string {
|
||||
if len(v.Observations) == 0 {
|
||||
// cant have a batch without Observations, but check just be safe
|
||||
panic("Cannot create a BatchID from BatchVAA with no Observations.")
|
||||
}
|
||||
nonce := v.Observations[0].Observation.Nonce
|
||||
return fmt.Sprintf("%d/%s/%d", v.EmitterChain, hex.EncodeToString(v.TransactionID.Bytes()), nonce)
|
||||
}
|
||||
|
||||
// UniqueID normalizes the ID of the VAA (any type) for the Attestation interface
|
||||
// UniqueID returns the MessageID that uniquely identifies the Attestation
|
||||
func (v *VAA) UniqueID() string {
|
||||
return v.MessageID()
|
||||
}
|
||||
|
||||
// UniqueID returns the BatchID that uniquely identifies the Attestation
|
||||
func (b *BatchVAA) UniqueID() string {
|
||||
return b.BatchID()
|
||||
}
|
||||
|
||||
// GetTransactionID implements the processor.Batch interface for *BatchVAA.
|
||||
func (v *BatchVAA) GetTransactionID() common.Hash {
|
||||
return v.TransactionID
|
||||
}
|
||||
|
||||
// HexDigest returns the hex-encoded digest.
|
||||
func (v *VAA) HexDigest() string {
|
||||
return hex.EncodeToString(v.SigningDigest().Bytes())
|
||||
}
|
||||
|
||||
// HexDigest returns the hex-encoded digest.
|
||||
func (b *BatchVAA) HexDigest() string {
|
||||
return hex.EncodeToString(b.SigningDigest().Bytes())
|
||||
}
|
||||
|
||||
/*
|
||||
SECURITY: Do not change this code! Changing it could result in two different hashes for
|
||||
the same observation. But xDapps rely on the hash of an observation for replay protection.
|
||||
|
@ -1101,22 +825,6 @@ func (v *VAA) AddSignature(key *ecdsa.PrivateKey, index uint8) {
|
|||
})
|
||||
}
|
||||
|
||||
// creates signature of BatchVAA.Hashes and adds it to BatchVAA.Signatures.
|
||||
func (v *BatchVAA) AddSignature(key *ecdsa.PrivateKey, index uint8) {
|
||||
|
||||
sig, err := crypto.Sign(v.SigningDigest().Bytes(), key)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
sigData := [65]byte{}
|
||||
copy(sigData[:], sig)
|
||||
|
||||
v.Signatures = append(v.Signatures, &Signature{
|
||||
Index: index,
|
||||
Signature: sigData,
|
||||
})
|
||||
}
|
||||
|
||||
// NOTE: This function assumes that the caller has verified that the VAA is from the token bridge.
|
||||
func IsTransfer(payload []byte) bool {
|
||||
return (len(payload) > 0) && ((payload[0] == 1) || (payload[0] == 3))
|
||||
|
@ -1174,11 +882,6 @@ func (v *VAA) GetEmitterChain() ChainID {
|
|||
return v.EmitterChain
|
||||
}
|
||||
|
||||
// GetEmitterChain implements the processor.Batch interface for *BatchVAA.
|
||||
func (v *BatchVAA) GetEmitterChain() ChainID {
|
||||
return v.EmitterChain
|
||||
}
|
||||
|
||||
// MustWrite calls binary.Write and panics on errors
|
||||
func MustWrite(w io.Writer, order binary.ByteOrder, data interface{}) {
|
||||
if err := binary.Write(w, order, data); err != nil {
|
||||
|
|
Loading…
Reference in New Issue