From 37110ea5dba22dc2d9f9c2ef55e38f6d71ff3627 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Tue, 7 May 2024 15:58:30 +0800 Subject: [PATCH] config updates --- .gitignore | 2 +- config.toml | 2 +- internal/cache/cache.go | 2 +- internal/cache/map.go | 2 +- internal/handler/index_add.go | 2 +- internal/handler/index_remove.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 09ffe83..c527167 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -celo_tracker_blocks_db +tracker_db .vscode \ No newline at end of file diff --git a/config.toml b/config.toml index ec8b885..da66602 100644 --- a/config.toml +++ b/config.toml @@ -8,7 +8,7 @@ address = ":5001" ws_endpoint = "wss://forno.celo.org/ws" rpc_endpoint = "https://forno.celo.org" testnet = false -start_block = 25462593 +start_block = 0 [bootstrap] diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 49e31e5..b0c0ec3 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -15,7 +15,7 @@ type ( Add(string) Remove(string) SetWatchableIndex(WatchableIndex) - IsWatchAbleIndex(string) bool + IsWatchableIndex(string) bool Size() int } diff --git a/internal/cache/map.go b/internal/cache/map.go index edf16ba..7654d30 100644 --- a/internal/cache/map.go +++ b/internal/cache/map.go @@ -46,7 +46,7 @@ func (c *MapCache) SetWatchableIndex(watchableIndex WatchableIndex) { c.watchableIndex = watchableIndex } -func (c *MapCache) IsWatchAbleIndex(key string) bool { +func (c *MapCache) IsWatchableIndex(key string) bool { _, ok := c.watchableIndex[key] return ok } diff --git a/internal/handler/index_add.go b/internal/handler/index_add.go index 693f1d5..5349776 100644 --- a/internal/handler/index_add.go +++ b/internal/handler/index_add.go @@ -55,7 +55,7 @@ func (h *IndexAddHandler) HandleLog(ctx context.Context, msg LogMessage, pub pub }, } - if h.cache.IsWatchAbleIndex(address.Hex()) { + if h.cache.IsWatchableIndex(address.Hex()) { h.cache.Add(address.Hex()) } diff --git a/internal/handler/index_remove.go b/internal/handler/index_remove.go index 2bd6ae6..472dbe3 100644 --- a/internal/handler/index_remove.go +++ b/internal/handler/index_remove.go @@ -54,7 +54,7 @@ func (h *IndexRemoveHandler) HandleLog(ctx context.Context, msg LogMessage, pub }, } - if h.cache.IsWatchAbleIndex(address.Hex()) { + if h.cache.IsWatchableIndex(address.Hex()) { h.cache.Remove(address.Hex()) }