Skip to content
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

feat: check if build exists before deploying contract with pop up #177

Merged
merged 5 commits into from
May 22, 2024

Conversation

bolajahmad
Copy link
Contributor

Closes #34

pop up contract tries to deploy contract even if there is not build found and will eventually throw error because of that. It is necessary to add a check for existing build (and generate one), before continuing with the deployment.

@AlexD10S AlexD10S requested review from AlexD10S and brunopgalvao and removed request for brunopgalvao and AlexD10S May 16, 2024 11:33
@AlexD10S
Copy link
Collaborator

If I don't have the contract build and run bpop up contract works perfectly.
However if I manually build the contract and then run pop up contract is still building it, for some reason it doesn't find the repo !build_path.exists().

@AlexD10S
Copy link
Collaborator

If I don't have the contract build and run bpop up contract works perfectly. However if I manually build the contract and then run pop up contract is still building it, for some reason it doesn't find the repo !build_path.exists().

The issue here is with this line:

let build_path = PathBuf::from(
			self.path.clone().unwrap_or("/.".into()).to_string_lossy().to_string()
				+ "/target/release/ink",
		);

release is not needed, check only for target/ink.
Also once this PR is implemented: #102 and the user can specify if build in release mode or debug mode we will have to change it too.

@bolajahmad
Copy link
Contributor Author

If I don't have the contract build and run bpop up contract works perfectly. However if I manually build the contract and then run pop up contract is still building it, for some reason it doesn't find the repo !build_path.exists().

The issue here is with this line:

let build_path = PathBuf::from(
			self.path.clone().unwrap_or("/.".into()).to_string_lossy().to_string()
				+ "/target/release/ink",
		);

release is not needed, check only for target/ink. Also once this PR is implemented: #102 and the user can specify if build in release mode or debug mode we will have to change it too.

Alright, I'll try to remove the target/ink and see if that helps.

@AlexD10S AlexD10S changed the title feature: check if build exists before deploying contract with pop up feat: check if build exists before deploying contract with pop up May 21, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 50.10%. Comparing base (047bee3) to head (5ddd037).

@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
- Coverage   50.28%   50.10%   -0.18%     
==========================================
  Files          32       32              
  Lines        2828     2838      +10     
  Branches     2828     2838      +10     
==========================================
  Hits         1422     1422              
- Misses       1183     1193      +10     
  Partials      223      223              
Files Coverage Δ
crates/pop-cli/src/commands/up/contract.rs 0.00% <0.00%> (ø)

Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks again for contributing to pop-cli .

@AlexD10S AlexD10S merged commit 028150b into r0gue-io:main May 22, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pop up contract: build contract if it has not been built
3 participants