From fcd07358d98e5e69dd5718ad195cfaa21262c996 Mon Sep 17 00:00:00 2001 From: mikera Date: Sat, 30 Nov 2024 19:11:09 +0000 Subject: [PATCH] Tidying client code --- convex-peer/src/main/java/convex/api/Convex.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/convex-peer/src/main/java/convex/api/Convex.java b/convex-peer/src/main/java/convex/api/Convex.java index 05a1fde08..7d6d83858 100644 --- a/convex-peer/src/main/java/convex/api/Convex.java +++ b/convex-peer/src/main/java/convex/api/Convex.java @@ -527,7 +527,8 @@ public SignedData prepareTransaction(ATransaction transaction) thr * @return A Future for the result of the transaction */ public CompletableFuture transact(String code) { - return transact((ACell)Reader.read(code)); + ACell cmd=buildCodeForm(code); + return transact(cmd); } /** @@ -542,7 +543,8 @@ public synchronized CompletableFuture transact(ACell code) { if (isPreCompile()) { return preCompile(code).thenCompose(r->{ if (r.isError()) return CompletableFuture.completedFuture(r); - ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, r.getValue()); + ACell compiledCode=r.getValue(); + ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, compiledCode); return transact(trans); }); } else { @@ -570,7 +572,8 @@ private ACell buildCodeForm(String code) { * @throws InterruptedException in case of interrupt while waiting */ public synchronized Result transactSync(String code) throws InterruptedException { - ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, code); + ACell form=buildCodeForm(code); + ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, form); return transactSync(trans); }