def test_processed(): echo = sha3(b'random') processed_message = Processed(ADDRESS, echo) assert processed_message.echo == echo data = processed_message.encode() msghash = sha3(data) decoded_processed_message = decode(data) assert decoded_processed_message.echo == processed_message.echo assert decoded_processed_message.sender == processed_message.sender assert sha3(decoded_processed_message.encode()) == msghash
def test_processed(): processed_message_identifier = random.randint(0, UINT64_MAX) processed_message = Processed(ADDRESS, processed_message_identifier) assert processed_message.processed_message_identifier == processed_message_identifier data = processed_message.encode() decoded_processed_message = decode(data) assert decoded_processed_message.processed_message_identifier == processed_message_identifier assert processed_message.processed_message_identifier == processed_message_identifier assert decoded_processed_message.sender == processed_message.sender assert sha3(decoded_processed_message.encode()) == sha3(data)
def test_processed(): message_identifier = random.randint(0, constants.UINT64_MAX) processed_message = Processed(message_identifier=message_identifier) processed_message.sign(signer) assert processed_message.sender == ADDRESS assert processed_message.message_identifier == message_identifier data = processed_message.encode() decoded_processed_message = decode(data) assert decoded_processed_message.message_identifier == message_identifier assert processed_message.message_identifier == message_identifier assert decoded_processed_message.sender == processed_message.sender assert sha3(decoded_processed_message.encode()) == sha3(data)
def test_processed(): message_identifier = random.randint(0, UINT64_MAX) processed_message = Processed(message_identifier) processed_message.sign(PRIVKEY, UNIT_CHAIN_ID) assert processed_message.sender == ADDRESS assert processed_message.message_identifier == message_identifier data = processed_message.encode() decoded_processed_message = decode(data) assert decoded_processed_message.message_identifier == message_identifier assert processed_message.message_identifier == message_identifier assert decoded_processed_message.sender == processed_message.sender assert sha3(decoded_processed_message.encode()) == sha3(data)
def test_processed(): message_identifier = random.randint(0, constants.UINT64_MAX) processed_message = Processed(message_identifier) processed_message.sign(PRIVKEY) assert processed_message.sender == ADDRESS assert processed_message.message_identifier == message_identifier data = processed_message.encode() decoded_processed_message = decode(data) assert decoded_processed_message.message_identifier == message_identifier assert processed_message.message_identifier == message_identifier assert decoded_processed_message.sender == processed_message.sender assert sha3(decoded_processed_message.encode()) == sha3(data)