Code review rework
This commit is contained in:
parent
d45a1e95cb
commit
aebbbdcb9a
|
@ -463,7 +463,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
|||
*moonbeamContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||
*neonContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||
if *arbitrumContract == "" {
|
||||
*neonContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||
*arbitrumContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,9 +52,13 @@ func NewArbitrumFinalizer(logger *zap.Logger, connector connectors.Connector, cl
|
|||
}
|
||||
}
|
||||
|
||||
// IsBlockFinalized queries the NodeInfrastructure precompiled contract to see if the L2 (Arbitrum) block has appeared
|
||||
// in an L1 (Ethereum) block. We don't really care what L2 block it appeared in, just that it has.
|
||||
func (a *ArbitrumFinalizer) IsBlockFinalized(ctx context.Context, block *connectors.NewBlock) (bool, error) {
|
||||
_, err := a.caller.FindBatchContainingBlock(ðBind.CallOpts{Context: ctx}, block.Number.Uint64())
|
||||
if err != nil {
|
||||
// If it hasn't been published yet, the method returns an error, so we check for that and treat it as
|
||||
// not finalized, rather than as an error. Here's what that looks like:
|
||||
// "requested block 430842 is after latest on-chain block 430820 published in batch 4686"
|
||||
if strings.ContainsAny(err.Error(), "is after latest on-chain block") {
|
||||
return false, nil
|
||||
|
|
Loading…
Reference in New Issue