I first sure was having doubt with decoding because it return different values (Even for you as you now have tried yourself with
^UHello Which was not my request because of the contract code condition (referred above))
So I kept it open with giving information to focus on two problems(While posting, I noticed it could be more leaned towards the response I get not the decoding). But decoding can only be confirmed once I start getting right response (encoded) on editor.
Could that be a problem with my Ascii codes are different for passing query string and it is getting wrong encoded value at first place?
nice @hanssv.chain, thanks for that info (after your 19th post about TTL)
I am out of replies today. It says i can’t reply for next 20 hours due to being new.
So editing this…
respond_to_greets just run with a recently added state.
let query : oracle_query(string, string) =
Oracle.query(state.greeter_oracle, message, 0, RelativeTTL(50), RelativeTTL(50))
respond_to_greets just read it. One thing I am confused about is how it can able to access variables that are defined in a function scope. In this case how
respond_to_greets Know the
caller_addr when it is declared (initialized) inside
greet_oracle. That’s related to common programming rules called scopes. But that’s a different question (Which if you like can answer). Currently. I have tried with one time only theory but it’s not how code says and it did not works.
Oh ok i saw this. nvm with that quesiton
(caller_addr, query) <- state.greets
One thing I would like to add is whenever I call
respond_to_greets for the first-ever time after running the greet oracle function. I get
false instead of an error value. No Idea why.
That’s the solution. I noticed now that Oracles responds (With custom TTL) to the required request to set the response in the right manner.
false I get is based on nothing and calling again that response triggers that error.
Sorry, I thought
Oracle.respond only reads the data.