-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor: run substrate-contracts-node in pop up contract
if it does not exist
#206
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #206 +/- ##
==========================================
+ Coverage 56.58% 57.31% +0.72%
==========================================
Files 33 34 +1
Lines 3513 3697 +184
Branches 3513 3697 +184
==========================================
+ Hits 1988 2119 +131
- Misses 1232 1239 +7
- Partials 293 339 +46
|
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.
Nice!
Overall I think this flow is nicer.
Regarding that git duplicated code I agree we should move in the way of having a common crate, or maybe it makes sense importing it from the existing one just to be able to move ahead and then we address the common crate later on.
Given that we are launching a para for the user if no arguments are given, we could also use //Alice
by default if no other suri is given.
When dry-running the changes I got:
◆ Local node started successfully in the background.
│
▲ NOTE: The contracts node is running in the background with process ID 188188. Please close it manually when done testing.
│
┌ Pop CLI : Deploy a smart contract
│
Error: Invalid number of input arguments: expected 1, 0 provided
I just built a contract and run pop up contract --suri //Alice
. @AlexD10S did you see this ?
@al3mart just some heads up: when using You can check whether the blockchain uses |
The error thrown is correct. To initialize the contract, you must call the constructor method. If not specified, pop-cli uses 'new' by default. For the smart contract you are trying to deploy, this constructor expects one argument:
The argument has to be specified with the Also, I pushed a new commit implementing your suggestion to use the dev account by default (//Alice) if the account for deploying the contract is not specified (--suri). |
So right! That was a bad review from my side. For whatever reason I started passing no arguments on my testing. 🙏 |
You made a good point; the error message is not very clear. However, I'm unsure how we can improve it because the error is thrown by the contract_extrinsics. We could add a check in pop-cli to retrieve the constructor and compare the expected arguments. |
In my opinion, this is out of scope for this PR. We are safe using |
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
pop up contract
, check if the specified chain is live. If not, prompt the user to run the Substrate contracts node in the background for testing using pop-cli.pop up contracts-node
command and reusing the logic to run thecontracts-node
exclusively for testing purposes. This improves thepop up contract
user experience and will be reused for automatic execution in e2e functionality (AddCONTRACTS_NODE_PATH
to Pop when running e2e tests for contracts #31).pop up parachain
in this PR feat(up parachain): faster binary sourcing #199Closes #35
Reviewer Considerations
pop_parachains
crate. I copied the necessary logic into thepop_contracts
crate, but does it make more sense to just import thepop_parachains
crate instead?Ideally, we should have a common crate as suggested here: Organization:
crates/common
#124, but that seems out of scope for this PR.