Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: guide user to call a parachain #316

Merged
merged 200 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 197 commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
3c9b261
feat: guide user for calling a contract
AlexD10S Sep 5, 2024
f9e305a
feat: get metadata contract from the contract path
AlexD10S Sep 5, 2024
5327bf9
refactor: refactor test and validate address input
AlexD10S Sep 5, 2024
83e236c
fix: apply feedback
AlexD10S Sep 6, 2024
7cef633
feat: prompt to have another call and skip questions for queries
AlexD10S Sep 6, 2024
62eefcf
refactor: use Cli module instead of cliclack
AlexD10S Sep 8, 2024
fee1e26
test: unit test pop-cli crate
AlexD10S Sep 9, 2024
6c9aa77
test: unit contracts crate
AlexD10S Sep 9, 2024
20360e8
chore: merge main
AlexD10S Sep 9, 2024
cd4c20f
chore: format
AlexD10S Sep 9, 2024
d59259c
test: refactor and improve test cases
AlexD10S Sep 10, 2024
c422192
fix: fix todos and refactor
AlexD10S Sep 10, 2024
22dd4f6
test: fix unit test
AlexD10S Sep 10, 2024
c8fedef
feat: parse types of parameters and display it to the user in the pla…
AlexD10S Sep 11, 2024
b0b3573
refactor: error handling for pop call
AlexD10S Sep 12, 2024
8e60da8
refactor: display call to be executed after guide and reorder
AlexD10S Sep 12, 2024
08f2454
refactor: when repeat call use same contract values and dont clean sc…
AlexD10S Sep 12, 2024
68848be
test: add dry-run test
AlexD10S Sep 13, 2024
1aaea92
test: refactor and add more test coverage
AlexD10S Sep 19, 2024
c3e0cc0
chore: merge main
AlexD10S Sep 19, 2024
05db96f
test: more coverage
AlexD10S Sep 20, 2024
8df2058
fix: unit test
AlexD10S Sep 20, 2024
96ed5f1
feat: dev mode to skip certain user prompts
AlexD10S Nov 5, 2024
0e5bf32
refactor: test functions, renaming and fix clippy
AlexD10S Nov 5, 2024
29848b4
refactor: improve devex of pop call contract
AlexD10S Nov 5, 2024
5f479fa
test: adjust tests to refactor
AlexD10S Nov 5, 2024
5be201b
chore: reset_for_new_call fields
AlexD10S Nov 6, 2024
e55d1a6
fix: build contract if has not been built
AlexD10S Nov 6, 2024
eaad4be
refactor: use command state (#338)
evilrobot-01 Nov 6, 2024
4d54652
fix: automatically add some or none to Option argument
AlexD10S Nov 4, 2024
781ebc7
test: refactor and tests
AlexD10S Nov 4, 2024
d361160
refactor: improve code and comments
AlexD10S Nov 5, 2024
9b5b6d8
fix: renaming and clean code
AlexD10S Nov 5, 2024
5b27b37
chore: option params not mandatory
AlexD10S Nov 6, 2024
b0c9478
fix: parse user inputs for Option arguments in constructor (#335)
AlexD10S Nov 6, 2024
cf09406
refactor: process_function_args
AlexD10S Nov 6, 2024
ea538bf
test: update tests accordingly last changes
AlexD10S Nov 6, 2024
314fa45
fix: issue with delimiter
AlexD10S Nov 6, 2024
069fc37
test: fix unit test
AlexD10S Nov 6, 2024
2defc64
refactor: renaming and fix comments
AlexD10S Nov 7, 2024
c69ca16
refactor: format types (#339)
evilrobot-01 Nov 8, 2024
5d76f1a
fix: logo doesn't show in README
al3mart Nov 8, 2024
d1b5b9f
feat: pop call parachain prototype
AlexD10S Sep 11, 2024
3162557
feat: dispaly arguments of extrinsic
AlexD10S Sep 11, 2024
7d7b344
refactor: structure similar to pop call contract
AlexD10S Sep 13, 2024
eb30ae2
feat: parse all values for extrinsic/storage
AlexD10S Sep 19, 2024
9527a39
refactor: signer in common
AlexD10S Sep 21, 2024
9acf4bb
refactor: improve messages
AlexD10S Sep 22, 2024
8c836bd
feat: call parachain ui
AlexD10S Sep 23, 2024
1fb9ccc
fix: calls working
AlexD10S Sep 24, 2024
ee819b0
refactor: remove unused code
AlexD10S Sep 24, 2024
aec3b29
refactor: remove unused code
AlexD10S Sep 24, 2024
8e50d0b
refactor: various fixes
AlexD10S Sep 24, 2024
5996ba2
refactor: various fixes
AlexD10S Sep 24, 2024
aef62b8
feat: add option to include params from command line
AlexD10S Sep 27, 2024
24a53f1
refactor: clean docs and refactor code
AlexD10S Sep 27, 2024
ca2778a
fix: tests
AlexD10S Nov 11, 2024
2c54c2b
refactor: parse all the metadata again
AlexD10S Nov 17, 2024
cd46250
refactor: reorganize and clean metadata functions
AlexD10S Nov 20, 2024
17b02ab
feat: display specific use cases to the user
AlexD10S Nov 20, 2024
8abb480
refactor: predefined actions
AlexD10S Nov 20, 2024
5f336c6
fix: various fixes
AlexD10S Nov 21, 2024
f4fb1ab
fix: error message not supported for complex types
AlexD10S Nov 21, 2024
9304b5e
refactor: parse all metadata, including parameters at once
AlexD10S Nov 21, 2024
d8a7ed8
refactor: clean docs and move code
AlexD10S Nov 22, 2024
ad009f7
fix: format_type
AlexD10S Nov 22, 2024
5998a7e
fix: parse user inputs for Option arguments (#332)
AlexD10S Nov 22, 2024
8e04a88
Merge branch 'main' into feat-call-ui-contracts
AlexD10S Nov 22, 2024
a6f8247
test: fix unit test
AlexD10S Nov 22, 2024
cf83595
Merge branch 'feat-call-ui-contracts' into feat-call-ui-extrinsics-li…
AlexD10S Nov 23, 2024
4fe920d
refactor: clean the way to parse and prompt parameters
AlexD10S Nov 24, 2024
b6dba52
feat: add Purchase on-demand coretime use cases
AlexD10S Nov 24, 2024
a5c15d5
test: add skip_confirm, move when prompt for the signer and create th…
AlexD10S Nov 26, 2024
61bccd4
test: call parachain ui unit test
AlexD10S Nov 27, 2024
8fbc4a5
refactor: separate structs
Daanvdplas Nov 27, 2024
b22e0d3
fmt
Daanvdplas Nov 27, 2024
dcf0d33
test: pop-cli unit testing
AlexD10S Nov 28, 2024
dd8a121
test: pop-common unit tests
AlexD10S Nov 28, 2024
f62ec26
test: parse metadata unit tests
AlexD10S Nov 28, 2024
ab9e37c
test: refactor and test processing parameters
AlexD10S Nov 28, 2024
18f0610
test: comments and unit test in call functions
AlexD10S Nov 28, 2024
4945451
fix: clippy warnings
AlexD10S Nov 29, 2024
a756bed
chore: fmt
AlexD10S Nov 29, 2024
7b03c9a
fix: solve conflicts and unit tests (#359)
AlexD10S Nov 29, 2024
6a0072f
chore: fix merge conflicts
AlexD10S Nov 29, 2024
7cba66b
feat: guide user for calling a contract
AlexD10S Sep 5, 2024
7427eac
feat: get metadata contract from the contract path
AlexD10S Sep 5, 2024
ebaff08
refactor: refactor test and validate address input
AlexD10S Sep 5, 2024
afe670b
fix: apply feedback
AlexD10S Sep 6, 2024
6c9315d
feat: prompt to have another call and skip questions for queries
AlexD10S Sep 6, 2024
69de583
refactor: use Cli module instead of cliclack
AlexD10S Sep 8, 2024
71edc87
test: unit test pop-cli crate
AlexD10S Sep 9, 2024
48934bd
test: unit contracts crate
AlexD10S Sep 9, 2024
82f932f
chore: format
AlexD10S Sep 9, 2024
97ac220
test: refactor and improve test cases
AlexD10S Sep 10, 2024
295a7a3
fix: fix todos and refactor
AlexD10S Sep 10, 2024
149b554
test: fix unit test
AlexD10S Sep 10, 2024
3eea995
feat: parse types of parameters and display it to the user in the pla…
AlexD10S Sep 11, 2024
baa6be5
refactor: error handling for pop call
AlexD10S Sep 12, 2024
9e4d3a8
refactor: display call to be executed after guide and reorder
AlexD10S Sep 12, 2024
97e2133
refactor: when repeat call use same contract values and dont clean sc…
AlexD10S Sep 12, 2024
383efb7
test: add dry-run test
AlexD10S Sep 13, 2024
915e8a0
test: refactor and add more test coverage
AlexD10S Sep 19, 2024
1ce90e7
test: more coverage
AlexD10S Sep 20, 2024
63a1f8a
fix: unit test
AlexD10S Sep 20, 2024
32c8b56
feat: dev mode to skip certain user prompts
AlexD10S Nov 5, 2024
fb1bc95
refactor: test functions, renaming and fix clippy
AlexD10S Nov 5, 2024
06a0e54
refactor: improve devex of pop call contract
AlexD10S Nov 5, 2024
044b97e
test: adjust tests to refactor
AlexD10S Nov 5, 2024
f331fa9
chore: reset_for_new_call fields
AlexD10S Nov 6, 2024
b878401
fix: build contract if has not been built
AlexD10S Nov 6, 2024
bee10d5
refactor: use command state (#338)
evilrobot-01 Nov 6, 2024
cc92276
fix: automatically add some or none to Option argument
AlexD10S Nov 4, 2024
1837588
test: refactor and tests
AlexD10S Nov 4, 2024
740ae9a
refactor: improve code and comments
AlexD10S Nov 5, 2024
0ae993d
fix: renaming and clean code
AlexD10S Nov 5, 2024
907458b
chore: option params not mandatory
AlexD10S Nov 6, 2024
9f69ade
fix: parse user inputs for Option arguments in constructor (#335)
AlexD10S Nov 6, 2024
d3e7667
refactor: process_function_args
AlexD10S Nov 6, 2024
e0cb38c
test: update tests accordingly last changes
AlexD10S Nov 6, 2024
3be78c7
fix: issue with delimiter
AlexD10S Nov 6, 2024
471881b
test: fix unit test
AlexD10S Nov 6, 2024
438681d
refactor: renaming and fix comments
AlexD10S Nov 7, 2024
dcde21e
refactor: format types (#339)
evilrobot-01 Nov 8, 2024
80fcc99
feat: pop call parachain prototype
AlexD10S Sep 11, 2024
0079514
feat: dispaly arguments of extrinsic
AlexD10S Sep 11, 2024
b18cb4e
refactor: structure similar to pop call contract
AlexD10S Sep 13, 2024
d5929f9
feat: parse all values for extrinsic/storage
AlexD10S Sep 19, 2024
fecac84
refactor: signer in common
AlexD10S Sep 21, 2024
430522a
refactor: improve messages
AlexD10S Sep 22, 2024
a3d06c4
feat: call parachain ui
AlexD10S Sep 23, 2024
aeb6ed3
fix: calls working
AlexD10S Sep 24, 2024
14730a8
refactor: remove unused code
AlexD10S Sep 24, 2024
ab17a67
refactor: remove unused code
AlexD10S Sep 24, 2024
c0aab35
refactor: various fixes
AlexD10S Sep 24, 2024
418fdca
refactor: various fixes
AlexD10S Sep 24, 2024
7af045a
feat: add option to include params from command line
AlexD10S Sep 27, 2024
cbe58ed
refactor: clean docs and refactor code
AlexD10S Sep 27, 2024
d42c526
fix: tests
AlexD10S Nov 11, 2024
36c272b
refactor: parse all the metadata again
AlexD10S Nov 17, 2024
f046a9e
refactor: reorganize and clean metadata functions
AlexD10S Nov 20, 2024
0477ba0
feat: display specific use cases to the user
AlexD10S Nov 20, 2024
e3d423b
refactor: predefined actions
AlexD10S Nov 20, 2024
45eb5f9
fix: various fixes
AlexD10S Nov 21, 2024
8c657b1
fix: error message not supported for complex types
AlexD10S Nov 21, 2024
19e243a
refactor: parse all metadata, including parameters at once
AlexD10S Nov 21, 2024
d3c4888
refactor: clean docs and move code
AlexD10S Nov 22, 2024
b2bc2d7
fix: format_type
AlexD10S Nov 22, 2024
12cfce8
test: fix unit test
AlexD10S Nov 22, 2024
31abf33
refactor: clean the way to parse and prompt parameters
AlexD10S Nov 24, 2024
23c3118
feat: add Purchase on-demand coretime use cases
AlexD10S Nov 24, 2024
bbe810a
test: add skip_confirm, move when prompt for the signer and create th…
AlexD10S Nov 26, 2024
e19a69d
test: call parachain ui unit test
AlexD10S Nov 27, 2024
f471eee
test: pop-cli unit testing
AlexD10S Nov 28, 2024
0344ea2
test: pop-common unit tests
AlexD10S Nov 28, 2024
5e4ae23
test: parse metadata unit tests
AlexD10S Nov 28, 2024
d2170ba
test: refactor and test processing parameters
AlexD10S Nov 28, 2024
6e1050c
test: comments and unit test in call functions
AlexD10S Nov 28, 2024
cba8ef3
fix: clippy warnings
AlexD10S Nov 29, 2024
3b2bcc0
chore: fmt
AlexD10S Nov 29, 2024
f60c1e3
fix: resolve rebase issues
AlexD10S Nov 30, 2024
047ddc3
Merge remote-tracking branch 'upstream/daan/refactor-structs' into fe…
AlexD10S Nov 30, 2024
81b7f04
feat: repeat call only if using guide UI
AlexD10S Dec 1, 2024
6b963a4
fix: clippy
AlexD10S Dec 1, 2024
4ad7144
refactor: various improvements
AlexD10S Dec 1, 2024
f5897ed
chore: parser for pallet and extrinsic input names
AlexD10S Dec 2, 2024
e58952b
refactor: only move to pop_common the needed functions
AlexD10S Dec 2, 2024
fd0d6a6
refactor: improve test, docs and errors
AlexD10S Dec 2, 2024
6d7ea24
test: fix unit tests
AlexD10S Dec 2, 2024
7b8d3b6
fix: reset_for_new_call when extrinisc is not supported
AlexD10S Dec 3, 2024
100b720
test: merge fix CI tests
AlexD10S Dec 3, 2024
568f1ce
fix: build with parachain features
AlexD10S Dec 3, 2024
60a0d09
test: wait before call parachain in integration test
AlexD10S Dec 3, 2024
b97f608
docs: minor improvements
AlexD10S Dec 3, 2024
e377830
test: migrate find_free_port to pop_common
AlexD10S Dec 3, 2024
1c032bc
test: fix increase waiting time
AlexD10S Dec 4, 2024
b7c0169
test: remove unnecesary test case
AlexD10S Dec 5, 2024
0dce5f1
refactor: rename api with client
AlexD10S Dec 5, 2024
3f60dcd
refactor: naming and docs
AlexD10S Dec 5, 2024
7d7df02
docs: improve docs and missing comments
AlexD10S Dec 6, 2024
2fe44e4
test: sort order cli input tests
AlexD10S Dec 6, 2024
31f3b8d
test: remove unnecesary verbose
AlexD10S Dec 6, 2024
9801a7b
test: find_free_port
AlexD10S Dec 6, 2024
e70bc7a
docs: improve parameter documentation
AlexD10S Dec 6, 2024
0d2551a
test: add missing test to sign_and_submit_extrinsic
AlexD10S Dec 6, 2024
2bff2c1
fix: apply feedback from auxiliar PRs, remove unnecesary clones
AlexD10S Dec 6, 2024
44c1d4e
docs: public modules
AlexD10S Dec 6, 2024
28743bd
refactor: clean unused params
AlexD10S Dec 6, 2024
98aaae9
fix: mark all extrinsics that uses calls as parameter as unsupported
AlexD10S Dec 7, 2024
2eb5183
test: fix expect_select
AlexD10S Dec 9, 2024
69410bd
docs: improve documentation
AlexD10S Dec 9, 2024
c37580f
feat: submit extrinsic from call_data (#348)
AlexD10S Dec 9, 2024
275ae43
feat: parse files when the argument values are very big (#363)
AlexD10S Dec 9, 2024
48bfda9
test: fix decode_call_data_works unit test
AlexD10S Dec 9, 2024
06622ec
refactor: use Default derive macro and define constants for test valu…
AlexD10S Dec 9, 2024
562e783
feat: flag sudo to wrap extrinsic (#349)
AlexD10S Dec 9, 2024
9903944
refactor: various fixes and improvements (#367)
evilrobot-01 Dec 9, 2024
b19ece8
refactor: terminology (#368)
evilrobot-01 Dec 9, 2024
b3810b2
refactor: improvements (#370)
evilrobot-01 Dec 10, 2024
f1e4aed
refactor: rename parachain with chain as the primary command and reta…
AlexD10S Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
434 changes: 350 additions & 84 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ toml = "0.5.0"
# networking
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
url = "2.5"
url = "2.5.4"
AlexD10S marked this conversation as resolved.
Show resolved Hide resolved

# contracts
subxt-signer = { version = "0.37.0", features = ["subxt", "sr25519"] }
Expand All @@ -53,7 +53,9 @@ contract-build = "5.0.0-alpha"
contract-extrinsics = "5.0.0-alpha"
contract-transcode = "5.0.0-alpha"
scale-info = { version = "2.11.3", default-features = false, features = ["derive"] }
scale-value = { version = "0.16.2", default-features = false, features = ["from-string", "parser-ss58"] }
heck = "0.5.0"
hex = { version = "0.4.3", default-features = false }

# parachains
askama = "0.12"
Expand Down
6 changes: 6 additions & 0 deletions crates/pop-cli/src/commands/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use clap::{Args, Subcommand};

#[cfg(feature = "contract")]
pub(crate) mod contract;
#[cfg(feature = "parachain")]
pub(crate) mod parachain;

/// Arguments for calling a smart contract.
#[derive(Args)]
Expand All @@ -16,6 +18,10 @@ pub(crate) struct CallArgs {
/// Call a smart contract.
#[derive(Subcommand)]
pub(crate) enum Command {
/// Call a parachain.
#[cfg(feature = "parachain")]
#[clap(alias = "p")]
Parachain(parachain::CallParachainCommand),
/// Call a contract
#[cfg(feature = "contract")]
#[clap(alias = "c")]
Expand Down
Loading
Loading