Ejemplo n.º 1
0
    def get(
        participants_to_sign: Collection[HexAddress],
        channel_identifier: ChannelID,
        participant_who_withdraws: HexAddress,
        amount_to_withdraw: TokenAmount,
        expiration_block: BlockExpiration,
        token_network_address: Optional[HexAddress] = None,
        v: int = 27,
    ) -> List[bytes]:
        if token_network_address is None:
            token_network_address = token_network.address

        signatures = []
        for participant in participants_to_sign:
            private_key = get_private_key(participant)
            signature = sign_withdraw_message(
                private_key,
                token_network_address,
                token_network.functions.chain_id().call(),
                channel_identifier,
                participant_who_withdraws,
                amount_to_withdraw,
                expiration_block,
                v,
            )
            signatures.append(signature)
        return signatures
Ejemplo n.º 2
0
    def get(
        participants_to_sign,
        channel_identifier,
        participant_who_withdraws,
        amount_to_withdraw,
        token_network_address=None,
        v=27,
    ):
        if token_network_address is None:
            token_network_address = token_network.address

        signatures = []
        for participant in participants_to_sign:
            private_key = get_private_key(participant)
            signature = sign_withdraw_message(
                private_key,
                token_network_address,
                int(token_network.functions.chain_id().call()),
                channel_identifier,
                participant_who_withdraws,
                amount_to_withdraw,
                v,
            )
            signatures.append(signature)
        return signatures