diff --git a/.gitmodules b/.gitmodules index ea769d8795566a84d73e305dfdfd2a5e77ead971..610ceb2c4ed05ea783780a8e111d2775e04598b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -38,3 +38,6 @@ path = cellframe-sdk-python/libdap-app-cli-python url = https://gitlab.demlabs.net/cellframe/libdap-app-cli-python.git branch = master +[submodule "cellframe-sdk-python/libdap-chain-wallet-python"] + path = cellframe-sdk-python/libdap-chain-wallet-python + url = https://gitlab.demlabs.net/cellframe/libdap-chain-wallet-python.git diff --git a/CMakeLists.txt b/CMakeLists.txt index fd8b26188261b4b12c44aac8f83cda9f832b3b62..c2ccd95c36179b2960ea6b2f050b23c17ef12e2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,7 @@ else() add_subdirectory(cellframe-sdk-python/libdap-chain-python) add_subdirectory(cellframe-sdk-python/libdap-app-cli-python) add_subdirectory(cellframe-sdk-python/libdap-client-python) + add_subdirectory(cellframe-sdk-python/libdap-chain-wallet-python) target_compile_options(dap_chain_common_python_module PRIVATE "-fpic") @@ -95,6 +96,7 @@ else() target_compile_options(dap_chain_python_module PRIVATE "-fpic") target_compile_options(dap_app_cli_python_module PRIVATE "-fpic") target_compile_options(dap_client_python_module PRIVATE "-fpic") + target_compile_options(dap_chain_wallet_python_module PRIVATE "-fpic") #if (SKBUILD) message(STATUS "Make python extension") @@ -161,6 +163,7 @@ target_link_libraries(${PROJECT_NAME} cellframe-sdk dap_python_module dap_chain_net_python_module dap_chain_gdb_python_module dap_app_cli_python_module + dap_chain_wallet_python_module ${PYTHON_LIBRARIES} ) diff --git a/CellFrame/python-cellframe.c b/CellFrame/python-cellframe.c index aee6558ade9b998bff056f3979c291626bc50e41..78217fe04fa6af54b2115f55b424e1d531a30df2 100644 --- a/CellFrame/python-cellframe.c +++ b/CellFrame/python-cellframe.c @@ -271,7 +271,7 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){ } s_init_http_client_simple = true;*/ } else if (strcmp(c_value, "Wallet") == 0){ - if (dap_chain_wallet_init() != 0){ + if (dap_chain_wallet_init_py() != 0){ PyErr_SetString(CellFrame_error, "Failed to initialize Wallet module. "); return NULL; } @@ -288,7 +288,7 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){ return NULL; } } else if (strcmp(c_value, "ChainCSDagPos") == 0){ - if (dap_chain_cs_dag_poa_init() != 0){ + if (dap_chain_cs_dag_pos_init() != 0){ PyErr_SetString(CellFrame_error, "Failed to initialize ChainCSDagPos module. "); return NULL; } @@ -406,7 +406,8 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){ PyType_Ready(&DapStreamCtl_DapStreamCtlType) < 0 || PyType_Ready(&DapMempool_DapMempoolType) < 0 || // ==== - PyType_Ready(&DapAppCli_dapAppCliType ) < 0 + PyType_Ready(&DapAppCli_dapAppCliType ) < 0 || + PyType_Ready(&DapChainWallet_dapChainWalletType) < 0 ){ log_it(L_CRITICAL,"Not all py modules are ready for init"); return NULL; @@ -477,6 +478,7 @@ PyMODINIT_FUNC PyInit_libCellFrame(void){ // ============= PyModule_AddObject(module, "ChainGDB", (PyObject*)&DapChainGDBObject_DapChainGDBType); + PyModule_AddObject(module, "ChainWallet", (PyObject*)&DapChainWallet_dapChainWalletType); PyModule_AddObject(module, "Http", (PyObject*)&DapHTTP_DapHTTPType); PyModule_AddObject(module, "EncHttp", (PyObject*)&DapEncHTTP_DapEncHTTPType); @@ -525,6 +527,12 @@ void deinit_modules(void){ dap_common_deinit(); submodules_deint = true; } + if (s_init_wallet){ + dap_chain_wallet_deinit_py(); + } + dap_config_close(g_config); + dap_config_deinit(); + dap_common_deinit(); } PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){ diff --git a/cellframe-sdk-python/libdap-chain-wallet-python b/cellframe-sdk-python/libdap-chain-wallet-python new file mode 160000 index 0000000000000000000000000000000000000000..591cf4502be97766a9ac800bb66de761890c1c9f --- /dev/null +++ b/cellframe-sdk-python/libdap-chain-wallet-python @@ -0,0 +1 @@ +Subproject commit 591cf4502be97766a9ac800bb66de761890c1c9f diff --git a/cellframe-sdk-python/libdap-crypto-python b/cellframe-sdk-python/libdap-crypto-python index 83f950f59d3ba97bcac9f108e8fb93bd12bfcfb3..1ef04620dc5df45ef8da6a080c2f40c295514b42 160000 --- a/cellframe-sdk-python/libdap-crypto-python +++ b/cellframe-sdk-python/libdap-crypto-python @@ -1 +1 @@ -Subproject commit 83f950f59d3ba97bcac9f108e8fb93bd12bfcfb3 +Subproject commit 1ef04620dc5df45ef8da6a080c2f40c295514b42 diff --git a/include/python-cellframe.h b/include/python-cellframe.h index 9dc20b1ad1fb2b7c32221dd6f76f6baa831b1c84..c78e2998039a93479cd912e8ab2f099fbacb05f9 100644 --- a/include/python-cellframe.h +++ b/include/python-cellframe.h @@ -33,9 +33,10 @@ #include "wrapping_dap_stream_ctl.h" #include "wrapping_dap_mempool.h" #include "wrapping_dap_http_folder.h" +#include "dap_chain_wallet_python.h" //#include "dap_http_client_simple.h" -#include "dap_chain_wallet.h" +//#include "dap_chain_wallet.h" #include "dap_chain_cs.h" #include "dap_chain_cs_dag.h" #include "dap_chain_cs_dag_poa.h"