Skip to content

Commit

Permalink
Fix typing after using types from raiden-contracts
Browse files Browse the repository at this point in the history
When raiden-network/raiden-contracts#813 gets
merged we need this changes to avoid mypy errors.
  • Loading branch information
karlb authored and palango committed Apr 3, 2019
1 parent bad5877 commit 18d2455
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/monitoring_service/blockchain.py
Expand Up @@ -95,7 +95,7 @@ def query_blockchain_events(
events = web3.eth.getLogs(filter_params)

return [
decode_event(contract_manager.get_contract_abi(contract_name), raw_event)
decode_event(ABI(contract_manager.get_contract_abi(contract_name)), raw_event)
for raw_event in events
]

Expand Down
13 changes: 7 additions & 6 deletions tests/monitoring/monitoring_service/test_states.py
Expand Up @@ -14,7 +14,7 @@
from raiden.utils.typing import BlockNumber, ChannelID, TokenAmount
from raiden_contracts.constants import ChannelState
from raiden_contracts.tests.utils import get_random_address, get_random_privkey
from raiden_libs.types import TransactionHash
from raiden_libs.types import Address, TokenNetworkAddress, TransactionHash
from raiden_libs.utils import keccak, private_key_to_address


Expand Down Expand Up @@ -89,18 +89,19 @@ def test_save_and_load_channel(ms_database):
for update_status in [
None,
OnChainUpdateStatus(
update_sender_address=get_random_address(), nonce=random.randint(0, UINT256_MAX)
update_sender_address=Address(get_random_address()),
nonce=random.randint(0, UINT256_MAX),
),
]:
channel = Channel(
token_network_address=token_network_address,
token_network_address=TokenNetworkAddress(token_network_address),
identifier=ChannelID(random.randint(0, UINT256_MAX)),
participant1=get_random_address(),
participant2=get_random_address(),
participant1=Address(get_random_address()),
participant2=Address(get_random_address()),
settle_timeout=random.randint(0, UINT256_MAX),
state=random.choice(list(ChannelState)),
closing_block=BlockNumber(random.randint(0, UINT256_MAX)),
closing_participant=get_random_address(),
closing_participant=Address(get_random_address()),
closing_tx_hash=TransactionHash('%d' % random.randint(0, UINT64_MAX)),
claim_tx_hash=TransactionHash('%d' % random.randint(0, UINT64_MAX)),
update_status=update_status,
Expand Down

0 comments on commit 18d2455

Please sign in to comment.