Don't include stub contracts in NPM packages #623
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.
If
hardhat deployis run withTEST_USE_STUBS_TBTCenvironment variable set totrue, the deployment will include deployment of stub contracts, which are needed for testing purposes (execution of unit tests). So far we've been runninghardhat deploy TEST_USE_STUBS_ECDSA=truetogether withUSE_EXTERNAL_DEPLOY=trueintbtc-v2in thedeploy:testscript. TheUSE_EXTERNAL_DEPLOYvariable specifies how the contracts of the dependencies should be deployed - whether to deploy them from scratch (true) or reuse the already deployed artifacts (false).We were using the
deploy:testscript intbtc-v2in two places - when runningcontracts-deployment-dry-runjob (test of deployment onhardhatlocal network) and innpm-compile-publish-contractsjob (publishing ofdevelopment-tagged NPM package). This second use can be problematic, as thedevelopment-tagged package is used to generate the client bindings when runningmake all, resulting in the presence of unneeded (and unwanted) functionalities. The first use is not causing such problems, but it should still be modified, as it's better to run the dry-run of deploy on the real contracts and not on the stubs.What we decided to do is to replace
with
and use the new
deploy:localscript in both jobs that previously useddeploy:test.This way we'll no longer include stub functionalities in NPM packages (and hence in the client bindings) and we'll execute dry-run of the unmodified contracts.
Refs:
threshold-network/keep-core#3531
threshold-network/keep-core#3569