Esempio n. 1
0
 def packed_reward_proof_data(self, non_closing_signature: Signature) -> bytes:
     """Return reward proof data serialized to binary"""
     return pack_reward_proof(
         monitoring_service_contract_address=to_checksum_address(self.msc_address),
         chain_id=self.chain_id,
         token_network_address=HexAddress(to_checksum_address(self.token_network_address)),
         non_closing_participant=HexAddress(to_checksum_address(self.non_closing_participant)),
         non_closing_signature=non_closing_signature,
         reward_amount=self.reward_amount,
     )
Esempio n. 2
0
def pack_reward_proof(
    chain_id: ChainID,
    token_network_address: TokenNetworkAddress,
    reward_amount: TokenAmount,
    monitoring_service_contract_address: MonitoringServiceAddress,
    non_closing_participant: Address,
    non_closing_signature: Signature,
) -> bytes:
    return proofs.pack_reward_proof(
        monitoring_service_contract_address=to_hex_address(
            monitoring_service_contract_address),
        chain_id=chain_id,
        token_network_address=to_hex_address(token_network_address),
        non_closing_participant=to_hex_address(non_closing_participant),
        non_closing_signature=non_closing_signature,
        reward_amount=reward_amount,
    )