Java Code Examples for org.bitcoinj.wallet.WalletProtobufSerializer#parseToProto()

The following examples show how to use org.bitcoinj.wallet.WalletProtobufSerializer#parseToProto() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChannelConnectionTest.java    From bcm-android with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripClientWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    StoredPaymentChannelClientStates state = new StoredPaymentChannelClientStates(null, failBroadcaster);
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[]{state}, proto);
}
 
Example 2
Source File: ChannelConnectionTest.java    From bcm-android with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripServerWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    StoredPaymentChannelServerStates state = new StoredPaymentChannelServerStates(null, failBroadcaster);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[]{state}, proto);
}
 
Example 3
Source File: ChannelConnectionTest.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripClientWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    StoredPaymentChannelClientStates state = new StoredPaymentChannelClientStates(null, failBroadcaster);
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}
 
Example 4
Source File: ChannelConnectionTest.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripServerWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    StoredPaymentChannelServerStates state = new StoredPaymentChannelServerStates(null, failBroadcaster);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}
 
Example 5
Source File: ChannelConnectionTest.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripClientWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    StoredPaymentChannelClientStates state = new StoredPaymentChannelClientStates(null, failBroadcaster);
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}
 
Example 6
Source File: ChannelConnectionTest.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
private static Wallet roundTripServerWallet(Wallet wallet) throws Exception {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    new WalletProtobufSerializer().writeWallet(wallet, bos);
    StoredPaymentChannelServerStates state = new StoredPaymentChannelServerStates(null, failBroadcaster);
    org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
    return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}