Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
Quixote committed Dec 10, 2022
1 parent 47eb4fc commit 50fdde0
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions koios_python/epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
import requests

def get_epoch_info(self, epoch_no=None):
"""
Get the epoch information, all epochs if no epoch specified.
:param int epoch_no: epoch number to fetch details for.
:return: list of detailed summary for each epoch.
:rtype: list
"""
if epoch_no is None:
info = requests.get(self.EPOCH_INFO_URL, timeout=10)
print(self.EPOCH_INFO_URL)
info = json.loads(info.content)
else:
info = requests.get(f"{self.EPOCH_INFO_URL}?_epoch_no={epoch_no}", timeout=10)
print(self.EPOCH_INFO_URL)
info = json.loads(info.content)
return info
"""
Get the epoch information, all epochs if no epoch specified.
:param int epoch_no: epoch number to fetch details for.
:return: list of detailed summary for each epoch.
:rtype: list
"""
if epoch_no is None:
info = requests.get(self.EPOCH_INFO_URL, timeout=10)
print(self.EPOCH_INFO_URL)
info = json.loads(info.content)
else:
info = requests.get(f"{self.EPOCH_INFO_URL}?_epoch_no={epoch_no}", timeout=10)
print(self.EPOCH_INFO_URL)
info = json.loads(info.content)
return info


def get_epoch_params(self, epoch_no=None):
Expand All @@ -41,6 +41,7 @@ def get_epoch_params(self, epoch_no=None):
info = json.loads(info.content)
return info


def get_epoch_block_protocols(self, epoch_no=None):
"""
Get the information about block protocol distribution in epoch
Expand All @@ -56,4 +57,3 @@ def get_epoch_block_protocols(self, epoch_no=None):
info = requests.get(f"{self.EPOCH_BLOCKS_URL}?_epoch_no={epoch_no}", timeout=10)
info = json.loads(info.content)
return info

0 comments on commit 50fdde0

Please sign in to comment.