Skip to content

Conversation

@Daanvdplas
Copy link
Collaborator

@Daanvdplas Daanvdplas commented Oct 29, 2025

Closes #553

Also:

  • interactive mode reacts to the input provided.
  • Removes psp standards

@Daanvdplas Daanvdplas requested a review from Copilot October 29, 2025 20:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes PSP (Polkadot Standards Proposals) contract templates from the codebase and simplifies the contract generation workflow by eliminating the contract type selection step. Users now directly select from available contract templates.

Key changes:

  • Removed PSP22 and PSP34 contract variants from the Contract enum
  • Removed the Psp variant from the ContractType enum
  • Simplified the NewContractCommand by removing the contract_type field
  • Refactored the interactive prompting logic to be inline within the execute() method
  • Updated test generation to work without contract type specification

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/pop-contracts/src/templates.rs Removed PSP contract type and PSP22/PSP34 template variants, updated tests
crates/pop-contracts/src/new.rs Removed special handling for PSP template extraction logic
crates/pop-cli/src/commands/new/contract.rs Removed contract_type field, refactored prompting to be inline, simplified contract generation
crates/pop-cli/src/commands/new/mod.rs Updated Command::Contract instantiation to remove contract_type field
crates/pop-cli/tests/contract.rs Simplified test to generate templates without contract type specification

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 77.27273% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.92%. Comparing base (6df01a9) to head (452a301).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/commands/new/contract.rs 78.37% 3 Missing and 5 partials ⚠️
crates/pop-cli/src/commands/new/mod.rs 0.00% 1 Missing ⚠️
crates/pop-contracts/src/new.rs 83.33% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
- Coverage   76.99%   76.92%   -0.07%     
==========================================
  Files         111      111              
  Lines       25357    25244     -113     
  Branches    25357    25244     -113     
==========================================
- Hits        19524    19420     -104     
+ Misses       3765     3764       -1     
+ Partials     2068     2060       -8     
Files with missing lines Coverage Δ
crates/pop-contracts/src/templates.rs 100.00% <ø> (ø)
crates/pop-cli/src/commands/new/mod.rs 82.53% <0.00%> (+4.92%) ⬆️
crates/pop-contracts/src/new.rs 84.93% <83.33%> (+0.41%) ⬆️
crates/pop-cli/src/commands/new/contract.rs 77.90% <78.37%> (-2.36%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@moliholy moliholy left a comment

Choose a reason for hiding this comment

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

LGTM!

@Daanvdplas Daanvdplas force-pushed the daan/refactor-remove_psp_examples branch 2 times, most recently from 1ec4ef6 to 19155f7 Compare October 31, 2025 17:09
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.

Nice!
I was initially hesitant about removing the types, but after some testing I like it, it’s definitely cleaner this way.

Regarding the PSP templates, we usually deprecate the template first and remove them in the next release (e.g #628).
However, after checking the metrics, it seems the PSP templates haven’t been used for quite a while, so it’s cleaner to remove them all at once.

Edit
I see the test test_contract_in_workspace_with_simple_name is failing after change the way to prompt.
To fix just add here https://github.com/r0gue-io/pop-cli/blob/main/crates/pop-cli/src/commands/new/contract.rs#L351 the standard template to avoid prompting the user:

let cli = Cli::parse_from([
			"pop", "new", "contract", "flipper", "--template", "standard"
		]);

@AlexD10S AlexD10S self-requested a review November 1, 2025 16:29
@Daanvdplas
Copy link
Collaborator Author

The removal was based off feedback from users at the PBA. The removal of psp standards was simple, no one indeed uses them and they are not needed anymore with Eth compatibillity.

@Daanvdplas
Copy link
Collaborator Author

@AlexD10S curious why that failing test doesn't show up in the CI except in the coverage job, that should not be the case right?

@AlexD10S
Copy link
Collaborator

AlexD10S commented Nov 1, 2025

@AlexD10S curious why that failing test doesn't show up in the CI except in the coverage job, that should not be the case right?

Yes. We cleaned up the CI pipeline. Coverage already runs the unit tests, so we removed the separate unit test job we had before. Tests now run only once in the coverage job.

@Daanvdplas
Copy link
Collaborator Author

@AlexD10S curious why that failing test doesn't show up in the CI except in the coverage job, that should not be the case right?

Yes. We cleaned up the CI pipeline. Coverage already runs the unit tests, so we removed the separate unit test job we had before. Tests now run only once in the coverage job.

Hmm oke, I didn't find the CI output that clear wasn't able to find error wihthout using copilot. Will look if I can improve it.

@Daanvdplas Daanvdplas force-pushed the daan/refactor-remove_psp_examples branch from 19155f7 to 452a301 Compare November 1, 2025 17:48
@Daanvdplas Daanvdplas merged commit 80a4c31 into main Nov 1, 2025
19 checks passed
@Daanvdplas Daanvdplas deleted the daan/refactor-remove_psp_examples branch November 1, 2025 18:38
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.

Show templates available

4 participants