Skip to content

Commit c1ab0e6

Browse files
committed
Reformat with latest black
1 parent f6d3166 commit c1ab0e6

File tree

135 files changed

+634
-486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+634
-486
lines changed

raiden/api/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class ChannelNotFound(RaidenValidationError):
5-
""" Raised when a provided channel via the REST api is not found in the
5+
"""Raised when a provided channel via the REST api is not found in the
66
internal data structures.
77
"""
88

raiden/api/python.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def token_network_connect(
280280
initial_channel_target: int = 3,
281281
joinable_funds_target: float = 0.4,
282282
) -> None:
283-
""" Automatically maintain channels open for the given token network.
283+
"""Automatically maintain channels open for the given token network.
284284
285285
Args:
286286
token_address: the ERC20 token network to connect to.
@@ -379,7 +379,7 @@ def channel_open(
379379
reveal_timeout: BlockTimeout = None,
380380
retry_timeout: NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
381381
) -> ChannelID:
382-
""" Open a channel with the peer at `partner_address`
382+
"""Open a channel with the peer at `partner_address`
383383
with the given `token_address`.
384384
"""
385385
if settle_timeout is None:
@@ -532,7 +532,7 @@ def channel_open(
532532
return channel_state.identifier
533533

534534
def mint_token_for(self, token_address: TokenAddress, to: Address, value: TokenAmount) -> None:
535-
""" Try to mint `value` units of the token at `token_address` and
535+
"""Try to mint `value` units of the token at `token_address` and
536536
assign them to `to`, using `mintFor`.
537537
538538
Raises:
@@ -552,7 +552,7 @@ def set_total_channel_withdraw(
552552
total_withdraw: WithdrawAmount,
553553
retry_timeout: NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
554554
) -> None:
555-
""" Set the `total_withdraw` in the channel with the peer at `partner_address` and the
555+
"""Set the `total_withdraw` in the channel with the peer at `partner_address` and the
556556
given `token_address`.
557557
558558
Raises:
@@ -625,7 +625,7 @@ def set_total_channel_deposit(
625625
total_deposit: TokenAmount,
626626
retry_timeout: NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
627627
) -> None:
628-
""" Set the `total_deposit` in the channel with the peer at `partner_address` and the
628+
"""Set the `total_deposit` in the channel with the peer at `partner_address` and the
629629
given `token_address` in order to be able to do transfers.
630630
631631
Raises:
@@ -781,7 +781,7 @@ def set_reveal_timeout(
781781
partner_address: Address,
782782
reveal_timeout: BlockTimeout,
783783
) -> None:
784-
""" Set the `reveal_timeout` in the channel with the peer at `partner_address` and the
784+
"""Set the `reveal_timeout` in the channel with the peer at `partner_address` and the
785785
given `token_address`.
786786
787787
Raises:

raiden/api/rest.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,9 @@ def get_raiden_events_payment_history_with_timestamps(
881881
)
882882
else:
883883
log.warning(
884-
"Unexpected event", node=self.checksum_address, unexpected_event=event.event,
884+
"Unexpected event",
885+
node=self.checksum_address,
886+
unexpected_event=event.event,
885887
)
886888

887889
result.append(serialized_event)
@@ -1053,7 +1055,8 @@ def _updated_channel_state_from_addresses(
10531055
if updated_channel_state:
10541056
result = self.channel_schema.dump(updated_channel_state)
10551057
result[CHANNEL_NETWORK_STATE] = views.get_node_network_status(
1056-
chain_state, updated_channel_state.partner_state.address,
1058+
chain_state,
1059+
updated_channel_state.partner_state.address,
10571060
).value
10581061
else:
10591062
result = None
@@ -1074,7 +1077,8 @@ def _updated_channel_state(
10741077
if updated_channel_state:
10751078
result = self.channel_schema.dump(updated_channel_state)
10761079
result[CHANNEL_NETWORK_STATE] = views.get_node_network_status(
1077-
chain_state, updated_channel_state.partner_state.address,
1080+
chain_state,
1081+
updated_channel_state.partner_state.address,
10781082
).value
10791083
else:
10801084
result = None

raiden/blockchain/decode.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def contractreceivenewtokennetwork_from_event(
8787
return ContractReceiveNewTokenNetwork(
8888
token_network_registry_address=token_network_registry_address,
8989
token_network=TokenNetworkState(
90-
address=token_network_address, token_address=token_address,
90+
address=token_network_address,
91+
token_address=token_address,
9192
),
9293
transaction_hash=event.transaction_hash,
9394
block_number=event.block_number,

raiden/blockchain/events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_contract_events(
116116
from_block: BlockIdentifier = GENESIS_BLOCK_NUMBER,
117117
to_block: BlockIdentifier = BLOCK_ID_LATEST,
118118
) -> List[Dict]:
119-
""" Query the blockchain for all events of the smart contract at
119+
"""Query the blockchain for all events of the smart contract at
120120
`contract_address` that match the filters `topics`, `from_block`, and
121121
`to_block`.
122122
"""
@@ -298,7 +298,7 @@ def fetch_all_events_for_a_deployment(
298298
start_block: BlockNumber,
299299
target_block: BlockNumber,
300300
) -> Iterable[Dict]:
301-
""" Read all the events of a whole deployment, starting at the network
301+
"""Read all the events of a whole deployment, starting at the network
302302
registry, and following the registered networks.
303303
"""
304304

raiden/blockchain/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ class UnknownRaidenEventType(RaidenUnrecoverableError):
1717

1818

1919
class EthGetLogsTimeout(RaidenRecoverableError):
20-
""" Raised when an eth.getLogs RPC call caused a ReadTimeout exception.
20+
"""Raised when an eth.getLogs RPC call caused a ReadTimeout exception.
2121
2222
It is used to automatically tune the block batching size.
2323
"""
2424

2525

2626
class BlockBatchSizeTooSmall(RaidenUnrecoverableError):
27-
""" Raised when the block batch size would have to be reduced below the minimum allowed value.
27+
"""Raised when the block batch size would have to be reduced below the minimum allowed value.
2828
2929
This is an unrecoverable error since it indicates that either the connected Eth-node or the
3030
network connection is not capable of supporting minimum performance requirements for the

raiden/blockchain/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get_filter_args_for_all_events_from_channel(
7070

7171

7272
def decode_event(abi: ABI, event_log: LogReceipt) -> EventData:
73-
""" Helper function to unpack event data using a provided ABI
73+
"""Helper function to unpack event data using a provided ABI
7474
7575
Args:
7676
abi: The ABI of the contract, not the ABI of the event

raiden/blockchain/state.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ def get_contractreceivechannelbatchunlock_data_from_event(
221221

222222

223223
def get_contractreceivechannelnew_data_from_event(
224-
chain_state: ChainState, event: DecodedEvent,
224+
chain_state: ChainState,
225+
event: DecodedEvent,
225226
) -> Optional[NewChannelDetails]:
226227
token_network_address = TokenNetworkAddress(event.originating_contract)
227228
data = event.event_data

raiden/blockchain/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class BlockBatchSizeAdjuster:
13-
""" Helper to dynamically adjust the block batch size.
13+
"""Helper to dynamically adjust the block batch size.
1414
1515
Internally it uses an exponential function of base ``base`` onto which the block range given
1616
in the config is mapped.
@@ -48,7 +48,7 @@ def _log(self, previous_batch_size: BlockNumber) -> None:
4848
)
4949

5050
def increase(self) -> None:
51-
""" Increase the block batch size.
51+
"""Increase the block batch size.
5252
5353
Does nothing if the value is already at the maximum.
5454
"""
@@ -59,7 +59,7 @@ def increase(self) -> None:
5959
self._log(previous_batch_size)
6060

6161
def decrease(self) -> None:
62-
""" Decrease the batch size.
62+
"""Decrease the batch size.
6363
6464
If the current value is already at the minimum raise ``BlockBatchSizeTooSmall``.
6565
"""
@@ -76,7 +76,7 @@ def decrease(self) -> None:
7676

7777
@property
7878
def batch_size(self) -> BlockNumber:
79-
""" Return the current batch size.
79+
"""Return the current batch size.
8080
8181
Clamps the value to the range given in the config.
8282
"""

raiden/connection_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def connect(
203203
self._open_channels()
204204

205205
def leave(self, registry_address: TokenNetworkRegistryAddress) -> List[NettingChannelState]:
206-
""" Leave the token network.
206+
"""Leave the token network.
207207
208208
This implies closing all channels and waiting for all channels to be
209209
settled.
@@ -418,7 +418,7 @@ def _join_partner(self, partner: Address) -> None:
418418
)
419419

420420
def _open_channels(self) -> bool:
421-
""" Open channels until there are `self.initial_channel_target`
421+
"""Open channels until there are `self.initial_channel_target`
422422
channels open. Do nothing if there are enough channels open already.
423423
424424
Note:

0 commit comments

Comments
 (0)