From 659f08ec0702b61e7b1e1fc70e448663439fd548 Mon Sep 17 00:00:00 2001 From: Alonso Date: Thu, 19 Sep 2024 13:50:43 +0200 Subject: [PATCH] linter --- cmd/run.go | 2 +- db/pgstorage/pgstorage.go | 6 +++--- server/service.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 0ebd588e..a340fdf4 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -168,7 +168,7 @@ func monitorChannel(ctx context.Context, chExitRootEvent chan *etherman.GlobalEx go func() { for { select { - case ger := <- chExitRootEvent: + case ger := <-chExitRootEvent: log.Debug("New GER received") s := storage.(claimtxman.StorageInterface) dbTx, err := s.BeginDBTransaction(ctx) diff --git a/db/pgstorage/pgstorage.go b/db/pgstorage/pgstorage.go index 8b6d606a..1c541a29 100644 --- a/db/pgstorage/pgstorage.go +++ b/db/pgstorage/pgstorage.go @@ -680,15 +680,15 @@ func (p *PostgresStorage) GetPendingDepositsToClaim(ctx context.Context, destAdd desAddrSQL := "" if destAddress != (common.Address{}) { str := strings.TrimPrefix(destAddress.String(), "0x") - desAddrSQL = "AND dest_addr = decode('"+str+"','hex')" + desAddrSQL = "AND dest_addr = decode('" + str + "','hex')" } - getNumberPendingDepositsToClaimSQL := "SELECT count(*) FROM sync.deposit WHERE dest_net = $1 AND ready_for_claim = true AND leaf_type = $2 "+desAddrSQL+" AND deposit_cnt NOT IN (SELECT index FROM sync.claim WHERE sync.claim.network_id = $1)" + getNumberPendingDepositsToClaimSQL := "SELECT count(*) FROM sync.deposit WHERE dest_net = $1 AND ready_for_claim = true AND leaf_type = $2 " + desAddrSQL + " AND deposit_cnt NOT IN (SELECT index FROM sync.claim WHERE sync.claim.network_id = $1)" var depositCount uint64 err := p.getExecQuerier(dbTx).QueryRow(ctx, getNumberPendingDepositsToClaimSQL, destNetwork, leafType).Scan(&depositCount) if err != nil { return nil, 0, err } - getPendingDepositsToClaimSQL := "SELECT d.id, leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim FROM sync.deposit AS d INNER JOIN sync.block AS b ON d.block_id = b.id WHERE dest_net = $1 AND ready_for_claim = true AND leaf_type = $2 "+desAddrSQL+" AND d.deposit_cnt NOT IN (SELECT index FROM sync.claim WHERE sync.claim.network_id = $1) ORDER BY d.deposit_cnt ASC LIMIT $3 OFFSET $4" + getPendingDepositsToClaimSQL := "SELECT d.id, leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim FROM sync.deposit AS d INNER JOIN sync.block AS b ON d.block_id = b.id WHERE dest_net = $1 AND ready_for_claim = true AND leaf_type = $2 " + desAddrSQL + " AND d.deposit_cnt NOT IN (SELECT index FROM sync.claim WHERE sync.claim.network_id = $1) ORDER BY d.deposit_cnt ASC LIMIT $3 OFFSET $4" rows, err := p.getExecQuerier(dbTx).Query(ctx, getPendingDepositsToClaimSQL, destNetwork, leafType, limit, offset) if err != nil { return nil, 0, err diff --git a/server/service.go b/server/service.go index 5369b794..b13e32ef 100644 --- a/server/service.go +++ b/server/service.go @@ -580,4 +580,4 @@ func (s *bridgeService) GetPendingBridgesToClaim(ctx context.Context, req *pb.Ge Deposits: pbDeposits, TotalCnt: totalDeposits, }, nil -} \ No newline at end of file +}