use of org.ethereum.core.ImmutableTransaction in project rskj by rsksmart.
the class EthModuleTransactionBase method sendRawTransaction.
@Override
public String sendRawTransaction(String rawData) {
String s = null;
try {
Transaction tx = new ImmutableTransaction(stringHexToByteArray(rawData));
if (null == tx.getGasLimit() || null == tx.getGasPrice() || null == tx.getValue()) {
throw invalidParamError("Missing parameter, gasPrice, gas or value");
}
TransactionPoolAddResult result = transactionGateway.receiveTransaction(tx);
if (!result.transactionsWereAdded()) {
throw RskJsonRpcRequestException.transactionError(result.getErrorMessage());
}
return s = tx.getHash().toJsonString();
} finally {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("eth_sendRawTransaction({}): {}", rawData, s);
}
}
}
Aggregations