Skip to content

[bugfix] Set network value to 'mainnet' in blockfrost if only mainnet api url is provided #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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

Check warning on line 92 in pycardano/backend/blockfrost.py

View check run for this annotation

Codecov / codecov/patch

pycardano/backend/blockfrost.py#L92

Added line #L92 was not covered by tests

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
Loading