Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
192184c5
Commit
192184c5
authored
1 year ago
by
Roman Khlopkov
🔜
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugfix-9110' into 'release-5.2'
Bugfix 9110 See merge request
!1163
parents
9b2dbd8a
160f4549
No related branches found
Branches containing commit
No related tags found
1 merge request
!1163
Bugfix 9110
Pipeline
#28129
passed with stage
in 8 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/net/dap_chain_node_cli.c
+7
-6
7 additions, 6 deletions
modules/net/dap_chain_node_cli.c
modules/net/dap_chain_node_cli_cmd_tx.c
+26
-2
26 additions, 2 deletions
modules/net/dap_chain_node_cli_cmd_tx.c
with
33 additions
and
8 deletions
modules/net/dap_chain_node_cli.c
+
7
−
6
View file @
192184c5
...
...
@@ -329,12 +329,13 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
"decree create service -net <net_name> [-chain <chain_name>] -decree_chain <chain_name> -srv_id <service_id> -certs <certs list> -<Subtype param name> <Subtype param Value>
\n
"
"decree sign -net <net_name> [-chain <chain_name>] -datum <datum_hash> -certs <certs_list>
\n
"
"decree anchor -net <net_name> -chain <chain_name> -datum <datum_hash> -certs <certs_list>
\n
"
"decree find -net <net_name> -hash <decree_hash>. Find decree by hash and show it's status (apllied or not)"
"==Subtype Params==
\n
"
"
\t
-fee <value>: sets fee for tx in net
\n
"
"
\t
-to_addr <wallet_addr>: sets wallet addr for network fee
\n
"
"
\t
-new_certs <certs_list>: sets new owners set for net
\n
"
"
\t
-signs_verify <value>: sets minimum number of owners needed to sign decree
\n
"
);
"decree find -net <net_name> -hash <decree_hash>. Find decree by hash and show it's status (apllied or not)
\n
"
"
\t
==Subtype Params==
\n
"
"
\t\t
-fee <value>: sets fee for tx in net
\n
"
"
\t\t
-to_addr <wallet_addr>: sets wallet addr for network fee
\n
"
"
\t\t
-new_certs <certs_list>: sets new owners set for net
\n
"
"
\t\t
-signs_verify <value>: sets minimum number of owners needed to sign decree
\n
"
"decree info -net <net_name>. Displays information about the parameters of the decrees in the network.
\n
"
);
// Exit - always last!
dap_cli_server_cmd_add
(
"exit"
,
com_exit
,
"Stop application and exit"
,
...
...
This diff is collapsed.
Click to expand it.
modules/net/dap_chain_node_cli_cmd_tx.c
+
26
−
2
View file @
192184c5
...
...
@@ -1176,7 +1176,7 @@ static dap_chain_datum_anchor_t * s_sign_anchor_in_cycle(dap_cert_t ** a_certs,
// Decree commands handlers
int
cmd_decree
(
int
a_argc
,
char
**
a_argv
,
char
**
a_str_reply
)
{
enum
{
CMD_NONE
=
0
,
CMD_CREATE
,
CMD_SIGN
,
CMD_ANCHOR
,
CMD_FIND
};
enum
{
CMD_NONE
=
0
,
CMD_CREATE
,
CMD_SIGN
,
CMD_ANCHOR
,
CMD_FIND
,
CMD_INFO
};
enum
{
TYPE_NONE
=
0
,
TYPE_COMMON
,
TYPE_SERVICE
};
enum
{
SUBTYPE_NONE
=
0
,
SUBTYPE_FEE
,
SUBTYPE_OWNERS
,
SUBTYPE_MIN_OWNERS
};
int
arg_index
=
1
;
...
...
@@ -1221,8 +1221,10 @@ int cmd_decree(int a_argc, char **a_argv, char ** a_str_reply)
l_cmd
=
CMD_ANCHOR
;
else
if
(
dap_cli_server_cmd_find_option_val
(
a_argv
,
1
,
2
,
"find"
,
NULL
))
l_cmd
=
CMD_FIND
;
else
if
(
dap_cli_server_cmd_find_option_val
(
a_argv
,
1
,
2
,
"info"
,
NULL
))
l_cmd
=
CMD_INFO
;
if
(
l_cmd
!=
CMD_FIND
)
{
if
(
l_cmd
!=
CMD_FIND
&&
l_cmd
!=
CMD_INFO
)
{
// Public certifiacte of condition owner
dap_cli_server_cmd_find_option_val
(
a_argv
,
arg_index
,
a_argc
,
"-certs"
,
&
l_certs_str
);
if
(
!
l_certs_str
)
{
...
...
@@ -1671,6 +1673,28 @@ int cmd_decree(int a_argc, char **a_argv, char ** a_str_reply)
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Specified decree is %s in decrees hash-table"
,
l_decree
?
(
l_applied
?
"applied"
:
"not applied"
)
:
"not found"
);
}
break
;
case
CMD_INFO
:
{
dap_string_t
*
l_str_owner_pkey
=
dap_string_new
(
""
);
int
i
=
1
;
for
(
dap_list_t
*
l_current_pkey
=
l_net
->
pub
.
decree
->
pkeys
;
l_current_pkey
;
l_current_pkey
=
l_current_pkey
->
next
){
dap_pkey_t
*
l_pkey
=
(
dap_pkey_t
*
)(
l_current_pkey
->
data
);
dap_hash_fast_t
l_pkey_hash
=
{
0
};
dap_pkey_get_hash
(
l_pkey
,
&
l_pkey_hash
);
char
*
l_pkey_hash_str
=
dap_hash_fast_to_str_new
(
&
l_pkey_hash
);
dap_string_append_printf
(
l_str_owner_pkey
,
"
\t
%d) %s
\n
"
,
i
,
l_pkey_hash_str
);
i
++
;
DAP_DELETE
(
l_pkey_hash_str
);
}
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Decree info:
\n
"
"
\t
Owners: %d
\n
"
"
\t
=====================================================================
\n
"
"%s"
"
\t
=====================================================================
\n
"
"
\t
Min owners for apply decree: %d
\n
"
,
l_net
->
pub
.
decree
->
num_of_owners
,
l_str_owner_pkey
->
str
,
l_net
->
pub
.
decree
->
min_num_of_owners
);
dap_string_free
(
l_str_owner_pkey
,
true
);
}
break
;
default:
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Not found decree action. Use create, sign, anchor or find parameter"
);
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment