-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom networks work with explorer (#2325)
- Loading branch information
Showing
4 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from typing import Optional | ||
|
||
import pytest | ||
from ethpm_types import ContractType | ||
|
||
from ape.api import ExplorerAPI | ||
from ape.types import AddressType | ||
|
||
|
||
class MyExplorer(ExplorerAPI): | ||
def get_transaction_url(self, transaction_hash: str) -> str: | ||
return "" | ||
|
||
def get_address_url(self, address: AddressType) -> str: | ||
return "" | ||
|
||
def get_contract_type(self, address: AddressType) -> Optional[ContractType]: | ||
return None | ||
|
||
def publish_contract(self, address: AddressType): | ||
return | ||
|
||
|
||
@pytest.fixture | ||
def explorer(networks): | ||
return MyExplorer(name="mine", network=networks.ethereum.local) | ||
|
||
|
||
def test_supports_chain(explorer): | ||
assert not explorer.supports_chain(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters