diff --git a/eth/catalyst/simulated_beacon.go b/eth/catalyst/simulated_beacon.go index 7aa45914a7..e4e2ca7746 100644 --- a/eth/catalyst/simulated_beacon.go +++ b/eth/catalyst/simulated_beacon.go @@ -88,7 +88,7 @@ type errTxPoolTerminated struct { // Error returns the message from the wrapped error. func (t *errTxPoolTerminated) Error() string { - return t.error.Error() + return fmt.Errorf("failed to sync txpool: %w", t.error).Error() } // SimulatedBeacon drives an Ethereum instance as if it were a real beacon @@ -192,7 +192,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u // behavior, the pool will be explicitly blocked on its reset before // continuing to the block production below. if err := c.eth.APIBackend.TxPool().Sync(); err != nil { - return &errTxPoolTerminated{fmt.Errorf("failed to sync txpool: %w", err)} + return &errTxPoolTerminated{err} } version := payloadVersion(c.eth.BlockChain().Config(), timestamp) diff --git a/eth/catalyst/simulated_beacon_api.go b/eth/catalyst/simulated_beacon_api.go index bc8d1cb159..34047a964c 100644 --- a/eth/catalyst/simulated_beacon_api.go +++ b/eth/catalyst/simulated_beacon_api.go @@ -73,8 +73,7 @@ func (a *simulatedBeaconAPI) loop() { } // Avoids spinlooping if the txPool is alredy terminated. if _, err := a.sim.commit(); err != nil { - var txpTermErr *errTxPoolTerminated - if errors.As(err, &txpTermErr) { + if errors.Is(err, &errTxPoolTerminated{}) { break } }