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

Contract templates and contract new from template using sc-meta #342

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Sep 29, 2023

From now on, mxpy will use sc-meta for displaying the available contract templates and for creating a new contract using the available templates.

This PR contains a few breaking changes:

For the mxpy contract new command:

  • the name argument is no longer a positional argument, should be used as a keyword argument: --name
  • the --directory argument is no longer existent, --path should be used instead
  • a new argument has been introduced, --tag. It is used to specify the framework version on which the contract should be created

For the mxpy templates command:

  • the --tag argument has been added. It is used to specify the sc-meta framework version referred to

@popenta popenta self-assigned this Sep 29, 2023
@popenta popenta marked this pull request as draft September 29, 2023 14:10
Base automatically changed from globally-install-rust to feat/next October 2, 2023 08:44
@popenta popenta marked this pull request as ready for review October 2, 2023 08:46
multiversx_sdk_cli/tests/test_cli_contracts.sh Outdated Show resolved Hide resolved
multiversx_sdk_cli/tests/test_cli_contracts.sh Outdated Show resolved Hide resolved
multiversx_sdk_cli/projects/templates.py Outdated Show resolved Hide resolved
multiversx_sdk_cli/cli_contracts.py Outdated Show resolved Hide resolved
sub.add_argument("--template", required=True, help="the template to use")
sub.add_argument("--directory", type=str, default=os.getcwd(),
help="🗀 the parent directory of the project (default: current directory)")
sub.add_argument("--tag", help="the framework version on which the contract should be created")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe specify the version that will be used in case that the flag is not set

Copy link
Contributor

Choose a reason for hiding this comment

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

That version is somehow out of mxpy's control.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. I was trying to figure out if there is a simple way to do that, but I think it's to much work for what it adds.

sub.set_defaults(func=create)

sub = cli_shared.add_command_subparser(subparsers, "contract", "templates",
"List the available Smart Contract templates.")
sub.add_argument("--tag", help="the sc-meta framework version referred to")
Copy link
Contributor

Choose a reason for hiding this comment

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

specify the default value

@popenta popenta merged commit c3caf06 into feat/next Oct 3, 2023
9 checks passed
@popenta popenta deleted the contract-template branch October 3, 2023 10:37
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.

3 participants