/
resolution.pb.go
213 lines (183 loc) · 7.62 KB
/
resolution.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Code generated by protoc-gen-go.
// source: dfss/dfsst/api/resolution.proto
// DO NOT EDIT!
/*
Package api is a generated protocol buffer package.
It is generated from these files:
dfss/dfsst/api/resolution.proto
It has these top-level messages:
AlertRequest
RecoverRequest
TTPResponse
*/
package api
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import api2 "dfss/dfssc/api"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.ProtoPackageIsVersion1
type AlertRequest struct {
// / Promises obtained at this point of the main protocol
Promises []*api2.Promise `protobuf:"bytes,1,rep,name=promises" json:"promises,omitempty"`
// / Index at which the alert token was sent
Index uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
}
func (m *AlertRequest) Reset() { *m = AlertRequest{} }
func (m *AlertRequest) String() string { return proto.CompactTextString(m) }
func (*AlertRequest) ProtoMessage() {}
func (*AlertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *AlertRequest) GetPromises() []*api2.Promise {
if m != nil {
return m.Promises
}
return nil
}
type RecoverRequest struct {
SignatureUUID string `protobuf:"bytes,1,opt,name=signatureUUID" json:"signatureUUID,omitempty"`
}
func (m *RecoverRequest) Reset() { *m = RecoverRequest{} }
func (m *RecoverRequest) String() string { return proto.CompactTextString(m) }
func (*RecoverRequest) ProtoMessage() {}
func (*RecoverRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type TTPResponse struct {
// / True for abort token, False when the TTP was able to generate the fully signed contract
Abort bool `protobuf:"varint,1,opt,name=abort" json:"abort,omitempty"`
Contract []byte `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
}
func (m *TTPResponse) Reset() { *m = TTPResponse{} }
func (m *TTPResponse) String() string { return proto.CompactTextString(m) }
func (*TTPResponse) ProtoMessage() {}
func (*TTPResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func init() {
proto.RegisterType((*AlertRequest)(nil), "api.AlertRequest")
proto.RegisterType((*RecoverRequest)(nil), "api.RecoverRequest")
proto.RegisterType((*TTPResponse)(nil), "api.TTPResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion2
// Client API for TTP service
type TTPClient interface {
// / Sent by a client when a signature encounters a problem.
// Triggers the resolve protocol.
Alert(ctx context.Context, in *AlertRequest, opts ...grpc.CallOption) (*TTPResponse, error)
// / Sent by a client after a crash or a self-deconnection.
// Tries to fetch the result of the resolve protocol, if any.
Recover(ctx context.Context, in *RecoverRequest, opts ...grpc.CallOption) (*TTPResponse, error)
}
type tTPClient struct {
cc *grpc.ClientConn
}
func NewTTPClient(cc *grpc.ClientConn) TTPClient {
return &tTPClient{cc}
}
func (c *tTPClient) Alert(ctx context.Context, in *AlertRequest, opts ...grpc.CallOption) (*TTPResponse, error) {
out := new(TTPResponse)
err := grpc.Invoke(ctx, "/api.TTP/Alert", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tTPClient) Recover(ctx context.Context, in *RecoverRequest, opts ...grpc.CallOption) (*TTPResponse, error) {
out := new(TTPResponse)
err := grpc.Invoke(ctx, "/api.TTP/Recover", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for TTP service
type TTPServer interface {
// / Sent by a client when a signature encounters a problem.
// Triggers the resolve protocol.
Alert(context.Context, *AlertRequest) (*TTPResponse, error)
// / Sent by a client after a crash or a self-deconnection.
// Tries to fetch the result of the resolve protocol, if any.
Recover(context.Context, *RecoverRequest) (*TTPResponse, error)
}
func RegisterTTPServer(s *grpc.Server, srv TTPServer) {
s.RegisterService(&_TTP_serviceDesc, srv)
}
func _TTP_Alert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AlertRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TTPServer).Alert(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.TTP/Alert",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TTPServer).Alert(ctx, req.(*AlertRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TTP_Recover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecoverRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TTPServer).Recover(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.TTP/Recover",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TTPServer).Recover(ctx, req.(*RecoverRequest))
}
return interceptor(ctx, in, info, handler)
}
var _TTP_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.TTP",
HandlerType: (*TTPServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Alert",
Handler: _TTP_Alert_Handler,
},
{
MethodName: "Recover",
Handler: _TTP_Recover_Handler,
},
},
Streams: []grpc.StreamDesc{},
}
var fileDescriptor0 = []byte{
// 257 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x50, 0x4d, 0x4b, 0xc3, 0x40,
0x10, 0x35, 0x86, 0x6a, 0x9c, 0xa6, 0xa2, 0xab, 0x87, 0x12, 0x0f, 0x96, 0xe0, 0x21, 0xa7, 0x04,
0x22, 0x78, 0x15, 0xc1, 0x8b, 0x17, 0x29, 0x4b, 0xfb, 0x03, 0xd2, 0xed, 0x28, 0x0b, 0x71, 0x37,
0xee, 0x4c, 0xc4, 0x9f, 0xef, 0x76, 0xa3, 0xa1, 0x05, 0x2f, 0x0b, 0xef, 0x63, 0xde, 0xbc, 0x59,
0xb8, 0xdd, 0xbe, 0x11, 0x55, 0xbb, 0x87, 0xab, 0xa6, 0xd3, 0x95, 0x43, 0xb2, 0x6d, 0xcf, 0xda,
0x9a, 0xb2, 0x73, 0x96, 0xad, 0x88, 0x3d, 0x9b, 0xdd, 0x8c, 0x2e, 0x15, 0x5c, 0xaa, 0xd5, 0x68,
0x78, 0x70, 0xe4, 0xaf, 0x90, 0x3e, 0xb5, 0xe8, 0x58, 0xe2, 0x67, 0x8f, 0xc4, 0xa2, 0x80, 0xc4,
0x0b, 0x1f, 0x9a, 0x90, 0xe6, 0xd1, 0x22, 0x2e, 0xa6, 0x75, 0x5a, 0xfa, 0xa1, 0x72, 0x39, 0x90,
0x72, 0x54, 0xc5, 0x35, 0x4c, 0xb4, 0xd9, 0xe2, 0xf7, 0xfc, 0x78, 0x11, 0x15, 0x33, 0x39, 0x80,
0xfc, 0x01, 0xce, 0x25, 0x2a, 0xfb, 0x85, 0xee, 0x2f, 0xf1, 0x0e, 0x66,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