use of org.ethereum.core.Account in project rskj by rsksmart.
the class TransactionPoolImplTest method createSampleNewTransactionPoolWithAccounts.
private static TransactionPoolImpl createSampleNewTransactionPoolWithAccounts(int naccounts, Coin balance, BlockChainImpl blockChain) {
Block best = blockChain.getStatus().getBestBlock();
Repository repository = blockChain.getRepository();
Repository track = repository.startTracking();
for (int k = 1; k <= naccounts; k++) {
Account account = createAccount(k);
track.createAccount(account.getAddress());
track.addBalance(account.getAddress(), balance);
}
track.commit();
best.setStateRoot(repository.getRoot());
best.flushRLP();
TransactionPoolImpl transactionPool = new TransactionPoolImpl(config, blockChain.getRepository(), blockChain.getBlockStore(), null, new ProgramInvokeFactoryImpl(), new BlockExecutorTest.SimpleEthereumListener(), 10, 100);
blockChain.setTransactionPool(transactionPool);
return transactionPool;
}
use of org.ethereum.core.Account in project rskj by rsksmart.
the class Wallet method addAccountWithPrivateKey.
public byte[] addAccountWithPrivateKey(byte[] privateKeyBytes) {
Account account = new Account(ECKey.fromPrivate(privateKeyBytes));
synchronized (accessLock) {
RskAddress addr = addAccount(account);
this.initialAccounts.add(addr);
return addr.getBytes();
}
}
Aggregations