smartcontractkit / near-protocol-contracts

MIT License
26 stars 8 forks source link

Support querying all requests by calling one view function #11

Closed krebernisak closed 4 years ago

krebernisak commented 4 years ago

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 Chainlink 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.