hardhat-starter-kit icon indicating copy to clipboard operation
hardhat-starter-kit copied to clipboard

Add examples for Any API Large and Multi-word responses

Open mhpaler opened this issue 3 years ago • 5 comments

In addition to the standard GET request for Chainlink Connect to any API, Chainlink also supports multi-variable and large (bytes or string > 32bytes) responses.

On first glance it appears that executing these examples in hardhat-starter-kit will require a adjustment to, or the addition of a second MockOracle.

mhpaler avatar Feb 04 '22 18:02 mhpaler

Excellent idea, @mpaler. Thanks for raising this issue!

andrejrakic avatar Feb 04 '22 18:02 andrejrakic

Taking a crack at it now...

Appears to be an issue over in core Chainlink too? not finding any test examples over there (yet) that we can pull from...

There is this https://github.com/smartcontractkit/chainlink/issues/5639 which seems related as i believe we'll need to create an Operator mock, vs. the current Oracle mock.

mhpaler avatar Feb 04 '22 19:02 mhpaler

Will this work ?

Action Steps

  • Add fulfillOracleRequest2 method (supports multi-word and large responses) in existing MockOracle.sol
  • Create Multi-word API Consumer Contract
  • Create Tests for Multi-word API Consumer Contract

kevin3010 avatar Aug 23 '22 05:08 kevin3010

Hey @kevin3010, that sounds like a great plan. If you are going to open a PR, feel free to use examples from the official documentation as inspiration. Looking forward to it!

andrejrakic avatar Aug 25 '22 23:08 andrejrakic

ok I'll work on this issue.

kevin3010 avatar Aug 27 '22 06:08 kevin3010