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
18
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
0535a6dd
Commit
0535a6dd
authored
2 years ago
by
Roman Khlopkov
🔜
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix-8568' into 'release-5.2'
Hotfix 8568 See merge request
!1066
parents
16dbfe8e
4a20db2f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1066
Hotfix 8568
Pipeline
#25667
passed with stage
in 9 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/net/srv/dap_chain_net_srv.c
+27
-6
27 additions, 6 deletions
modules/net/srv/dap_chain_net_srv.c
with
27 additions
and
6 deletions
modules/net/srv/dap_chain_net_srv.c
+
27
−
6
View file @
0535a6dd
...
@@ -363,6 +363,12 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
...
@@ -363,6 +363,12 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
l_direction
=
SERV_DIR_SELL
;
l_direction
=
SERV_DIR_SELL
;
else
if
(
strcmp
(
l_direction_str
,
"buy"
)
==
0
)
else
if
(
strcmp
(
l_direction_str
,
"buy"
)
==
0
)
l_direction
=
SERV_DIR_BUY
;
l_direction
=
SERV_DIR_BUY
;
else
{
dap_string_free
(
l_string_ret
,
true
);
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Wrong direction of the token was "
"specified, possible directions: buy, sell."
);
return
-
18
;
}
}
}
if
(
l_srv_uid_str
)
if
(
l_srv_uid_str
)
...
@@ -471,14 +477,19 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
...
@@ -471,14 +477,19 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
dap_chain_net_srv_price_unit_uid_t
l_price_unit
=
{{
0
}};
dap_chain_net_srv_price_unit_uid_t
l_price_unit
=
{{
0
}};
dap_chain_net_srv_order_direction_t
l_direction
=
SERV_DIR_UNDEFINED
;
dap_chain_net_srv_order_direction_t
l_direction
=
SERV_DIR_UNDEFINED
;
if
(
l_direction_str
){
if
(
l_direction_str
){
if
(
strcmp
(
l_direction_str
,
"sell"
)
==
0
){
if
(
strcmp
(
l_direction_str
,
"sell"
)
==
0
)
{
l_direction
=
SERV_DIR_SELL
;
l_direction
=
SERV_DIR_SELL
;
log_it
(
L_DEBUG
,
"Created order to sell"
);
log_it
(
L_DEBUG
,
"Created order to sell"
);
}
else
if
(
strcmp
(
l_direction_str
,
"buy"
)
==
0
){
}
else
if
(
strcmp
(
l_direction_str
,
"buy"
)
==
0
)
{
l_direction
=
SERV_DIR_BUY
;
l_direction
=
SERV_DIR_BUY
;
log_it
(
L_DEBUG
,
"Created order to buy"
);
log_it
(
L_DEBUG
,
"Created order to buy"
);
}
else
}
else
{
log_it
(
L_WARNING
,
"Undefined order direction"
);
log_it
(
L_WARNING
,
"Undefined order direction"
);
dap_string_free
(
l_string_ret
,
true
);
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Wrong direction of the token was "
"specified, possible directions: buy, sell."
);
return
-
18
;
}
}
}
...
@@ -486,7 +497,6 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
...
@@ -486,7 +497,6 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
l_expires
=
(
dap_time_t
)
atoll
(
l_expires_str
);
l_expires
=
(
dap_time_t
)
atoll
(
l_expires_str
);
l_srv_uid
.
uint64
=
(
uint64_t
)
atoll
(
l_srv_uid_str
);
l_srv_uid
.
uint64
=
(
uint64_t
)
atoll
(
l_srv_uid_str
);
if
(
l_node_addr_str
){
if
(
l_node_addr_str
){
if
(
dap_chain_node_addr_from_str
(
&
l_node_addr
,
l_node_addr_str
)
==
0
)
if
(
dap_chain_node_addr_from_str
(
&
l_node_addr
,
l_node_addr_str
)
==
0
)
log_it
(
L_DEBUG
,
"node addr "
NODE_ADDR_FP_STR
,
NODE_ADDR_FP_ARGS_S
(
l_node_addr
)
);
log_it
(
L_DEBUG
,
"node addr "
NODE_ADDR_FP_STR
,
NODE_ADDR_FP_ARGS_S
(
l_node_addr
)
);
else
{
else
{
...
@@ -510,11 +520,22 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
...
@@ -510,11 +520,22 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
dap_cert_t
*
l_cert
=
NULL
;
dap_cert_t
*
l_cert
=
NULL
;
dap_enc_key_t
*
l_key
=
NULL
;
dap_enc_key_t
*
l_key
=
NULL
;
if
(
l_order_cert_name
)
{
if
(
l_order_cert_name
)
{
dap_cert_t
*
l_cert
=
dap_cert_find_by_name
(
l_order_cert_name
);
l_cert
=
dap_cert_find_by_name
(
l_order_cert_name
);
if
(
l_cert
)
if
(
l_cert
)
l_key
=
l_cert
->
enc_key
;
l_key
=
l_cert
->
enc_key
;
else
else
{
log_it
(
L_ERROR
,
"Can't load cert '%s' for sign order"
,
l_order_cert_name
);
log_it
(
L_ERROR
,
"Can't load cert '%s' for sign order"
,
l_order_cert_name
);
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"Can't load cert '%s' for sign "
"order"
,
l_order_cert_name
);
dap_string_free
(
l_string_ret
,
true
);
return
-
19
;
}
}
else
{
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"The certificate name was not "
"specified. Since version 5.2 it is not possible to "
"create unsigned orders."
);
dap_string_free
(
l_string_ret
,
true
);
return
-
20
;
}
}
// create order
// create order
char
*
l_order_new_hash_str
=
dap_chain_net_srv_order_create
(
char
*
l_order_new_hash_str
=
dap_chain_net_srv_order_create
(
...
...
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