-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/functions integration #11
Feature/functions integration #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider whether we should add npm-link
https://docs.npmjs.com/cli/v8/commands/npm-link
so that we can use the PR version of the code in a sample project to test ?
In order to test that PR without publishing package to NPM you can:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - note some comments/feedback.
@@ -0,0 +1,100 @@ | |||
import { BigNumberish } from "ethers"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it (i think!). There are two types of simulations in functions-toolkit:
- the local simulation which is purely a deno-runtime execution of the functions javascript (https://github.com/smartcontractkit/functions-toolkit?tab=readme-ov-file#local-functions-simulator)
- a testnet simulation which runs on the back of ganache, and is similar in concept to running a hardhat node, except it is with ganache and some contracts are deployed onto the testnet automatically. (https://github.com/smartcontractkit/functions-toolkit?tab=readme-ov-file#local-functions-testnet)
(1) is pure JS and no smart contracts are involved so there is no need for a provider.
(2) uses ganache and does care about the functions consumer in the sense that the consumer can be deployed to that simulated testnet.
You may have already fully grasped this but in case you didnt, please consider whether this impacts your assessment.
Hi @zeuslawyer, Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments to resolve please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
NPM package "@chainlink/functions-toolkit" integrated to the Hardhat-Chainlink plugin.
Its methods were wrapped and are available both as Hardhat tasks and as methods in HRE.
Thus, most of the work related to interaction with Chainlink Function and DONs, manipulating secrets, gists is delegated to the "@chainlink/functions-toolkit".
Ability to run Functions simulations was wrapped as well and is available in the Hardhat-Chainlink plugin.