From f55f81635125b1cbfedd0b5d5c9845f971c0ded6 Mon Sep 17 00:00:00 2001 From: Krishna Upadhyaya Date: Wed, 27 Jul 2022 19:07:48 +0530 Subject: [PATCH] fixed context in gRPC code --- consensus/bor/heimdallgrpc/checkpoint.go | 4 ++-- consensus/bor/heimdallgrpc/span.go | 2 +- consensus/bor/heimdallgrpc/state_sync.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/consensus/bor/heimdallgrpc/checkpoint.go b/consensus/bor/heimdallgrpc/checkpoint.go index eebf13a398..0829468e9b 100644 --- a/consensus/bor/heimdallgrpc/checkpoint.go +++ b/consensus/bor/heimdallgrpc/checkpoint.go @@ -11,7 +11,7 @@ import ( ) func (h *HeimdallGRPCClient) FetchCheckpointCount(ctx context.Context) (int64, error) { - res, err := h.client.FetchCheckpointCount(context.Background(), nil) + res, err := h.client.FetchCheckpointCount(ctx, nil) if err != nil { return 0, err } @@ -24,7 +24,7 @@ func (h *HeimdallGRPCClient) FetchCheckpoint(ctx context.Context, number int64) ID: number, } - res, err := h.client.FetchCheckpoint(context.Background(), req) + res, err := h.client.FetchCheckpoint(ctx, req) if err != nil { return nil, err } diff --git a/consensus/bor/heimdallgrpc/span.go b/consensus/bor/heimdallgrpc/span.go index 1bc5a07021..d68c5c97a3 100644 --- a/consensus/bor/heimdallgrpc/span.go +++ b/consensus/bor/heimdallgrpc/span.go @@ -15,7 +15,7 @@ func (h *HeimdallGRPCClient) Span(ctx context.Context, spanID uint64) (*span.Hei ID: spanID, } - res, err := h.client.Span(context.Background(), req) + res, err := h.client.Span(ctx, req) if err != nil { return nil, err } diff --git a/consensus/bor/heimdallgrpc/state_sync.go b/consensus/bor/heimdallgrpc/state_sync.go index 2f36895687..aa10f0c5c3 100644 --- a/consensus/bor/heimdallgrpc/state_sync.go +++ b/consensus/bor/heimdallgrpc/state_sync.go @@ -18,7 +18,7 @@ func (h *HeimdallGRPCClient) StateSyncEvents(ctx context.Context, fromID uint64, Limit: uint64(stateFetchLimit), } - res, err := h.client.StateSyncEvents(context.Background(), req) + res, err := h.client.StateSyncEvents(ctx, req) if err != nil { return nil, err }