diff --git a/aggoracle/chaingersender/evm.go b/aggoracle/chaingersender/evm.go index 5af3e443..ef9e1b75 100644 --- a/aggoracle/chaingersender/evm.go +++ b/aggoracle/chaingersender/evm.go @@ -132,10 +132,12 @@ func (c *EVMChainGERSender) InjectGER(ctx context.Context, ger common.Hash) erro ethtxtypes.MonitoredTxStatusSent: continue case ethtxtypes.MonitoredTxStatusFailed: - return fmt.Errorf("tx %s failed", id.Hex()) + return fmt.Errorf("inject GER tx %s failed", id.Hex()) case ethtxtypes.MonitoredTxStatusMined, ethtxtypes.MonitoredTxStatusSafe, ethtxtypes.MonitoredTxStatusFinalized: + c.logger.Debugf("inject GER tx %s was successfully mined at block %d", id.Hex(), res.MinedAtBlockNumber) + return nil default: c.logger.Error("unexpected tx status:", res.Status) diff --git a/claimsponsor/evmclaimsponsor.go b/claimsponsor/evmclaimsponsor.go index 6f315d94..10b073c3 100644 --- a/claimsponsor/evmclaimsponsor.go +++ b/claimsponsor/evmclaimsponsor.go @@ -174,6 +174,8 @@ func (c *EVMClaimSponsor) claimStatus(ctx context.Context, id string) (ClaimStat case ethtxtypes.MonitoredTxStatusMined, ethtxtypes.MonitoredTxStatusSafe, ethtxtypes.MonitoredTxStatusFinalized: + log.Infof("claim tx with id %s mined at block %d", id, res.MinedAtBlockNumber) + return SuccessClaimStatus, nil default: return "", fmt.Errorf("unexpected tx status: %v", res.Status) diff --git a/tree/tree.go b/tree/tree.go index 6abb9e3d..51f88a6e 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -124,7 +124,7 @@ func (t *Tree) getRHTNode(tx db.Querier, nodeHash common.Hash) (*types.TreeNode, node := &types.TreeNode{} err := meddler.QueryRow( tx, node, - fmt.Sprintf(`select * from %s where hash = $1`, t.rhtTable), + fmt.Sprintf(`SELECT * FROM %s WHERE hash = $1`, t.rhtTable), nodeHash.String(), ) if err != nil { @@ -215,9 +215,9 @@ func (t *Tree) GetRootByIndex(ctx context.Context, index uint32) (types.Root, er // GetRootByHash returns the root associated to the hash func (t *Tree) GetRootByHash(ctx context.Context, hash common.Hash) (*types.Root, error) { - var root *types.Root + var root types.Root if err := meddler.QueryRow( - t.db, root, + t.db, &root, fmt.Sprintf(`SELECT * FROM %s WHERE hash = $1;`, t.rootTable), hash.Hex(), ); err != nil { @@ -226,7 +226,8 @@ func (t *Tree) GetRootByHash(ctx context.Context, hash common.Hash) (*types.Root } return nil, err } - return root, nil + + return &root, nil } func (t *Tree) GetLeaf(tx db.Querier, index uint32, root common.Hash) (common.Hash, error) {