decode oracle query and response
Opened this issue · 6 comments
I am currently not sure if we provide the possibility to decode oracle query and response
example response on a local network:
{
"fee":1,
"id":"oq_236trganQBWAFHVMFXeCYs9UXepP4PDRFPDFpcfBgCkscxCWvP",
"oracle_id":"ok_HajZQyGa9xS8cnDir5fbUdqtiopKtfrsaAN6igm4WA2QscjLE",
"query":"ov_fWhvdyBpcyB0aGUgd2hlYXRoZXIgb3ZlciB0aGVyZT/9qmTc",
"response":"or_IXN1bm55ID0pxKdUsg==",
"response_ttl": {"type":"delta","value":100},
"sender_id":"ak_Gs2f7rXDWUPnqemp89oN1Tsi8eYGDkafAC1gbbB2xrdhmuZbs",
"sender_nonce":1,
"ttl":12108
}
@mitch-lbw do you remember where I faced that problem? it seems like we already decode this, see https://github.com/kryptokrauts/aepp-sdk-java/blob/3.x/src/main/java/com/kryptokrauts/aeternity/sdk/service/oracle/domain/OracleQueryResult.java#L42
ok, I remember now the showcase project for the maven-plugin. somehow the response isn't like expected.
the following check fails for some reason:
seems like we get different results when returning sunny =)
as response in delegated oracle responses within contracts vs. providing them directly
delegated response (using smart contract function to provide answer)
or_IXN1bm55ID0pxKdUsg==
direct response
or_c3VubnkgPSkesJvd
Opened an issue for that: aeternity/aeternity#3696
@mitch-lbw do you want to tackle this? :D
we might consider removing the automated decoding as this can be different based on the ABI of the oracle and instead provide a decode method that let's the user provide an ABI version for decoding
@mitch-lbw I am handing this over to you. I think this is one of the things with lowest priority for the moment. we could add this in a minor release after 3.0.0 has been released.