'Test encoding and decoding of wallet info'

def test_encode_decode_wallet_info(self):

    message = MockObject()
    meta_msg = self.market_community.get_meta_message(u'wallet-info')
    wallet_payload = WalletInfoPayload.Implementation(meta_msg, TraderId('abc'), MessageNumber('3'), TraderId('def'), TransactionNumber(5), WalletAddress('a'), WalletAddress('b'), Timestamp.now())
    message.payload = wallet_payload
    (packet,) = self.conversion._encode_wallet_info(message)
    self.assertTrue(packet)
    (_, decoded) = self.conversion._decode_wallet_info(self.get_placeholder_msg(u'wallet-info'), 0, packet)
    self.assertTrue(decoded)
    self.assertEqual(decoded.trader_id, TraderId('abc'))
    self.assertEqual(decoded.transaction_trader_id, TraderId('def'))
