From f10fae5c199a551a6e2f99bfb5296c688ba00c9b Mon Sep 17 00:00:00 2001 From: golangisfun123 Date: Fri, 21 Jun 2024 11:14:47 -0500 Subject: [PATCH] safe --- ethergo/listener/options.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ethergo/listener/options.go b/ethergo/listener/options.go index 9413ab315e..b8032e0ec1 100644 --- a/ethergo/listener/options.go +++ b/ethergo/listener/options.go @@ -2,6 +2,7 @@ package listener import ( "context" + "strings" "time" "github.com/ethereum/go-ethereum/rpc" @@ -30,13 +31,15 @@ func WithPollInterval(interval time.Duration) Option { // WithFinalityMode sets the finality mode. func WithFinalityMode(mode string) Option { return func(c *chainListener) { - switch mode { + switch strings.ToLower(mode) { case "latest": c.finalityMode = rpc.LatestBlockNumber case "safe": c.finalityMode = rpc.SafeBlockNumber case "finalized": c.finalityMode = rpc.FinalizedBlockNumber + default: + c.finalityMode = rpc.SafeBlockNumber } } }