@@ -7,19 +7,20 @@ import (
7
7
"crypto/x509"
8
8
"encoding/hex"
9
9
"fmt"
10
- "go.opentelemetry.io/otel/attribute"
11
- "go.opentelemetry.io/otel/metric"
12
10
"math/rand"
13
11
"strconv"
14
12
"strings"
15
13
"time"
16
14
15
+ "go.opentelemetry.io/otel/attribute"
16
+ "go.opentelemetry.io/otel/metric"
17
+
17
18
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
18
19
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
19
20
"github.com/onflow/cadence"
20
21
jsoncdc "github.com/onflow/cadence/encoding/json"
21
22
"github.com/onflow/cadence/runtime/common"
22
- "github.com/onflow/flow-go/ crypto"
23
+ "github.com/onflow/crypto"
23
24
"github.com/onflow/flow-go/network/p2p/keyutils"
24
25
"github.com/onflow/flow/protobuf/go/flow/access"
25
26
"github.com/onflow/flow/protobuf/go/flow/entities"
@@ -88,6 +89,7 @@ func (c Client) Account(ctx context.Context, addr []byte) (*entities.Account, er
88
89
trace .EndSpanErr (span , err )
89
90
return nil , err
90
91
}
92
+ log .Debugf ("AccessAPI.Account(%a): %r" , addr , resp .Account )
91
93
trace .EndSpanOk (span )
92
94
return resp .Account , nil
93
95
}
@@ -114,6 +116,7 @@ func (c Client) AccountAtHeight(ctx context.Context, addr []byte, height uint64)
114
116
trace .EndSpanErr (span , err )
115
117
return nil , err
116
118
}
119
+ log .Debugf ("AccessAPI.AccountAtHeight(%a): %r" , addr , resp .Account )
117
120
trace .EndSpanOk (span )
118
121
return resp .Account , nil
119
122
}
@@ -134,6 +137,7 @@ func (c Client) BlockByHeight(ctx context.Context, height uint64) (*entities.Blo
134
137
trace .EndSpanErr (span , err )
135
138
return nil , err
136
139
}
140
+ log .Debugf ("AccessAPI.BlockByHeight(%a): %b" , height , resp .Block )
137
141
trace .EndSpanOk (span )
138
142
return resp .Block , nil
139
143
}
@@ -154,6 +158,7 @@ func (c Client) BlockByID(ctx context.Context, blockID []byte) (*entities.Block,
154
158
trace .EndSpanErr (span , err )
155
159
return nil , err
156
160
}
161
+ log .Debugf ("AccessAPI.BlockByID(%a): %b" , blockID , resp .Block )
157
162
trace .EndSpanOk (span )
158
163
return resp .Block , nil
159
164
}
@@ -180,7 +185,9 @@ func (c Client) BlockEvents(ctx context.Context, blockID []byte, typ string) ([]
180
185
trace .EndSpanErr (span , err )
181
186
return nil , err
182
187
}
188
+ log .Debugf ("AccessAPI.BlockEvents(): %a\n %b" , blockID , resp .Results )
183
189
trace .EndSpanOk (span )
190
+
184
191
return resp .Results [0 ].Events , nil
185
192
}
186
193
@@ -199,6 +206,7 @@ func (c Client) BlockHeaderByHeight(ctx context.Context, height uint64) (*entiti
199
206
trace .EndSpanErr (span , err )
200
207
return nil , err
201
208
}
209
+ log .Debugf ("AccessAPI.BlockHeaderByHeight(%a): %b" , height , resp .Block )
202
210
trace .EndSpanOk (span )
203
211
return resp .Block , nil
204
212
}
@@ -218,6 +226,7 @@ func (c Client) BlockHeaderByID(ctx context.Context, blockID []byte) (*entities.
218
226
trace .EndSpanErr (span , err )
219
227
return nil , err
220
228
}
229
+ log .Debugf ("AccessAPI.BlockHeaderByID(%a): %b" , blockID , resp .Block )
221
230
trace .EndSpanOk (span )
222
231
return resp .Block , nil
223
232
}
@@ -238,6 +247,7 @@ func (c Client) CollectionByID(ctx context.Context, id []byte) (*entities.Collec
238
247
trace .EndSpanErr (span , err )
239
248
return nil , err
240
249
}
250
+ log .Debugf ("AccessAPI.CollectionByID(%a): %b" , id , resp .Collection )
241
251
trace .EndSpanOk (span )
242
252
return resp .Collection , nil
243
253
}
@@ -281,6 +291,7 @@ func (c Client) Execute(ctx context.Context, blockID []byte, script []byte, args
281
291
trace .EndSpanErr (span , err )
282
292
return nil , err
283
293
}
294
+ log .Debugf ("AccessAPI.Execute(): %a = %b" , blockID , val )
284
295
trace .EndSpanOk (span )
285
296
return val , nil
286
297
}
@@ -300,6 +311,7 @@ func (c Client) ExecutionResultForBlockID(ctx context.Context, blockID []byte) (
300
311
trace .EndSpanErr (span , err )
301
312
return nil , err
302
313
}
314
+ log .Debugf ("AccessAPI.ExecutionResultForBlockID(): %a" , resp .ExecutionResult )
303
315
trace .EndSpanOk (span )
304
316
return resp .ExecutionResult , nil
305
317
}
@@ -320,6 +332,8 @@ func (c Client) LatestBlockHeader(ctx context.Context) (*entities.BlockHeader, e
320
332
trace .EndSpanErr (span , err )
321
333
return nil , err
322
334
}
335
+
336
+ log .Debugf ("AccessAPI.LatestBlockHeader(): %b" , resp .Block )
323
337
trace .EndSpanOk (span )
324
338
return resp .Block , nil
325
339
}
@@ -340,6 +354,7 @@ func (c Client) LatestFinalizedBlockHeader(ctx context.Context) (*entities.Block
340
354
trace .EndSpanErr (span , err )
341
355
return nil , err
342
356
}
357
+ log .Debugf ("AccessAPI.LatestFinalizedBlockHeader(): %b" , resp .Block )
343
358
trace .EndSpanOk (span )
344
359
return resp .Block , nil
345
360
}
@@ -371,6 +386,7 @@ func (c *Client) SendTransaction(ctx context.Context, txn *entities.Transaction)
371
386
trace .EndSpanErr (span , err )
372
387
return nil , err
373
388
}
389
+ log .Debugf ("AccessAPI.SendTransaction(): %t, %b" , txn , resp .Id )
374
390
trace .EndSpanOk (span )
375
391
return resp .Id , nil
376
392
}
@@ -396,6 +412,7 @@ func (c Client) Transaction(ctx context.Context, hash []byte) (*entities.Transac
396
412
trace .EndSpanErr (span , err )
397
413
return nil , err
398
414
}
415
+ log .Debugf ("AccessAPI.Transaction(%a): %b" , hash , resp .Transaction )
399
416
trace .EndSpanOk (span )
400
417
return resp .Transaction , nil
401
418
}
@@ -419,6 +436,7 @@ func (c Client) TransactionResult(ctx context.Context, blockID []byte, txnIndex
419
436
return nil , err
420
437
}
421
438
trace .EndSpanOk (span )
439
+ log .Debugf ("AccessAPI.TransactionResult(%i): %r" , blockID , resp )
422
440
return resp , nil
423
441
}
424
442
@@ -446,6 +464,7 @@ func (c Client) TransactionResultByHash(ctx context.Context, hash []byte) (*acce
446
464
return nil , err
447
465
}
448
466
trace .EndSpanOk (span )
467
+ log .Debugf ("AccessAPI.TransactionResultByHash(): %a" , hash )
449
468
return resp , nil
450
469
}
451
470
@@ -467,6 +486,7 @@ func (c Client) TransactionResultsByBlockID(ctx context.Context, blockID []byte)
467
486
return nil , err
468
487
}
469
488
trace .EndSpanOk (span )
489
+ log .Debugf ("AccessAPI.TransactionResultsByBlockID(): %a" , blockID )
470
490
return resp .TransactionResults , nil
471
491
}
472
492
@@ -489,6 +509,7 @@ func (c Client) TransactionsByBlockID(ctx context.Context, blockID []byte) ([]*e
489
509
return nil , err
490
510
}
491
511
trace .EndSpanOk (span )
512
+ log .Debugf ("AccessAPI.TransactionsByBlockID(): %a" , blockID )
492
513
return resp .Transactions , nil
493
514
}
494
515
0 commit comments