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 deploy
is run withTEST_USE_STUBS_TBTC
environment 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=true
together withUSE_EXTERNAL_DEPLOY=true
intbtc-v2
in thedeploy:test
script. TheUSE_EXTERNAL_DEPLOY
variable 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:test
script intbtc-v2
in two places - when runningcontracts-deployment-dry-run
job (test of deployment onhardhat
local network) and innpm-compile-publish-contracts
job (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:local
script 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:
keep-network/keep-core#3531
keep-network/keep-core#3569