@Test
public void serializeTransactionsVpn() throws Exception, Bip44KeyLookAheadExceededException {

    WalletPocketHD account = new WalletPocketHD(rootKey, VPN, null, null);
    // Test tx with null extra bytes
    Transaction tx = new Transaction(VPN);
    tx.setTime(0x99999999);
    tx.addOutput(VPN.oneCoin().toCoin(), account.getFreshReceiveAddress());
    account.addNewTransactionIfNeeded(tx);
    WalletPocketHD newAccount = testWalletSerializationForCoin(account);
    Transaction newTx = newAccount.getRawTransaction(tx.getHash());
    assertNotNull(newTx);
    assertNotNull(newTx.getExtraBytes());
    assertEquals(0, newTx.getExtraBytes().length);
    // Test tx with empty extra bytes
    tx = new Transaction(VPN);
    tx.setTime(0x99999999);
    tx.setExtraBytes(new byte[0]);
    tx.addOutput(VPN.oneCoin().toCoin(), account.getFreshReceiveAddress());
    account.addNewTransactionIfNeeded(tx);
    newAccount = testWalletSerializationForCoin(account);
    newTx = newAccount.getRawTransaction(tx.getHash());
    assertNotNull(newTx);
    assertNotNull(newTx.getExtraBytes());
    assertEquals(0, newTx.getExtraBytes().length);
    // Test tx with extra bytes
    tx = new Transaction(VPN);
    tx.setTime(0x99999999);
    byte[] bytes = {0x1, 0x2, 0x3};
    tx.setExtraBytes(bytes);
    tx.addOutput(VPN.oneCoin().toCoin(), account.getFreshReceiveAddress());
    account.addNewTransactionIfNeeded(tx);
    newAccount = testWalletSerializationForCoin(account);
    newTx = newAccount.getRawTransaction(tx.getHash());
    assertNotNull(newTx);
    assertArrayEquals(bytes, newTx.getExtraBytes());
}