Skip to content
Snippets Groups Projects
Commit c62a7a60 authored by Roman Khlopkov's avatar Roman Khlopkov 🔜
Browse files

[*] Port orders & GDB from develop

parent dae0ca63
No related branches found
No related tags found
3 merge requests!80Hotfix,!79hotfix-5564,!78hotfix-5564
This commit is part of merge request !79. Comments created here will be created in the context of that merge request.
......@@ -40,7 +40,9 @@ add_subdirectory(modules/dap-sdk/net/server/http)
add_subdirectory(modules/dap-sdk/net/server/json_rpc)
add_subdirectory(modules/cellframe-sdk/common)
add_subdirectory(modules/cellframe-sdk/net)
add_subdirectory(modules/cellframe-sdk/net/srv)
add_subdirectory(modules/cellframe-sdk/gdb)
add_subdirectory(modules/cellframe-sdk/global-db)
add_subdirectory(modules/cellframe-sdk/chain)
add_subdirectory(modules/cellframe-sdk/app-cli)
add_subdirectory(modules/cellframe-sdk/wallet)
......@@ -50,6 +52,7 @@ add_subdirectory(modules/cellframe-sdk/type/dag)
target_compile_options(dap_python_module PRIVATE "-fpic" )
target_compile_options(dap_crypto_python_module PRIVATE "-fpic" )
target_compile_options(dap_chain_net_python_module PRIVATE "-fpic")
target_compile_options(dap_chain_net_srv_python_module PRIVATE "-fpic")
target_compile_options(dap_chain_gdb_python_module PRIVATE "-fpic")
target_compile_options(dap_chain_python_module PRIVATE "-fpic")
target_compile_options(dap_app_cli_python_module PRIVATE "-fpic")
......@@ -179,7 +182,9 @@ target_link_libraries(${PROJECT_NAME} cellframe-sdk dap_python_module
dap_server_http_python_module
dap_chain_python_module
dap_chain_net_python_module
dap_chain_net_srv_python_module
dap_chain_gdb_python_module
dap_chain_global_db_python_module
dap_app_cli_python_module
dap_chain_wallet_python_module
dap_server_json_rpc_python_module
......
......@@ -76,8 +76,6 @@ PyObject *dap_chain_net_links_connect_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_chain_by_chain_type_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_ledger_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_name_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_get_tx_by_hash_py(PyObject *self, PyObject *args);
PyObject *dap_chain_net_python_get_id(PyObject *self, void *closure);
static PyMethodDef DapChainNetMethods[] = {
{"loadAll", dap_chain_net_load_all_py, METH_NOARGS | METH_STATIC, ""},
......@@ -102,12 +100,13 @@ static PyMethodDef DapChainNetMethods[] = {
{"getChainByChainType", dap_chain_net_get_chain_by_chain_type_py, METH_VARARGS, ""},
{"getLedger", dap_chain_net_get_ledger_py, METH_NOARGS, ""},
{"getName", dap_chain_net_get_name_py, METH_NOARGS, ""},
{"getTxByHash", dap_chain_net_get_tx_by_hash_py, METH_VARARGS, ""},
{NULL, NULL, 0, NULL}
};
PyObject *dap_chain_net_python_get_id(PyObject *self, void *closure);
static PyGetSetDef DapChainNetGetsSetsDef[] = {
{"id", (getter)dap_chain_net_python_get_id, NULL, NULL, NULL},
{"id", (getter)dap_chain_net_python_get_id, NULL, NULL, NULL},
{NULL}
};
......@@ -140,9 +139,9 @@ static PyTypeObject DapChainNetObject_DapChainNetObjectType = {
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetMethods, /* tp_methods */
0, /* tp_members */
DapChainNetGetsSetsDef, /* tp_getset */
DapChainNetMethods, /* tp_methods */
0, /* tp_members */
DapChainNetGetsSetsDef, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
......@@ -153,6 +152,10 @@ static PyTypeObject DapChainNetObject_DapChainNetObjectType = {
PyType_GenericNew, /* tp_new */
};
static bool PyDapChainNet_Check(PyObject *a_obj){
return PyObject_TypeCheck(a_obj, &DapChainNetObject_DapChainNetObjectType);
}
#ifdef __cplusplus
}
#endif
......
......@@ -107,6 +107,14 @@ PyObject *dap_chain_net_get_chain_by_name_py(PyObject *self, PyObject *args){
return Py_BuildValue("O", obj_chain);
}
PyObject *dap_chain_net_python_get_id(PyObject *self, void *closure){
(void)closure;
PyDapChainNetIdObject *obj_net_id = PyObject_New(PyDapChainNetIdObject, &DapChainNetIdObject_DapChainNetIdObjectType);
PyObject_Dir((PyObject*)obj_net_id);
obj_net_id->net_id = ((PyDapChainNetObject*)self)->chain_net->pub.id;
return (PyObject*)obj_net_id;
}
PyObject *dap_chain_net_get_cur_addr_py(PyObject *self, PyObject *args){
PyObject *obj_node_addr = _PyObject_New(&DapChainNodeAddrObject_DapChainNodeAddrObjectType);
((PyDapChainNodeAddrObject*)obj_node_addr)->node_addr = dap_chain_net_get_cur_addr(((PyDapChainNetObject*)self)->chain_net);
......@@ -167,27 +175,3 @@ PyObject *dap_chain_net_get_name_py(PyObject *self, PyObject *args){
PyObject *obj_name = PyUnicode_FromString(((PyDapChainNetObject*)self)->chain_net->pub.name);
return obj_name;
}
PyObject *dap_chain_net_get_tx_by_hash_py(PyObject *self, PyObject *args){
PyObject *obj_hash;
if (!PyArg_ParseTuple(args, "O", &obj_hash)){
return NULL;
}
PyDapChainDatumTxObject *obj_tx = PyObject_New(PyDapChainDatumTxObject, &DapChainDatumTx_DapChainDatumTxObjectType);
PyObject_Dir((PyObject*)obj_tx);
obj_tx->datum_tx = dap_chain_net_get_tx_by_hash(((PyDapChainNetObject*)self)->chain_net,
((PyDapHashFastObject*)obj_hash)->hash_fast, TX_SEARCH_TYPE_LOCAL);
if(obj_tx->datum_tx == NULL){
Py_XDECREF(obj_tx);
return Py_None;
}
return (PyObject*)obj_tx;
}
PyObject *dap_chain_net_python_get_id(PyObject *self, void *closure){
(void)closure;
PyDapChainNetIdObject *obj_net_id = PyObject_New(PyDapChainNetObject, &DapChainNetIdObject_DapChainNetIdObjectType);
PyObject_Dir((PyObject*)obj_net_id);
obj_net_id->net_id = ((PyDapChainNetObject*)self)->chain_net->pub.id;
return (PyObject*)obj_net_id;
}
......@@ -100,7 +100,6 @@ void element_py_func_del_all(){
}
static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
PyGILState_STATE state = PyGILState_Ensure();
size_t id_str_replay = elements_str_reply_add(str_reply);
PyObject *obj_argv = stringToPyList(argc, argv);
PyObject *obj_id_str_replay = PyLong_FromSize_t(id_str_replay);
......@@ -115,7 +114,6 @@ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
Py_XDECREF(arglist);
Py_XDECREF(obj_argv);
elements_str_reply_delete(id_str_replay);
PyGILState_Release(state);
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment