near / devx

This is the home of NEAR collective developer experience plans and roadmap.
11 stars 0 forks source link

[Mr. Pink] Immediate need to add method to contract #232

Closed mikedotexe closed 4 years ago

mikedotexe commented 4 years ago

Context here: Screenshot 2020-07-13 13.23.48.png

mikedotexe commented 4 years ago

More details: Currently, the contract supports quering request data using these two functions:

To query all requests, we need to combine these two functions and execute N+1 RPC calls where N is the number of accounts using the oracle service. This complicates integration with us and other services, so ideally, we would like to support a function like get_all_requests that would return all requests in one function call.

On Ethereum we use events and we can query all events for a contract. As such we are able to query all requests in one RPC call.

As one of the design goals is to be as close as possible to the EVM oracle implementation, and NEAR currently does not support contract events, we should support a query like this.

mikedotexe commented 4 years ago

Ended up putting this work into the same PR and branch here: https://github.com/nearprotocol/near-protocol-contracts/tree/hotfix/12-improve-json-for-reqs