diff --git a/CMakeLists.txt b/CMakeLists.txt index e782050e806f4d0cc89a3a417f9bd7868e5506c4..0016c9b4ed3b940dcccd367d8621b790141cf84c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,9 @@ set(SUBMODULES_NO_BUILD ON) if (NOT (SUPPORT_PYTHON_PLUGINS)) if (NOT(WIN32)) - set(CELLFRAME_MODULES "core chains network cs-none") + set(CELLFRAME_MODULES "core chains network cs-none srv") else() - set(CELLFRAME_MODULES "core chains network cs-none") + set(CELLFRAME_MODULES "core chains network cs-none srv") endif() include(cellframe-sdk/cmake/OS_Detection.cmake) add_subdirectory(cellframe-sdk) diff --git a/cellframe-sdk b/cellframe-sdk index 44f1ac77cd56e40f0c82703c64db96f87edd74b3..0bd76117bf28dd4e8e6dd14305c16983d0ce8e21 160000 --- a/cellframe-sdk +++ b/cellframe-sdk @@ -1 +1 @@ -Subproject commit 44f1ac77cd56e40f0c82703c64db96f87edd74b3 +Subproject commit 0bd76117bf28dd4e8e6dd14305c16983d0ce8e21 diff --git a/modules/cellframe-sdk/chain/src/wrapping_dap_chain_ledger.c b/modules/cellframe-sdk/chain/src/wrapping_dap_chain_ledger.c index 401766281c36acbff387d468489a30c80e624307..9e39ee38063e7c77042c3fc60f1d617e0be8b6c9 100644 --- a/modules/cellframe-sdk/chain/src/wrapping_dap_chain_ledger.c +++ b/modules/cellframe-sdk/chain/src/wrapping_dap_chain_ledger.c @@ -148,7 +148,7 @@ PyObject *dap_chain_ledger_tx_remove_py(PyObject *self, PyObject *args){ return PyLong_FromLong(res); } PyObject *dap_chain_ledger_purge_py(PyObject *self, PyObject *args){ - dap_chain_ledger_purge(((PyDapChainLedgerObject*)self)->ledger); + dap_chain_ledger_purge(((PyDapChainLedgerObject*)self)->ledger, false); return PyLong_FromLong(0); } PyObject *dap_chain_ledger_count_py(PyObject *self, PyObject *args){ @@ -178,7 +178,10 @@ PyObject *dap_chain_ledger_calc_balance_py(PyObject *self, PyObject *args){ const char *token_ticker; if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker)) return NULL; - uint256_t res = dap_chain_ledger_calc_balance(((PyDapChainLedgerObject*)self)->ledger, ((PyDapChainAddrObject*)addr)->addr, token_ticker); + uint64_t res = dap_chain_uint256_to( + dap_chain_ledger_calc_balance( + ((PyDapChainLedgerObject*)self)->ledger, + ((PyDapChainAddrObject*)addr)->addr, token_ticker)); return Py_BuildValue("k", res); } PyObject *dap_chain_ledger_calc_balance_full_py(PyObject *self, PyObject *args){ @@ -186,7 +189,10 @@ PyObject *dap_chain_ledger_calc_balance_full_py(PyObject *self, PyObject *args){ const char *token_ticker; if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker)) return NULL; - uint256_t res = dap_chain_ledger_calc_balance_full(((PyDapChainLedgerObject*)self)->ledger, ((PyDapChainAddrObject*)addr)->addr, token_ticker); + uint64_t res = dap_chain_uint256_to( + dap_chain_ledger_calc_balance_full( + ((PyDapChainLedgerObject*)self)->ledger, + ((PyDapChainAddrObject*)addr)->addr, token_ticker)); return Py_BuildValue("k", res); } PyObject *dap_chain_ledger_tx_find_by_hash_py(PyObject *self, PyObject *args){ @@ -234,17 +240,19 @@ PyObject *dap_chain_ledger_tx_cache_find_out_cond_py(PyObject *self, PyObject *a out_conds, out_cond_idx, NULL); return Py_BuildValue("O", res); } + PyObject *dap_chain_ledger_tx_cache_get_out_cond_value_py(PyObject *self, PyObject *args){ PyObject *obj_addr; if (!PyArg_ParseTuple(args, "O", &obj_addr)) return NULL; dap_chain_tx_out_cond_t **out_conds = NULL; - uint64_t res = dap_chain_ledger_tx_cache_get_out_cond_value(((PyDapChainLedgerObject*)self)->ledger, + uint256_t res = dap_chain_ledger_tx_cache_get_out_cond_value(((PyDapChainLedgerObject*)self)->ledger, ((PyDapChainAddrObject*)obj_addr)->addr, out_conds); + uint64_t res64 = dap_chain_uint256_to(res); PyObject *obj_out_conds = _PyObject_New(&DapChainTxOutCond_DapChainTxOutCondObjectType); ((PyDapChainTxOutCondObject*)obj_out_conds)->out_cond = *out_conds; - PyObject *obj_res = PyLong_FromUnsignedLongLong(res); + PyObject *obj_res = PyLong_FromUnsignedLongLong(res64); return Py_BuildValue("OO", obj_res, obj_out_conds); } diff --git a/modules/cellframe-sdk/common/src/wrapping_dap_chain_datum_tx.c b/modules/cellframe-sdk/common/src/wrapping_dap_chain_datum_tx.c index 5241612dc97960223d856bc7f9c5de0bf405b7bb..b8376f380ccce53e9c7f347e3d10446ea0c4f0f3 100644 --- a/modules/cellframe-sdk/common/src/wrapping_dap_chain_datum_tx.c +++ b/modules/cellframe-sdk/common/src/wrapping_dap_chain_datum_tx.c @@ -91,7 +91,7 @@ PyObject *dap_chain_datum_tx_add_in_cond_item_py(PyObject *self, PyObject *args) PyObject *dap_chain_datum_tx_add_out_item_py(PyObject *self, PyObject *args){ PyObject *in_addr; - uint64_t value; + uint256_t value; if (!PyArg_ParseTuple(args, "O|k", &in_addr, &value)) return NULL; int res = dap_chain_datum_tx_add_out_item(&(((PyDapChainDatumTxObject*)self)->datum_tx), @@ -102,8 +102,8 @@ PyObject *dap_chain_datum_tx_add_out_item_py(PyObject *self, PyObject *args){ PyObject *dap_chain_datum_tx_add_out_cond_item_py(PyObject *self, PyObject *args){ PyObject *obj_key; PyObject *obj_srv_uid; - uint64_t value; - uint64_t value_max_per_unit; + uint256_t value; + uint256_t value_max_per_unit; PyObject *obj_srv_price_unit_uid; PyObject *obj_cond_bytes; Py_ssize_t cond_size;