diff --git a/modules/net/dap_chain_node_cli_cmd.c b/modules/net/dap_chain_node_cli_cmd.c index d712c847fd89b06bfd1475e4d56f9e869e93c556..78597f3369afabc56d6486f662e9073b227d3db4 100644 --- a/modules/net/dap_chain_node_cli_cmd.c +++ b/modules/net/dap_chain_node_cli_cmd.c @@ -2098,15 +2098,19 @@ int l_arg_index = 1, l_rc, cmd_num = CMD_NONE; l_sign_index++; for (;l_sign_index && l_sign_index < a_argc; ++l_sign_index) { l_sign_types[l_sign_count] = dap_sign_type_from_str(a_argv[l_sign_index]); - if (l_sign_types[l_sign_count].type == SIG_TYPE_NULL) { + if (l_sign_types[l_sign_count].type == SIG_TYPE_NULL || + l_sign_types[l_sign_count].type == SIG_TYPE_MULTI_CHAINED) { break; } l_sign_count++; } - if (!l_sign_count) { + if (l_sign_count < 2) { dap_json_rpc_error_add(DAP_CHAIN_NODE_CLI_COM_TX_WALLET_UNKNOWN_SIGN_ERR, - "'%s' unknown signature type, please use:\n%s", - l_sign_type_str, dap_sign_get_str_recommended_types()); + "You did not specify an additional signature after " + "sig_multi_chained. You must specify at least two more " + "signatures other than sig_multi_chained.\n" + "After sig_multi_chained, you must specify two more signatures " + "from the list: %s", dap_cert_get_str_recommended_sign()); json_object_put(json_arr_out); return DAP_CHAIN_NODE_CLI_COM_TX_WALLET_UNKNOWN_SIGN_ERR; } @@ -2172,7 +2176,16 @@ int l_arg_index = 1, l_rc, cmd_num = CMD_NONE; const char *l_addr_str = dap_chain_addr_to_str(l_addr); json_object * json_obj_wall = json_object_new_object(); json_object_object_add(json_obj_wall, "Wallet name", json_object_new_string(l_wallet->name)); - json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_sign_type_str)); + if (l_sign_count > 1) { + dap_string_t *l_signs_types_str = dap_string_new("sig_multi_chained, "); + for (size_t i = 0; i < l_sign_count; i++) { + dap_string_append_printf(l_signs_types_str, "%s%s", + dap_sign_type_to_str(l_sign_types[i]), (i+1) == l_sign_count ? "": ", "); + } + json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_signs_types_str->str)); + dap_string_free(l_signs_types_str, true); + } else + json_object_object_add(json_obj_wall, "Sign type", json_object_new_string(l_sign_type_str)); json_object_object_add(json_obj_wall, "Status", json_object_new_string("successfully created")); if ( l_addr_str ) { json_object_object_add(json_obj_wall, "new address", json_object_new_string(l_addr_str));