-
Notifications
You must be signed in to change notification settings - Fork 27
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: guide user to call a parachain #316
Conversation
Preliminary UX Feedback:
How does the user know what Pop CLI supports for chain calls? e.g. minting NFTs, minting assets? etc.
For example:
|
I don't personally like to have a list of chains. The users of this feature are devs, so in my opinion, the For example, if I’m deploying a smart contract on the Pop Network that interacts with an NFT, I would want to run For these two scenarios, I believe the current flow works best: first selecting the chain you are working on, and then focusing on the specific use cases available through |
If the audience are devs, it makes sense what you are saying:
I would still have Pop Network as a default, pre-defined chain. So the flow would be like this:
The following will be shown if the user selects "Pop Network":
The following will be shown if the user selects "Custom RPC":
|
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.
A few last nitpicks but the PR is looking fantastic, well done!
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.
Thanks for addressing my last comments. This is great!
* feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data
* feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros
…es (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor
* feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting
* refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant
* refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor
* fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings
[sc-1841] |
…in parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call
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.
All proposed fixes from review have been merged so happy to approve now. Thanks for you patience in addressing everything, glad to see this complete.
Thanks for all your hard work on this Alex!
* feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
* feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
* feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
* feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
* feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
* feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * fix: build spec experience (#331) * fix: add chain to specify the chain specification * fix: default_bootnode by default to true * chore: fmt * chore: deprecate flag --release in build specs * fix: clean output (#334) * fix: undo deprecation of --release flag * refactor: small fix * style: remove extra space * fix(spec): better handling of spinner * style: use spinner instead of multispinner * docs: help message to include build * feat: reuse existing chain spec * refactor: remove clone * refactor: opt in to edit provided chain spec * docs: improve * refactor: flow flag input * fix: prepare_output_path * refactor: resolve small improvements * fix: protocol id prompt * fix: spinner * fix: docs * test: test cli * chore: refactor * chore: amend test * feat: production profile * refactor: improve profile experience * chore: feedback and rebase * chore: add profile tests * fix(test): parachain_lifecycle * style: fmt * fix: clippy * fix: cli required changes introduced by PR * fix: test * fix: clippy * docs: deprecation message --------- Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * chore: deny.toml license * feat: secure signing logic for pop call contract * feat: integrate secure signing with pop call contract * test: adapt pop-cli ui tests * refactor: clean code * docs: improve docs functions * test: ignore failing test (fixed in another PR), and remove println * fix: import removed by mistake * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * feat: secure signing logic for pop call chain * test: unit tests in pop-cli * feat: secure signing for call from call_data * refactor: docs and remove unneded functions * refactor: replace hex library * fix: rebase issues * fix: merge issues * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refacto…
* feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * fix: minor fixes after rebase * fix(up-contract): test compilation after rebase * feat(up-contract): suri and use-wallet can't be used together * refactor: wait for finalization * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements (#380) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * feat: secure signing logic for pop call chain * test: unit tests in pop-cli * feat: secure signing for call from call_data * refactor: docs and remove unneded functions * refactor: replace hex library * fix: rebase issues * fix: rebase * refactor: small changes * refactor: renaming * feat: wallet integration call contract (#378) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * fix: build spec experience (#331) * fix: add chain to specify the chain specification * fix: default_bootnode by default to true * chore: fmt * chore: deprecate flag --release in build specs * fix: clean output (#334) * fix: undo deprecation of --release flag * refactor: small fix * style: remove extra space * fix(spec): better handling of spinner * style: use spinner instead of multispinner * docs: help message to include build * feat: reuse existing chain spec * refactor: remove clone * refactor: opt in to edit provided chain spec * docs: improve * refactor: flow flag input * fix: prepare_output_path * refactor: resolve small improvements * fix: protocol id prompt * fix: spinner * fix: docs * test: test cli * chore: refactor * chore: amend test * feat: production profile * refactor: improve profile experience * chore: feedback and rebase * chore: add profile tests * fix(test): parachain_lifecycle * style: fmt * fix: clippy * fix: cli required changes introduced by PR * fix: test * fix: clippy * docs: deprecation message --------- Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * chore: deny.toml license * feat: secure signing logic for pop call contract * feat: integrate secure signing with pop call contract * test: adapt pop-cli ui tests * refactor: clean code * docs: improve docs functions * test: ignore failing test (fixed in another PR), and remove println * fix: import removed by mistake * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: rena…
* feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(wallet integration): pop up contract (#365) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * fix: minor fixes after rebase * fix(up-contract): test compilation after rebase * feat(up-contract): suri and use-wallet can't be used together * refactor: wait for finalization * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements (#380) * docs: add function comments * feat: wallet integration pop call chain (#379) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * fix: minor fixes after rebase * fix(up-contract): test compilation after rebase * feat(up-contract): suri and use-wallet can't be used together * refactor: wait for finalization * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements (#380) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * feat: secure signing logic for pop call chain * test: unit tests in pop-cli * feat: secure signing for call from call_data * refactor: docs and remove unneded functions * refactor: replace hex library * fix: rebase issues * fix: rebase * refactor: small changes * refactor: renaming * feat: wallet integration call contract (#378) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * fix: build spec experience (#331) * fix: add chain to specify the chain specification * fix: default_bootnode by default to true * chore: fmt * chore: deprecate flag --release in build specs * fix: clean output (#334) * fix: undo deprecation of --release flag * refactor: small fix * style: remove extra space * fix(spec): better handling of spinner * style: use spinner instead of multispinner * docs: help message to include build * feat: reuse existing chain spec * refactor: remove clone * refactor: opt in to edit provided chain spec * docs: improve * refactor: flow flag input * fix: prepare_output_path * refactor: resolve small improvements * fix: protocol id prompt * fix: spinner * fix: docs * test: test cli * chore: refactor * chore: amend test * feat: production profile * refactor: improve profile experience * chore: feedback and rebase * chore: add profile tests * fix(test): parachain_lifecycle * style: fmt * fix: clippy * fix: cli required changes introduced by PR * fix: test * fix: clippy * docs: deprecation message --------- Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]> * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * chore: deny.toml license * feat: secure signing logic for pop call contract * feat: integrate secure signing with pop call contract * test: adapt pop-cli ui tests * refactor: clean code * docs: improve docs functions * test: ignore failing test (fixed in another PR), and remove println * fix: import removed by mistake * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <[email protected]> Co-authored-by: Alejandro Martinez Andres <[email protected]> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse a…
This PR introduces the
pop call parachain
command, providing guidance for users to interact with a chain. The approach to achieving a great DevEx is to start with a list of specific use cases that we believe will be most useful for developers, such as creating an asset, nfts, and other interesting developer focused actions, while also allowing them to access a broader range of extrinsics.pop-cli
also offer a the command-line interface for direct execution. For example to mint an NFT directly:pop call parachain --pallet Nfts --extrinsic mint --args "1" "1" "Id(5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty)" "None()" --url ws://localhost:9944/ --suri //Alice
Additional PRs:
To simplify the review process, some functionality has been split out from this main PR:
call_data
: feat: submit extrinsic from call_data #348sudo
call: feat: flag sudo to wrap extrinsic #349There is a limitation on the input size in the CLI, which may cause the process to fail if the input string is too large. For instance, this issue can occur when using the
register
extrinsic:Review Considerations
sudo
call where another call has to be inputted by a command line:For a better DevEx this will functionality will be supported using a flag to indicate it (#349).
Some file changes occurred because this feature required files originally in the
pop_contracts
crate. Functions likecreate_signer
,format_type
andfind_free_port
were moved to thepop_common
crate to make them accessible in thepop_parachain
crate.The way the extrinsic arguments are prompted here is an improvement over the
pop call contract
functionality. In this implementation, we present Variants (Enums) as a selectable list with different options and individually prompt for all the fields of a Composite (Struct) type, constructing it for the user. If approved, this approach can be reused later to improve the experience inpop call contract
as well.[sc-1314] [sc-1515]