File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
crates/pop-cli/src/commands/call Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ use url::Url;
2424const DEFAULT_URI : & str = "//Alice" ;
2525const ENCODED_CALL_DATA_MAX_LEN : usize = 500 ; // Maximum length of encoded call data to display.
2626
27+ fn to_tuple ( args : & [ String ] ) -> String {
28+ match args. len ( ) {
29+ 0 => "" . to_string ( ) ,
30+ 1 => args[ 0 ] . clone ( ) ,
31+ _ => format ! ( "({})" , args. join( "," ) ) ,
32+ }
33+ }
34+
2735/// Command to construct and execute extrinsics with configurable pallets, functions, arguments, and
2836/// signing options.
2937#[ derive( Args , Clone , Default ) ]
@@ -308,7 +316,7 @@ impl CallChainCommand {
308316 let is_composite = key_param. sub_params . len ( ) > 1 ;
309317 let ( mut params, len) =
310318 if self . args . len ( ) == key_param. sub_params . len ( ) && is_composite {
311- ( vec ! [ format! ( "({})" , self . args. join ( "," ) ) ] , self . args . len ( ) )
319+ ( vec ! [ to_tuple ( self . args. as_slice ( ) ) ] , self . args . len ( ) )
312320 } else if self . args . len ( ) == 1 && is_composite {
313321 // Handle composite tuple string like "(A, B, C)"
314322 let arg = self . args [ 0 ]
@@ -345,6 +353,9 @@ impl CallChainCommand {
345353 break ;
346354 }
347355 }
356+ if is_composite {
357+ params = vec ! [ to_tuple( params. as_slice( ) ) ] ;
358+ }
348359 }
349360 params
350361 } else {
You can’t perform that action at this time.
0 commit comments