-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
length and offset is 0 ? #471
Comments
The flip function has no return values, so the length will be zero. It might make sense for the flip function to return the current state. Does that explain what is happening? |
I know flip has no return values.already ı tried for UnhandledPromiseRejectionWarning: Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. I tried at new contract , simple name get- set functions . same error. |
Would you mind sharing your code so I can reproduce this issue? I don't know how this can happen without seeing your code. Thanks |
yes sure.
|
Would you mind sharing the client-side code too? Thanks |
I already using solang library. if ı using this style (2 function together. ) ı can see account data.
but if I use only
length and offset are zero. |
I think I can reproduce an issue. Let me get back to you.. |
Ok. I am waiting. |
Would you mind testing this again with the latest solang? Also note that I have turned your example into a test case. |
did you test it? length and offset are 0 after the |
Yes, the tes runs and the tests get run by github actions at every pull request as well. Note that Would you mind sharing your entire test case so I can reproduce the problem? |
hmm , understood. now running . I misunderstood some things. another question. :
is public data. Do I have to use the |
A |
I know but |
Yes, you're absolutely right. So this should be done via an RPC call, which does not charge any gas at all. However, since this function writes to account data, it cannot be an RPC call. The way to fix this is to provide an alternate way of returning data in Solana. This is why solana-labs/solana#19318 exists. Hopefully this will be approved soon and then it can be implemented. |
Hopefully. Actually what I'm looking for is something like this:
When I try with this method, I can read data from a normal solana program. I don't know if I can read from Solang this way. I tried, it didn't work. |
For the first string, you need to read the Ideally we need a node library that can do this. There is a plan for a npm package here solana-labs/solana-solidity.js#1, I will add an entry for reading the storage. |
I'm looking forward. |
That solana-solidity.js project has just received funding from Solana (25k USD). Hopefully it will move quickly. |
@oznfc @oksanassss anything else I can help with or can I close this issue? |
I'm using flipper examle for solana. if ı call
flip
andget
function together my codes is working. but ı tried different way.first step ı call only
Flip
function.second step ı call only
get
function . When ı called only get fuction after the first step my ofset and length is "0" .I have to use the
flip
andget
functions together. Why ?The text was updated successfully, but these errors were encountered: