Exemple #1
0
def make_signed_balance_proof(
        nonce,
        transferred_amount,
        channel_address,
        locksroot,
        extra_hash,
        private_key,
        sender_address
):

    data_to_sign = balance_proof.signing_data(
        nonce,
        transferred_amount,
        channel_address,
        locksroot,
        extra_hash,
    )
    signature = signing.sign(data_to_sign, private_key)

    signed_balance_proof = BalanceProofSignedState(
        nonce,
        transferred_amount,
        locksroot,
        channel_address,
        extra_hash,
        signature,
        sender_address,
    )

    return signed_balance_proof
Exemple #2
0
def make_signed_balance_proof(
    nonce,
    transferred_amount,
    locked_amount,
    token_network_address,
    channel_address,
    locksroot,
    extra_hash,
    private_key,
    sender_address,
):

    data_to_sign = balance_proof.signing_data(
        nonce,
        transferred_amount,
        locked_amount,
        channel_address,
        locksroot,
        extra_hash,
    )

    balance_hash = hash_balance_data(
        transferred_amount,
        locked_amount,
        locksroot,
    )
    data_to_sign = balance_proof.pack_signing_data(
        nonce=nonce,
        balance_hash=balance_hash,
        additional_hash=extra_hash,
        channel_identifier=channel_address,
        token_network_identifier=token_network_address,
        chain_id=UNIT_CHAIN_ID,
    )

    signature = signing.sign(data_to_sign, private_key)

    signed_balance_proof = BalanceProofSignedState(
        nonce,
        transferred_amount,
        locked_amount,
        locksroot,
        token_network_address,
        channel_address,
        extra_hash,
        signature,
        sender_address,
        UNIT_CHAIN_ID,
    )

    return signed_balance_proof
Exemple #3
0
def make_signed_balance_proof(
        nonce,
        transferred_amount,
        locked_amount,
        token_network_address,
        channel_address,
        locksroot,
        extra_hash,
        private_key,
        sender_address,
):

    data_to_sign = balance_proof.signing_data(
        nonce,
        transferred_amount,
        locked_amount,
        channel_address,
        locksroot,
        extra_hash,
    )

    balance_hash = hash_balance_data(
        transferred_amount,
        locked_amount,
        locksroot,
    )
    data_to_sign = balance_proof.pack_signing_data(
        nonce=nonce,
        balance_hash=balance_hash,
        additional_hash=extra_hash,
        channel_identifier=channel_address,
        token_network_identifier=token_network_address,
        chain_id=UNIT_CHAIN_ID,
    )

    signature = signing.sign(data_to_sign, private_key)

    signed_balance_proof = BalanceProofSignedState(
        nonce,
        transferred_amount,
        locked_amount,
        locksroot,
        token_network_address,
        channel_address,
        extra_hash,
        signature,
        sender_address,
        UNIT_CHAIN_ID,
    )

    return signed_balance_proof