Java Code Examples for org.bitcoinj.utils.BriefLogFormatter#initVerbose()

The following examples show how to use org.bitcoinj.utils.BriefLogFormatter#initVerbose() . 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: BlockChainTest.java    From bcm-android with GNU General Public License v3.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    BriefLogFormatter.initVerbose();
    Context.propagate(new Context(TESTNET, 100, Coin.ZERO, false));
    testNetChain = new BlockChain(TESTNET, new Wallet(TESTNET), new MemoryBlockStore(TESTNET));
    Context.propagate(new Context(UNITTEST, 100, Coin.ZERO, false));
    wallet = new Wallet(UNITTEST) {
        @Override
        public void receiveFromBlock(Transaction tx, StoredBlock block, BlockChain.NewBlockType blockType,
                                     int relativityOffset) throws VerificationException {
            super.receiveFromBlock(tx, block, blockType, relativityOffset);
            BlockChainTest.this.block[0] = block;
            if (isTransactionRelevant(tx) && tx.isCoinBase()) {
                BlockChainTest.this.coinbaseTransaction = tx;
            }
        }
    };
    wallet.freshReceiveKey();

    resetBlockStore();
    chain = new BlockChain(UNITTEST, wallet, blockStore);

    coinbaseTo = LegacyAddress.fromKey(UNITTEST, wallet.currentReceiveKey());
}
 
Example 2
Source File: BlockChainTest.java    From green_android with GNU General Public License v3.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    BriefLogFormatter.initVerbose();
    Context.propagate(new Context(testNet, 100, Coin.ZERO, false));
    testNetChain = new BlockChain(testNet, new Wallet(testNet), new MemoryBlockStore(testNet));
    Context.propagate(new Context(PARAMS, 100, Coin.ZERO, false));
    wallet = new Wallet(PARAMS) {
        @Override
        public void receiveFromBlock(Transaction tx, StoredBlock block, BlockChain.NewBlockType blockType,
                                     int relativityOffset) throws VerificationException {
            super.receiveFromBlock(tx, block, blockType, relativityOffset);
            BlockChainTest.this.block[0] = block;
            if (isTransactionRelevant(tx) && tx.isCoinBase()) {
                BlockChainTest.this.coinbaseTransaction = tx;
            }
        }
    };
    wallet.freshReceiveKey();

    resetBlockStore();
    chain = new BlockChain(PARAMS, wallet, blockStore);

    coinbaseTo = wallet.currentReceiveKey().toAddress(PARAMS);
}
 
Example 3
Source File: BlockChainTest.java    From GreenBits with GNU General Public License v3.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    BriefLogFormatter.initVerbose();
    Context.propagate(new Context(testNet, 100, Coin.ZERO, false));
    testNetChain = new BlockChain(testNet, new Wallet(testNet), new MemoryBlockStore(testNet));
    Context.propagate(new Context(PARAMS, 100, Coin.ZERO, false));
    wallet = new Wallet(PARAMS) {
        @Override
        public void receiveFromBlock(Transaction tx, StoredBlock block, BlockChain.NewBlockType blockType,
                                     int relativityOffset) throws VerificationException {
            super.receiveFromBlock(tx, block, blockType, relativityOffset);
            BlockChainTest.this.block[0] = block;
            if (isTransactionRelevant(tx) && tx.isCoinBase()) {
                BlockChainTest.this.coinbaseTransaction = tx;
            }
        }
    };
    wallet.freshReceiveKey();

    resetBlockStore();
    chain = new BlockChain(PARAMS, wallet, blockStore);

    coinbaseTo = wallet.currentReceiveKey().toAddress(PARAMS);
}