use of co.rsk.test.builders.TransactionBuilder in project rskj by rsksmart.
the class RskTestFactory method executeRawContract.
public ProgramResult executeRawContract(byte[] bytecode, byte[] encodedCall, BigInteger value) {
Account sender = new AccountBuilder(getBlockchain()).name("sender").balance(Coin.valueOf(10000000L)).build();
BigInteger nonceCreate = getRepository().getNonce(sender.getAddress());
Transaction creationTx = new TransactionBuilder().gasLimit(BigInteger.valueOf(3000000)).sender(sender).data(bytecode).nonce(nonceCreate.longValue()).build();
executeTransaction(creationTx);
BigInteger nonceExecute = getRepository().getNonce(sender.getAddress());
Transaction transaction = new TransactionBuilder().gasLimit(BigInteger.valueOf(3000000)).sender(sender).receiverAddress(creationTx.getContractAddress().getBytes()).data(encodedCall).nonce(nonceExecute.longValue()).value(value).build();
return executeTransaction(transaction).getResult();
}
Aggregations