Move ethers from dependencies to devDependencies #140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This project has dependencies to both
ethers
andviem
. We want to use onlyviem
here, like in other projects.Changes proposed in this pull request
The only change this pr contains right now is moving the
ethers
dependency fromdependencies
todevDependencies
, since it is only used to fetch the products, and in test files.This is not the proper fix though, removing the
ethers
import inbuild-products.js
(and later in the test files) was the original goal, but that did not seemed to work for some reason I could not figure out.Notes
I have tried to fetch the products with
viem
instead ofethers
, but I could not get any other output than an empty array. I would like to document here the things I tried for future reference.First I replaced the contract creation in the
buildProducts
function. I outcommented the current code:And replaced it with:
Then I tried to fetch the events in
fetchProductTypes
by trying out a few ways:I tried the
createContractEventFilter
function (docs). I tried playing with thefromBlock
/toBlock
params (took the values from the frontend) but that did not work. I also tried using thegetAbiItem
function instead of supplying the abi like this, also with no result.I tried the
getContractsEvents
function, with the same result as above:The
getEvents
function did also not give me any result:All this while the ethers code returns the correct events without issues