private String sendTransaction( Credentials credentials, String contractAddress, BigInteger gas, String encodedFunction) throws Exception { BigInteger nonce = getNonce(credentials.getAddress()); Transaction transaction = Transaction.createFunctionCallTransaction( credentials.getAddress(), nonce, Transaction.DEFAULT_GAS, gas, contractAddress, encodedFunction); org.web3j.protocol.core.methods.response.EthSendTransaction transactionResponse = web3j.ethSendTransaction(transaction).sendAsync().get(); assertFalse(transactionResponse.hasError()); return transactionResponse.getTransactionHash(); }
@Test public void testTraceCall() throws Exception { Transaction transaction = Transaction.createFunctionCallTransaction( "0xc171033d5cbff7175f29dfd3a63dda3d6f8f385e", BigInteger.ONE,
BigInteger gasPrice = Convert.toWei(BigDecimal.valueOf(5), Convert.Unit.GWEI).toBigInteger(); Transaction transaction = Transaction.createFunctionCallTransaction(fromAddress, nonce, gasPrice, BigInteger.valueOf(60000), contractAddress, data);
BigInteger etherAmountToSend = BigInteger.valueOf(etherAmount); Transaction transaction = Transaction.createFunctionCallTransaction( credentials.getAddress(), getNextNonce(credentials.getAddress(),