use of com.radixdlt.api.core.openapitools.model.ConstructionSubmitResponse in project radixdlt by radixdlt.
the class ConstructionSubmitHandler method handleRequest.
@Override
public ConstructionSubmitResponse handleRequest(ConstructionSubmitRequest request) throws CoreApiException {
modelMapper.verifyNetwork(request.getNetworkIdentifier());
var txn = modelMapper.txn(request.getSignedTransaction());
try {
radixEngineStateComputer.addToMempool(txn);
return new ConstructionSubmitResponse().transactionIdentifier(modelMapper.transactionIdentifier(txn.getId())).duplicate(false);
} catch (MempoolDuplicateException e) {
return new ConstructionSubmitResponse().transactionIdentifier(modelMapper.transactionIdentifier(txn.getId())).duplicate(true);
} catch (MempoolFullException e) {
throw modelMapper.mempoolFullException(e);
} catch (MempoolRejectedException e) {
var reException = (RadixEngineException) e.getCause();
throw modelMapper.radixEngineException(reException);
}
}
Aggregations