def test_get_optimized_address_state2(self): alice_xmss = get_alice_xmss() alice_address = alice_xmss.address address_state = OptimizedAddressState.get_optimized_address_state(self.state, alice_address) addresses_state = { alice_address: address_state } self.assertTrue(isinstance(address_state.address, bytes)) OptimizedAddressState.put_optimized_addresses_state(self.state, addresses_state) address_state = OptimizedAddressState.get_optimized_address_state(self.state, alice_address) self.assertTrue(isinstance(address_state.address, bytes))
def test_get_optimized_address_state(self): alice_xmss = get_alice_xmss() alice_address = alice_xmss.address address_state = OptimizedAddressState.get_optimized_address_state(self.state, alice_address) self.assertTrue(isinstance(address_state.address, bytes)) alice_address = bytearray(alice_xmss.address) with self.assertRaises(TypeError): OptimizedAddressState.get_optimized_address_state(self.state, alice_address) alice_address = alice_xmss.address address_state = OptimizedAddressState.get_optimized_address_state(self.state, alice_address) addresses_state = { alice_address: address_state } self.assertTrue(isinstance(address_state.address, bytes)) AddressState.put_addresses_state(self.state, addresses_state) address_state = OptimizedAddressState.get_optimized_address_state(self.state, alice_address) self.assertTrue(isinstance(address_state.address, bytes))