public RemoteCall<TransactionReceipt> addUser(byte[] name, String addr, byte[] pk_pre, byte[] pk_bk) { final Function function = new Function( FUNC_ADDUSER, Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(name), new org.web3j.abi.datatypes.Address(addr), new org.web3j.abi.datatypes.generated.Bytes32(pk_pre), new org.web3j.abi.datatypes.generated.Bytes32(pk_bk)), Collections.<TypeReference<?>>emptyList()); return executeRemoteCallTransaction(function); }
从executeRemoteCallTransaction入手,跟踪进去。看到
1 2 3 4 5 6 7 8
TransactionReceipt executeTransaction(String data, BigInteger weiValue, String funcName) throws TransactionException, IOException { TransactionReceipt receipt = this.send(this.contractAddress, data, weiValue, this.gasProvider.getGasPrice(funcName), this.gasProvider.getGasLimit(funcName)); if (!receipt.isStatusOK()) { throw new TransactionException(String.format("Transaction has failed with status: %s. Gas used: %d. (not-enough gas?)", receipt.getStatus(), receipt.getGasUsed())); } else { return receipt; } }
throw new TransactionException("Transaction receipt was not generated after " + sleepDuration * (long)attempts / 1000L + " seconds for transaction: " + transactionHash); }