-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to accomodate required cli options, polygon-endpoint, an…
…d use of TACoChildApplicationAgent for sampling.
- Loading branch information
1 parent
f9fe8b3
commit 59d12d9
Showing
3 changed files
with
56 additions
and
3 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,26 @@ | ||
from typing import Iterable, Optional | ||
|
||
import pytest | ||
from eth_typing import ChecksumAddress | ||
from nucypher.blockchain.eth.agents import ( | ||
StakingProvidersReservoir, | ||
TACoApplicationAgent, | ||
) | ||
|
||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def mock_sample_reservoir(testerchain, mock_contract_agency): | ||
def mock_reservoir( | ||
without: Optional[Iterable[ChecksumAddress]] = None, *args, **kwargs | ||
): | ||
addresses = { | ||
address: 1 | ||
for address in testerchain.stake_providers_accounts | ||
if address not in without | ||
} | ||
return StakingProvidersReservoir(addresses) | ||
|
||
# TODO - this is needed for PRE Policy.enact(...) sample functionality which | ||
# uses TACoApplication - should we change this (in `nucypher`)? | ||
mock_agent = mock_contract_agency.get_agent(TACoApplicationAgent) | ||
mock_agent.get_staking_provider_reservoir = mock_reservoir |
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