I am trying to interact with a method in my smart contract. The method is a simple method where you send a string value to a global variable. I end up using a SendAsync which appears to initially work, but the data isn't being sent.

The code I am trying to get working is as follows:

CompletableFuture<TransactionReceipt> receipt = contract.sendData("FUN").sendAsync();
            receipt.thenAccept(transactionReceipt -> System.out.println("transaction: " + transactionReceipt)).exceptionally(transactionReceipt  -> {
                return null;

It appears the smart contract code is incorrect and is not sending the data.

It keeps telling me that the transaction is not completable.

Is there a way to allow this code to execute and actually send the word "Fun" to my smart contract in this case?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.