From 0d6ee50373a758187ad96d6b5541584cbe4b3924 Mon Sep 17 00:00:00 2001 From: fubuloubu <3859395+fubuloubu@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:53:34 -0400 Subject: [PATCH] fix: remove `global` as bad practice --- bots/example.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bots/example.py b/bots/example.py index 4944e7c..9003850 100644 --- a/bots/example.py +++ b/bots/example.py @@ -11,7 +11,6 @@ # NOTE: This bot assumes you use a new bot per deployment sm = StreamManager(os.environ["APEPAY_CONTRACT_ADDRESS"]) -global db # NOTE: You would probably want to index this by network and deployment, # if you were operating on multiple networks or deployments db = [] @@ -20,13 +19,9 @@ @app.on_startup() async def load_db(_): - global db - for stream in sm.active_streams(): db.append(stream) - db = sorted(db) - @sm.on_stream_created(app) async def grant_product(stream):