-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: replace deprecated pkg_resources.resource_string
Replace usage in chains/ethereum.py by `importlib.resources.load_text`.
- Loading branch information
1 parent
62a1f7e
commit e717fe4
Showing
2 changed files
with
23 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
from configmanager import Config | ||
from web3 import Web3 | ||
|
||
from aleph.chains.ethereum import get_contract | ||
|
||
|
||
@pytest.fixture | ||
def web3(): | ||
return Web3() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_get_contract(mock_config: Config, web3: Web3): | ||
contract = await get_contract(config=mock_config, web3=web3) | ||
# The type hint provided by the web3 library is clearly wrong. This is a simple check | ||
# to ensure that we get a proper web3 object. Improve as needed. | ||
assert contract.w3 == web3 |