feat: retrieve a record even if a transaction failed
@@ -63,6 +63,13 @@ public final class TransactionResponse implements WithGetReceipt, WithGetRecord
return receipt;
}
+ public TransactionReceipt forceGetReceipt(Client client) throws TimeoutException, PrecheckStatusException {
+ return new TransactionReceiptQuery()
+ .setTransactionId(transactionId)
+ .setNodeAccountIds(Collections.singletonList(nodeId))
+ .execute(client);
+ }
+
@Override
public CompletableFuture<TransactionReceipt> getReceiptAsync(Client client) {
return new TransactionReceiptQuery()
@@ -80,6 +87,14 @@ public final class TransactionResponse implements WithGetReceipt, WithGetRecord
.execute(client);
}
+ public TransactionRecord forceGetRecord(Client client) throws TimeoutException, PrecheckStatusException {
+
+ return new TransactionRecordQuery()
+ .setTransactionId(transactionId)
+ .setNodeAccountIds(Collections.singletonList(nodeId))
+ .execute(client);
+ }
+
@Override
public CompletableFuture<TransactionRecord> getRecordAsync(Client client) {
return getReceiptAsync(client).thenCompose((receipt) -> new TransactionRecordQuery()
