From 627f518c14cbe2d121d1952510d007d0b7588501 Mon Sep 17 00:00:00 2001 From: gregor Date: Mon, 4 Nov 2024 16:47:05 +0100 Subject: [PATCH] feat(relayer): pr comments --- lib/cchain/provider/abci.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cchain/provider/abci.go b/lib/cchain/provider/abci.go index e67e658d4..9d4a6aeb7 100644 --- a/lib/cchain/provider/abci.go +++ b/lib/cchain/provider/abci.go @@ -356,7 +356,7 @@ func newABCIFetchFunc(attCl atypes.QueryClient, cmtCl cmtservice.ServiceClient, atts, ok, err := attsFromAtHeight(ctx, attCl, chainVer, fromOffset, 0) if err != nil { incQueryErr(endpoint) - return nil, cursor, errors.Wrap(err, "abci query attestations-from") + return nil, 0, errors.Wrap(err, "abci query attestations-from") } else if ok { binarySearchStepsMetric(chainName, 0) lookbackStepsMetric(chainName, 0) @@ -367,7 +367,7 @@ func newABCIFetchFunc(attCl atypes.QueryClient, cmtCl cmtservice.ServiceClient, earliestAttestationAtLatestHeight, ok, err := queryEarliestAttestation(ctx, attCl, chainVer, 0) if err != nil { incQueryErr(endpoint) - return nil, cursor, errors.Wrap(err, "abci query earliest-attestation-in-state") + return nil, 0, errors.Wrap(err, "abci query earliest-attestation-in-state") } // Either no attestations have happened yet, or the queried fromOffset is in the "future" @@ -379,7 +379,7 @@ func newABCIFetchFunc(attCl atypes.QueryClient, cmtCl cmtservice.ServiceClient, latestBlockResp, err := cmtCl.GetLatestBlock(ctx, &cmtservice.GetLatestBlockRequest{}) if err != nil { - return []xchain.Attestation{}, cursor, errors.Wrap(err, "query latest block") + return []xchain.Attestation{}, 0, errors.Wrap(err, "query latest block") } latestHeight := uint64(latestBlockResp.SdkBlock.Header.Height) @@ -391,22 +391,22 @@ func newABCIFetchFunc(attCl atypes.QueryClient, cmtCl cmtservice.ServiceClient, searchStart, searchEnd, err = lookbackRange(ctx, attCl, chainVer, chainName, fromOffset, latestHeight) if err != nil { incQueryErr(endpoint) - return nil, cursor, errors.Wrap(err, "lookback search") + return nil, 0, errors.Wrap(err, "lookback search") } } offsetHeight, err := binarySearch(ctx, attCl, chainVer, chainName, fromOffset, searchStart, searchEnd) if err != nil { incQueryErr(endpoint) - return nil, cursor, errors.Wrap(err, "binary search") + return nil, 0, errors.Wrap(err, "binary search") } atts, ok, err = attsFromAtHeight(ctx, attCl, chainVer, fromOffset, offsetHeight) if err != nil { incQueryErr(endpoint) - return nil, cursor, errors.Wrap(err, "abci query attestations-from") + return nil, 0, errors.Wrap(err, "abci query attestations-from") } else if !ok { - return nil, cursor, errors.New("expected to find attestations [BUG]") + return nil, 0, errors.New("expected to find attestations [BUG]") } return atts, offsetHeight, nil