Skip to content

Commit

Permalink
fixing pool_metadata method
Browse files Browse the repository at this point in the history
  • Loading branch information
Quixote committed Mar 2, 2024
1 parent a5da31b commit fac724c
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 8 deletions.
Binary file modified __pycache__/test_koios.cpython-310-pytest-7.2.0.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified koios_python/__pycache__/account.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/account.cpython-312.pyc
Binary file not shown.
Binary file modified koios_python/__pycache__/address.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/address.cpython-312.pyc
Binary file not shown.
Binary file modified koios_python/__pycache__/asset.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/asset.cpython-312.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/block.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file modified koios_python/__pycache__/epoch.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/epoch.cpython-312.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/network.cpython-312.pyc
Binary file not shown.
Binary file modified koios_python/__pycache__/ogmios.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/ogmios.cpython-312.pyc
Binary file not shown.
Binary file modified koios_python/__pycache__/pool.cpython-310.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/pool.cpython-312.pyc
Binary file not shown.
Binary file added koios_python/__pycache__/scripts.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file added koios_python/__pycache__/urls.cpython-312.pyc
Binary file not shown.
10 changes: 5 additions & 5 deletions koios_python/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ def get_pool_metadata(self, *args):
pool_list = requests.post(self.POOL_METADATA_URL, json = get_format, timeout=timeout)
pool_list = json.loads(pool_list.content)

if self.BEARER is not None and len(args) == 0:
if self.BEARER is not None and len(args) != 0:
get_format = {"_pool_bech32_ids": [args] }
custom_headers = {"Authorization": f"Bearer {self.BEARER}"}
pool_list = requests.get(self.POOL_METADATA_URL, headers = custom_headers, timeout=timeout)
pool_list = requests.get(self.POOL_METADATA_URL, headers = custom_headers, json = get_format, timeout=timeout)
pool_list = json.loads(pool_list.content)

if len(args) == 0:
pool_list = args
else:
pool_list = None

return pool_list

Expand Down
6 changes: 3 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# from koios_python import block, epochs # alternative if we just need some functions
import time
import os
from dotenv import load_dotenv
#from dotenv import load_dotenv
# load the environment variables
load_dotenv()
#load_dotenv()
# Get api token
token = os.getenv("TOKEN")

Expand All @@ -20,7 +20,7 @@
#kp = URLs() # We need to create an instance of the class URLs (no bearer token) FREE TIER

# Select this if you are usinf Bearer Token. We need to create an instance of the class URLs (with bearer token)
kp = URLs(bearer=token)
#kp = URLs(bearer=token)
#pp.pprint(kp.BEARER)

##########################################################################################
Expand Down

0 comments on commit fac724c

Please sign in to comment.