mirror of https://github.com/nucypher/nucypher.git
Fix mocking of tester chain
parent
beec9958d1
commit
417c8b0fd4
|
@ -50,7 +50,7 @@ with open(VECTORS_FILE, 'r') as file:
|
|||
def mock_condition_blockchains(mocker):
|
||||
"""adds testerchain to permitted conditional chains"""
|
||||
mocker.patch.object(
|
||||
nucypher.policy.conditions.evm, "_CONDITION_CHAINS", tuple([80001])
|
||||
nucypher.policy.conditions.evm, "_CONDITION_CHAINS", tuple([131277322940537])
|
||||
)
|
||||
|
||||
|
||||
|
@ -108,7 +108,9 @@ def erc20_evm_condition(test_registry, agency):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def custom_context_variable_erc20_condition(test_registry, agency, testerchain):
|
||||
def custom_context_variable_erc20_condition(
|
||||
test_registry, agency, testerchain, mock_condition_blockchains
|
||||
):
|
||||
token = ContractAgency.get_agent(NucypherTokenAgent, registry=test_registry)
|
||||
condition = ContractCondition(
|
||||
contract_address=token.contract.address,
|
||||
|
|
|
@ -91,7 +91,7 @@ def _dont_validate_user_address(context_variable: str, **context):
|
|||
|
||||
|
||||
def test_required_context_variable(
|
||||
testerchain, custom_context_variable_erc20_condition, condition_providers
|
||||
custom_context_variable_erc20_condition, condition_providers
|
||||
):
|
||||
with pytest.raises(RequiredContextVariable):
|
||||
custom_context_variable_erc20_condition.verify(
|
||||
|
|
|
@ -146,4 +146,4 @@ CLI_TEST_ENV = {NUCYPHER_ENVVAR_KEYSTORE_PASSWORD: INSECURE_DEVELOPMENT_PASSWORD
|
|||
|
||||
CLI_ENV = {NUCYPHER_ENVVAR_KEYSTORE_PASSWORD: INSECURE_DEVELOPMENT_PASSWORD,
|
||||
NUCYPHER_ENVVAR_OPERATOR_ETH_PASSWORD: INSECURE_DEVELOPMENT_PASSWORD}
|
||||
TESTERCHAIN_CHAIN_ID = 80001
|
||||
TESTERCHAIN_CHAIN_ID = 131277322940537
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"TStaking": {
|
||||
"contractAddress": "0x01B67b1194C75264d06F808A921228a95C765dd7",
|
||||
"chain": 80001,
|
||||
"chain": 131277322940537,
|
||||
"method": "stakes",
|
||||
"functionAbi": {
|
||||
"inputs": [
|
||||
|
|
|
@ -39,7 +39,7 @@ with open(VECTORS_FILE, 'r') as file:
|
|||
def mock_condition_blockchains(mocker):
|
||||
"""adds testerchain to permitted conditional chains"""
|
||||
mocker.patch.object(
|
||||
nucypher.policy.conditions.evm, "_CONDITION_CHAINS", tuple([80001])
|
||||
nucypher.policy.conditions.evm, "_CONDITION_CHAINS", tuple([131277322940537])
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue