Skip to content
Snippets Groups Projects
Commit b5ed2352 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'features-2564' into 'master'

Features 2564

See merge request libdap-chain-python!7
parents 4bbc01ce c8a407db
No related branches found
No related tags found
1 merge request!26Support 3689
......@@ -62,7 +62,7 @@ typedef struct PyDapChainDatum{
}PyDapChainDatumObject;
//void PyDapChainDatumObject_dealloc(PyDapChainDatumObject* object);
PyObject *DapChainDatumObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
PyObject *PyDapChainDatumObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
static PyTypeObject DapChainDatumObject_DapChainDatumObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
......@@ -103,7 +103,7 @@ static PyTypeObject DapChainDatumObject_DapChainDatumObjectType = {
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
DapChainDatumObject_new, /* tp_new */
PyDapChainDatumObject_new, /* tp_new */
};
/* -------------------------------- */
......
......@@ -66,11 +66,14 @@ PyObject *dap_chain_ledger_token_emission_find_py(PyObject *self, PyObject *args
return Py_BuildValue("O", &token_emission);
}
PyObject *dap_chain_ledger_tx_get_token_ticker_by_hash_py(PyObject *self, PyObject *args){
PyObject *obj_tx_hash;
if (!PyArg_ParseTuple(args, "O", &obj_tx_hash))
return NULL;
const char *res = dap_chain_ledger_tx_get_token_ticker_by_hash(((PyDapChainHashFastObject*)obj_tx_hash)->hash_fast);
return Py_BuildValue("s", res);
//TODO
//Missing implementation of dap_chain_ledger_tx_get_token_ticker_by_hash function in dap_chain_ledger
return NULL;
// PyObject *obj_tx_hash;
// if (!PyArg_ParseTuple(args, "O", &obj_tx_hash))
// return NULL;
// const char *res = dap_chain_ledger_tx_get_token_ticker_by_hash(((PyDapChainHashFastObject*)obj_tx_hash)->hash_fast);
// return Py_BuildValue("s", res);
}
PyObject *dap_chain_ledger_addr_get_token_ticker_all_py(PyObject *self, PyObject *args){
PyObject *obj_addr;
......@@ -118,19 +121,22 @@ PyObject *dap_chain_ledger_tx_cache_check_py(PyObject *self, PyObject *args){
return PyLong_FromLong(res);
}
PyObject *dap_chain_node_datum_tx_cache_check_py(PyObject *self, PyObject *args){
PyObject *obj_datum_tx;
PyObject *list_bound_items;
if (!PyArg_ParseTuple(args, "O|O", &obj_datum_tx, &list_bound_items))
return NULL;
Py_ssize_t size = PyList_Size(list_bound_items);
dap_list_t **bound_items = calloc(sizeof (dap_list_t**), (size_t)size);
for (int i = 0; i < size ; i++){
PyObject *obj = PyList_GetItem(list_bound_items, i);
dap_list_t *l = pyListToDapList(obj);
bound_items[i] = l;
}
int res = dap_chain_node_datum_tx_cache_check(((PyDapChainDatumTxObject*)obj_datum_tx)->datum_tx, bound_items);
return PyLong_FromLong(res);
//TODO
//Missing implementation of dap_chain_node_datum_tx_cache_check function in dap_chain_ledger
return NULL;
// PyObject *obj_datum_tx;
// PyObject *list_bound_items;
// if (!PyArg_ParseTuple(args, "O|O", &obj_datum_tx, &list_bound_items))
// return NULL;
// Py_ssize_t size = PyList_Size(list_bound_items);
// dap_list_t **bound_items = calloc(sizeof (dap_list_t**), (size_t)size);
// for (int i = 0; i < size ; i++){
// PyObject *obj = PyList_GetItem(list_bound_items, i);
// dap_list_t *l = pyListToDapList(obj);
// bound_items[i] = l;
// }
// int res = dap_chain_node_datum_tx_cache_check(((PyDapChainDatumTxObject*)obj_datum_tx)->datum_tx, bound_items);
// return PyLong_FromLong(res);
}
PyObject *dap_chain_ledger_tx_remove_py(PyObject *self, PyObject *args){
PyObject *obj_h_fast;
......
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