This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
forked from raiden-network/raiden-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The main required change is to add the new `chain_id` and `one_to_n_address` parameters to the IOU. Closes raiden-network#267.
- Loading branch information
Showing
17 changed files
with
183 additions
and
80 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
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
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
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
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
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
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,37 @@ | ||
import pytest | ||
from eth_utils import encode_hex, to_checksum_address | ||
|
||
from pathfinding_service.config import MIN_IOU_EXPIRY | ||
from pathfinding_service.model import IOU | ||
from raiden.utils.typing import Address | ||
from raiden_contracts.utils import sign_one_to_n_iou | ||
from raiden_libs.utils import private_key_to_address | ||
|
||
|
||
@pytest.fixture | ||
def make_iou(one_to_n_contract): | ||
def f( | ||
sender_priv_key, | ||
receiver: Address, | ||
amount=1, | ||
expiration_block=MIN_IOU_EXPIRY + 100, | ||
one_to_n_address=one_to_n_contract.address, | ||
chain_id=1, | ||
) -> IOU: | ||
receiver_hex: str = to_checksum_address(receiver) | ||
iou_dict = { | ||
"sender": to_checksum_address(private_key_to_address(sender_priv_key)), | ||
"receiver": receiver_hex, | ||
"amount": amount, | ||
"expiration_block": expiration_block, | ||
"one_to_n_address": to_checksum_address(one_to_n_address), | ||
"chain_id": chain_id, | ||
} | ||
iou_dict["signature"] = encode_hex( | ||
sign_one_to_n_iou(privatekey=sender_priv_key, **iou_dict) | ||
) | ||
iou = IOU.Schema(strict=True).load(iou_dict)[0] | ||
iou.claimed = False | ||
return iou | ||
|
||
return f |
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
Oops, something went wrong.