Skip to content

Commit

Permalink
[bugfix] Set network value to 'mainnet' in blockfrost if only mainnet…
Browse files Browse the repository at this point in the history
… api url is provided (#353)
  • Loading branch information
cffls authored Jun 1, 2024
1 parent f50a955 commit a2d9ac0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pycardano/backend/blockfrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def __init__(
if self.network == Network.TESTNET
else ApiUrls.mainnet.value
)

# Set network value to mainnet if base_url contains "mainnet".
if "mainnet" in self._base_url.value:
self._network = Network.MAINNET

self.api = BlockFrostApi(project_id=self._project_id, base_url=self._base_url)
self._epoch_info = self.api.epoch_latest()
self._epoch = None
Expand Down

0 comments on commit a2d9ac0

Please sign in to comment.