Skip to content

Commit fcd0735

Browse files
committed
Tidying client code
1 parent a4f264d commit fcd0735

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

convex-peer/src/main/java/convex/api/Convex.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ public SignedData<ATransaction> prepareTransaction(ATransaction transaction) thr
527527
* @return A Future for the result of the transaction
528528
*/
529529
public CompletableFuture<Result> transact(String code) {
530-
return transact((ACell)Reader.read(code));
530+
ACell cmd=buildCodeForm(code);
531+
return transact(cmd);
531532
}
532533

533534
/**
@@ -542,7 +543,8 @@ public synchronized CompletableFuture<Result> transact(ACell code) {
542543
if (isPreCompile()) {
543544
return preCompile(code).thenCompose(r->{
544545
if (r.isError()) return CompletableFuture.completedFuture(r);
545-
ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, r.getValue());
546+
ACell compiledCode=r.getValue();
547+
ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, compiledCode);
546548
return transact(trans);
547549
});
548550
} else {
@@ -570,7 +572,8 @@ private ACell buildCodeForm(String code) {
570572
* @throws InterruptedException in case of interrupt while waiting
571573
*/
572574
public synchronized Result transactSync(String code) throws InterruptedException {
573-
ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, code);
575+
ACell form=buildCodeForm(code);
576+
ATransaction trans = Invoke.create(getAddress(), ATransaction.UNKNOWN_SEQUENCE, form);
574577
return transactSync(trans);
575578
}
576579

0 commit comments

Comments
 (0)