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

bugs-5311

parent 37c95060
No related branches found
No related tags found
1 merge request!61bugs-5311
...@@ -20,9 +20,9 @@ set(SUBMODULES_NO_BUILD ON) ...@@ -20,9 +20,9 @@ set(SUBMODULES_NO_BUILD ON)
if (NOT (SUPPORT_PYTHON_PLUGINS)) if (NOT (SUPPORT_PYTHON_PLUGINS))
if (NOT(WIN32)) if (NOT(WIN32))
set(CELLFRAME_MODULES "core chains network cs-none") set(CELLFRAME_MODULES "core chains network cs-none srv")
else() else()
set(CELLFRAME_MODULES "core chains network cs-none") set(CELLFRAME_MODULES "core chains network cs-none srv")
endif() endif()
include(cellframe-sdk/cmake/OS_Detection.cmake) include(cellframe-sdk/cmake/OS_Detection.cmake)
add_subdirectory(cellframe-sdk) add_subdirectory(cellframe-sdk)
......
Subproject commit 44f1ac77cd56e40f0c82703c64db96f87edd74b3 Subproject commit 0bd76117bf28dd4e8e6dd14305c16983d0ce8e21
...@@ -148,7 +148,7 @@ PyObject *dap_chain_ledger_tx_remove_py(PyObject *self, PyObject *args){ ...@@ -148,7 +148,7 @@ PyObject *dap_chain_ledger_tx_remove_py(PyObject *self, PyObject *args){
return PyLong_FromLong(res); return PyLong_FromLong(res);
} }
PyObject *dap_chain_ledger_purge_py(PyObject *self, PyObject *args){ 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); return PyLong_FromLong(0);
} }
PyObject *dap_chain_ledger_count_py(PyObject *self, PyObject *args){ 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){ ...@@ -178,7 +178,10 @@ PyObject *dap_chain_ledger_calc_balance_py(PyObject *self, PyObject *args){
const char *token_ticker; const char *token_ticker;
if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker)) if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker))
return NULL; 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); return Py_BuildValue("k", res);
} }
PyObject *dap_chain_ledger_calc_balance_full_py(PyObject *self, PyObject *args){ 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){ ...@@ -186,7 +189,10 @@ PyObject *dap_chain_ledger_calc_balance_full_py(PyObject *self, PyObject *args){
const char *token_ticker; const char *token_ticker;
if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker)) if (!PyArg_ParseTuple(args, "O|s", &addr, &token_ticker))
return NULL; 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); return Py_BuildValue("k", res);
} }
PyObject *dap_chain_ledger_tx_find_by_hash_py(PyObject *self, PyObject *args){ 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 ...@@ -234,17 +240,19 @@ PyObject *dap_chain_ledger_tx_cache_find_out_cond_py(PyObject *self, PyObject *a
out_conds, out_cond_idx, NULL); out_conds, out_cond_idx, NULL);
return Py_BuildValue("O", res); return Py_BuildValue("O", res);
} }
PyObject *dap_chain_ledger_tx_cache_get_out_cond_value_py(PyObject *self, PyObject *args){ PyObject *dap_chain_ledger_tx_cache_get_out_cond_value_py(PyObject *self, PyObject *args){
PyObject *obj_addr; PyObject *obj_addr;
if (!PyArg_ParseTuple(args, "O", &obj_addr)) if (!PyArg_ParseTuple(args, "O", &obj_addr))
return NULL; return NULL;
dap_chain_tx_out_cond_t **out_conds = 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, ((PyDapChainAddrObject*)obj_addr)->addr,
out_conds); out_conds);
uint64_t res64 = dap_chain_uint256_to(res);
PyObject *obj_out_conds = _PyObject_New(&DapChainTxOutCond_DapChainTxOutCondObjectType); PyObject *obj_out_conds = _PyObject_New(&DapChainTxOutCond_DapChainTxOutCondObjectType);
((PyDapChainTxOutCondObject*)obj_out_conds)->out_cond = *out_conds; ((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); return Py_BuildValue("OO", obj_res, obj_out_conds);
} }
......
...@@ -91,7 +91,7 @@ PyObject *dap_chain_datum_tx_add_in_cond_item_py(PyObject *self, PyObject *args) ...@@ -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 *dap_chain_datum_tx_add_out_item_py(PyObject *self, PyObject *args){
PyObject *in_addr; PyObject *in_addr;
uint64_t value; uint256_t value;
if (!PyArg_ParseTuple(args, "O|k", &in_addr, &value)) if (!PyArg_ParseTuple(args, "O|k", &in_addr, &value))
return NULL; return NULL;
int res = dap_chain_datum_tx_add_out_item(&(((PyDapChainDatumTxObject*)self)->datum_tx), 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){ ...@@ -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 *dap_chain_datum_tx_add_out_cond_item_py(PyObject *self, PyObject *args){
PyObject *obj_key; PyObject *obj_key;
PyObject *obj_srv_uid; PyObject *obj_srv_uid;
uint64_t value; uint256_t value;
uint64_t value_max_per_unit; uint256_t value_max_per_unit;
PyObject *obj_srv_price_unit_uid; PyObject *obj_srv_price_unit_uid;
PyObject *obj_cond_bytes; PyObject *obj_cond_bytes;
Py_ssize_t cond_size; Py_ssize_t cond_size;
......
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