def __init__( self, message_identifier: typing.MessageID, secret: typing.Secret, balance_proof: BalanceProofSignedState, ): if not isinstance(balance_proof, BalanceProofSignedState): raise ValueError('balance_proof must be an instance of BalanceProofSignedState') secrethash: typing.SecretHash = typing.SecretHash(sha3(secret)) self.message_identifier = message_identifier self.secret = secret self.secrethash = secrethash self.balance_proof = balance_proof
def __init__( self, payment_network_identifier: typing.PaymentNetworkID, token_address: typing.TokenAddress, channel_identifier: typing.ChannelID, secret: typing.Secret, receiver: typing.Address, ): if not isinstance(receiver, typing.T_Address): raise ValueError('receiver must be of type address') secrethash: typing.SecretHash = typing.SecretHash(sha3(secret)) self.payment_network_identifier = payment_network_identifier self.token_address = token_address self.channel_identifier = channel_identifier self.secret = secret self.secrethash = secrethash self.receiver = receiver
def __repr__(self): secrethash: typing.SecretHash = typing.SecretHash(sha3(self.secret)) return '<ContractSendSecretReveal secrethash:{}>'.format(secrethash)