/** * Creates a new WalletAppKit, with a newly created {@link Context}. Files will be stored in the given directory. */ public WalletAppKit(NetworkParameters params, File directory, String filePrefix) { this(new Context(params), directory, filePrefix); }
/** * Creates a new WalletAppKit, with a newly created {@link Context}. Files will be stored in the given directory. */ public WalletAppKit(NetworkParameters params, File directory, String filePrefix) { this(new Context(params), directory, filePrefix); }
/** * Creates a new WalletAppKit, with a newly created {@link Context}. Files will be stored in the given directory. */ public WalletAppKit(NetworkParameters params, File directory, String filePrefix, boolean useSegwit) { this(new Context(params), directory, filePrefix, useSegwit); }
/** * Creates a new WalletAppKit, with a newly created {@link Context}. Files will be stored in the given directory. */ public WalletAppKit(NetworkParameters params, File directory, String filePrefix) { this(new Context(params), directory, filePrefix); }
@Bean public Context bitcoinContext(NetworkParameters chainNetworkParameters) { return new Context(chainNetworkParameters); }
/** * Construct a BitcoinClient from Network Parameters, URI, user name, and password. * @param netParams Correct Network Parameters for destination server * @param server URI of the Bitcoin RPC server * @param rpcuser Username (if required) * @param rpcpassword Password (if required) */ public BitcoinClient(NetworkParameters netParams, URI server, String rpcuser, String rpcpassword) { super(server, rpcuser, rpcpassword); this.context = new Context(netParams); mapper.registerModule(new RpcClientModule(context.getParams())); }
public static Context getOrCreate(NetworkParameters params) { Context context; try { context = get(); } catch (IllegalStateException e) { log.warn("Implicitly creating context. This is a migration step and this message will eventually go away."); context = new Context(params); return context; } if (context.getParams() != params) throw new IllegalStateException("Context does not match implicit network params: " + context.getParams() + " vs " + params); return context; }
public static Context getOrCreate(NetworkParameters params) { Context context; try { context = get(); } catch (IllegalStateException e) { log.warn("Implicitly creating context. This is a migration step and this message will eventually go away."); context = new Context(params); return context; } if (context.getParams() != params) throw new IllegalStateException("Context does not match implicit network params: " + context.getParams() + " vs " + params); return context; }
public static Context getOrCreate(NetworkParameters params) { Context context; try { context = get(); } catch (IllegalStateException e) { log.warn("Implicitly creating context. This is a migration step and this message will eventually go away."); context = new Context(params); return context; } if (context.getParams() != params) throw new IllegalStateException("Context does not match implicit network params: " + context.getParams() + " vs " + params); return context; }
@Before public void setup() { wallet = new Wallet(new Context(PARAMS)) { @Override public int getLastBlockSeenHeight() { return 1000; } @Override public long getLastBlockSeenTimeSecs() { return TIMESTAMP; } }; }
public static Context getOrCreate(NetworkParameters params) { Context context; try { context = get(); } catch (IllegalStateException e) { log.warn("Implicitly creating context. This is a migration step and this message will eventually go away."); context = new Context(params); return context; } if (context.getParams() != params) throw new IllegalStateException("Context does not match implicit network context: " + context.getParams() + " vs " + params); return context; }
@Before public void setUp() throws Exception { Context context = new Context(PARAMS); }
@Before public void setUp() throws Exception { Context context = new Context(PARAMS); }
@Before public void setUp() throws Exception { Context context = new Context(PARAMS); tx = FakeTxBuilder.createFakeTx(PARAMS); }
@Before public void setUp() throws Exception { BriefLogFormatter.initVerbose(); Context context = new Context(PARAMS); }
@Test public void estimatedBlockTime() throws Exception { NetworkParameters params = MainNetParams.get(); BlockChain prod = new BlockChain(new Context(params), new MemoryBlockStore(params)); Date d = prod.estimateBlockTime(200000); // The actual date of block 200,000 was 2012-09-22 10:47:00 assertEquals(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US).parse("2012-10-23T08:35:05.000-0700"), d); }
@Before public void setUp() throws Exception { BriefLogFormatter.init(); Context.propagate(new Context(PARAMS, 100, Coin.ZERO, false)); }
public void setUp() throws Exception { BriefLogFormatter.init(); Context.propagate(new Context(PARAMS, 100, Coin.ZERO, false)); wallet = new Wallet(PARAMS); myKey = wallet.currentReceiveKey(); myAddress = myKey.toAddress(PARAMS); blockStore = new MemoryBlockStore(PARAMS); chain = new BlockChain(PARAMS, wallet, blockStore); }
@Before public void setup() throws Exception { BriefLogFormatter.init(); Context context = new Context(PARAMS); table = context.getConfidenceTable(); Address to = new ECKey().toAddress(PARAMS); Address change = new ECKey().toAddress(PARAMS); tx1 = FakeTxBuilder.createFakeTxWithChangeAddress(PARAMS, COIN, to, change); tx2 = FakeTxBuilder.createFakeTxWithChangeAddress(PARAMS, COIN, to, change); assertEquals(tx1.getHash(), tx2.getHash()); address1 = new PeerAddress(PARAMS, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 })); address2 = new PeerAddress(PARAMS, InetAddress.getByAddress(new byte[] { 127, 0, 0, 2 })); address3 = new PeerAddress(PARAMS, InetAddress.getByAddress(new byte[] { 127, 0, 0, 3 })); }
@Before public void setUp() throws Exception { BriefLogFormatter.init(); Utils.setMockClock(); // Use mock clock Context.propagate(new Context(PARAMS, 100, Coin.ZERO, false)); MemoryBlockStore blockStore = new MemoryBlockStore(PARAMS); wallet = new Wallet(PARAMS); ECKey key1 = wallet.freshReceiveKey(); ECKey key2 = wallet.freshReceiveKey(); chain = new BlockChain(PARAMS, wallet, blockStore); coinsTo = key1.toAddress(PARAMS); coinsTo2 = key2.toAddress(PARAMS); someOtherGuy = new ECKey().toAddress(PARAMS); }