Examples of WalletProtobufSerializer


Examples of com.google.bitcoin.store.WalletProtobufSerializer

                Wallet wallet = new Wallet(networkParams);
                addExtensionsToWallet(wallet);

                Protos.Wallet walletData = WalletProtobufSerializer.parseToProto(stream);
                new WalletProtobufSerializer().readWallet(walletData, wallet);

                if (!wallet.isConsistent()) {
                    log.error("Loaded an inconsistent wallet");
                }
View Full Code Here

Examples of org.bitcoinj.store.WalletProtobufSerializer

            return data;
        }
    }

    public org.bitcoinj.wallet.Protos.Wallet serialize() {
        WalletProtobufSerializer serializer = new WalletProtobufSerializer();
        return serializer.walletToProto(this);
    }
View Full Code Here

Examples of org.bitcoinj.store.WalletProtobufSerializer

        System.out.println(roundTrip(wallet));
    }

    private static Wallet roundTrip(Wallet wallet) throws Exception {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        new WalletProtobufSerializer().writeWallet(wallet, output);
        ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray());
        return PledgingWallet.deserialize(Protos.Wallet.parseFrom(input));
    }
View Full Code Here

Examples of org.bitcoinj.store.WalletProtobufSerializer

        WalletProtobufSerializer serializer = new WalletProtobufSerializer();
        return serializer.walletToProto(this);
    }

    public static PledgingWallet deserialize(org.bitcoinj.wallet.Protos.Wallet proto) throws UnreadableWalletException {
        WalletProtobufSerializer serializer = new WalletProtobufSerializer(PledgingWallet::new);
        NetworkParameters params = NetworkParameters.fromID(proto.getNetworkIdentifier());
        return (PledgingWallet) serializer.readWallet(params, new WalletExtension[]{new PledgeStorage(null)}, proto);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.