try {
wallet = walletFactory.get();
wallet.setKeychainLookaheadSize(2);
checkArgument(wallet.getParams() == UnitTestParams.get());
params = wallet.getParams();
store = new MemoryBlockStore(params);
chain = new BlockChain(params, wallet, store);
broadcaster = new MockTransactionBroadcaster(wallet);
} catch (BlockStoreException e) {
throw new RuntimeException(e); // Cannot happen.
}