Open bhupendra-chouhan opened 1 month ago
There's a few things I'd suggest here:
returnValue
. You should look for errors during simulation or at the diagnostic events within the resultMetaXdr
(these are within resultMetaXdr.v3().sorobanMeta()
).contractInt
function doesn't return anything in the success case, so it'll be undefined
regardless.scValToNative
to convert the return value to something readable instead of digging into the ._attributes
and whatnot.Thank you for your response and suggestions, @Shaptic .
Replying to each of the points you mentioned:
This is the newly deployed smart contract address: CBG7QFA5CWUIJ6QQQSCWS33UNV6TN3EVQHRZLR5VYJWT5X73J6Y46U7A.
You can see all the function calls and successful transactions that have occurred under this deployed smart contract address by visiting this page: https://stellar.expert/explorer/testnet/contract/CBG7QFA5CWUIJ6QQQSCWS33UNV6TN3EVQHRZLR5VYJWT5X73J6Y46U7A
contractInt
function doesn't return anything right now because I was first trying to print the return value in the browser console.scValToNative
from now onwards. I see, thanks for the clarifications.
The contractInt function doesn't return anything right now because I was first trying to print the return value in the browser console.
But the bug report is about you getting undefined
as a return value, and you would get that as the return value even if there was success! :laughing:
The reason why I said your transaction failed is because of the console output in your second screenshot (Sending transaction failed
). Based on the code, this occurs in your main block of submission code, but it's unclear why its occurring. Keep in mind that catch
statement will catch all sorts of other errors. I would recommend running the code without that try
/catch
block to see what the real error is.
For example, you use the Networks.TESTNET
variable in one place and the string "TESTNET"
in your invocation of userSignTransaction
which may be causing issues. But that's just an example. It could be anything in that block and you just call it "failed to send." Based on what you said, it seems like the transaction actually does successfully send, but you're triggering the catch
elsewhere which causes no return value.
I am applying to this issue via OnlyDust platform.
I'm a frontend and smart contract developer. I've contributed to Projects here on onlydust and with that experience, I would handle this task as expected. This would also be my first time contributing to this project.
To implement this,
I will create a Feedback and Storing it onchain by invoking the send_feedback() smartcontract function. I will ensure it displays the expeted output which is 4.
Fetch a feedback with feedback-id 4 by invoking the fetch_feedback() smartcontract function, and ensure it displays the expected Feedback Number 4.
ETA: 48hrs
I am applying to this issue via OnlyDust platform.
hello i am a frontend dev and blockchain developer please can i work on this issue :) and would love to be a contributor
please kindly assign me and i'll get straight to work
To demonstrate the issue, I built a small full-stack dApp called "Anonymous Feedback dApp" using ReactJS, TailwindCSS, Stellar-SDK, Soroban-SDK, and Freighter Wallet.
GitHub : https://github.com/bhupendra-chouhan/Anonymous-Feedback-Soroban
Please refer to the project's README file for a detailed explanation of the issue, along with the installation/setup guide and steps to reproduce it (screenshots included).
Issue: In the code below, there is a function named
contractInt()
, which is used to invoke contract functions. While it successfully stores data on-chain when invoking a setter function, the problem occurs when I try to retrieve a return value using thereturnValue()
method from a getter function. Instead of the expected output, I receive 'undefined'.Screenshots of Issue (You can reproduce the issue by following the screenshots):
Creating a Feedback and Storing it onchain by invoking the
send_feedback()
smartcontract function:Result:
4
Undefined
Fetching a feedback with feedback-id
4
by invoking thefetch_feedback()
smartcontract function:Result:
Feedback Number 4
Undefined