From f130f5076142377c5ec7916f4dfb4df2fa1ba5fc Mon Sep 17 00:00:00 2001 From: Samuel Furter Date: Fri, 12 Jan 2024 11:37:47 +0100 Subject: [PATCH] Moved logging of the errors to the top level of the call-stack for etherman.GetSequencerAddr --- etherman/etherman.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/etherman/etherman.go b/etherman/etherman.go index f922a1c..83039ca 100644 --- a/etherman/etherman.go +++ b/etherman/etherman.go @@ -43,6 +43,7 @@ func New(ethClient EthereumClient, auth bind.TransactOpts, cfg *config.Config) ( func (e *Etherman) GetSequencerAddr(rollupId uint32) (common.Address, error) { address, err := e.getTrustedSequencerAddress(rollupId) if err != nil { + log.Errorf("error requesting the 'TrustedSequencer' address: %s", err) return common.Address{}, err } @@ -91,13 +92,11 @@ func (e *Etherman) CallContract(ctx context.Context, call ethereum.CallMsg, bloc func (e *Etherman) getRollupContractAddress(rollupId uint32) (common.Address, error) { contract, err := polygonrollupmanager.NewPolygonrollupmanager(e.config.L1.RollupManagerContract, e.ethClient) if err != nil { - log.Errorf("error instantiating contract: %s", err) return common.Address{}, err } rollupData, err := contract.RollupIDToRollupData(&bind.CallOpts{Pending: false}, rollupId) if err != nil { - log.Errorf("error receiving the 'RollupData' struct: %s", err) return common.Address{}, err } @@ -107,13 +106,11 @@ func (e *Etherman) getRollupContractAddress(rollupId uint32) (common.Address, er func (e *Etherman) getTrustedSequencerAddress(rollupId uint32) (common.Address, error) { rollupContractAddress, err := e.getRollupContractAddress(rollupId) if err != nil { - log.Errorf("error requesting the RollupContract address from PolygonRollupManager: %s", err) return common.Address{}, err } contract, err := polygonzkevm.NewPolygonzkevm(rollupContractAddress, e.ethClient) if err != nil { - log.Errorf("error instantiating contract: %s", err) return common.Address{}, err }