Skip to content
Snippets Groups Projects

bugs-5311

Merged Roman Khlopkov requested to merge bugs-5311 into develop
4 files
+ 19
11
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -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);
}
Loading