From e3af361b834fd735bc3d881edf51104204a7d675 Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Sat, 8 Jan 2022 15:21:01 +0700
Subject: [PATCH] [+] Added functions PyDapChainCellIdObject_str.

---
 .../cellframe-sdk/common/include/wrapping_dap_chain_common.h  | 4 +++-
 modules/cellframe-sdk/common/src/wrapping_dap_chain_common.c  | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/cellframe-sdk/common/include/wrapping_dap_chain_common.h b/modules/cellframe-sdk/common/include/wrapping_dap_chain_common.h
index d70c37d3..9f879c88 100644
--- a/modules/cellframe-sdk/common/include/wrapping_dap_chain_common.h
+++ b/modules/cellframe-sdk/common/include/wrapping_dap_chain_common.h
@@ -386,6 +386,8 @@ typedef struct PyDapChainCellID{
     dap_chain_cell_id_t cell_id;
 }PyDapChainCellIDObject;
 
+PyObject *PyDapChainCellIdObject_str(PyObject *self);
+
 static PyTypeObject DapChainCellIDObject_DapChainCellIDType = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "CellFrame.ChainCellID"  ,       /* tp_name */
@@ -402,7 +404,7 @@ static PyTypeObject DapChainCellIDObject_DapChainCellIDType = {
     0,                               /* tp_as_mapping */
     0,                               /* tp_hash  */
     0,                               /* tp_call */
-    0,                               /* tp_str */
+    PyDapChainCellIdObject_str,      /* tp_str */
     0,                               /* tp_getattro */
     0,                               /* tp_setattro */
     0,                               /* tp_as_buffer */
diff --git a/modules/cellframe-sdk/common/src/wrapping_dap_chain_common.c b/modules/cellframe-sdk/common/src/wrapping_dap_chain_common.c
index 44c2d0f0..07be296e 100644
--- a/modules/cellframe-sdk/common/src/wrapping_dap_chain_common.c
+++ b/modules/cellframe-sdk/common/src/wrapping_dap_chain_common.c
@@ -4,6 +4,10 @@ PyObject *DapChainIdObject_str(PyObject *self){
     return Py_BuildValue("s", dap_strdup_printf("0x%016"DAP_UINT64_FORMAT_x, ((PyDapChainIDObject*)self)->chain_id->uint64));
 }
 
+PyObject *PyDapChainCellIdObject_str(PyObject *self){
+    return Py_BuildValue("s", dap_strdup_printf("0x%016"DAP_UINT64_FORMAT_x, ((PyDapChainCellIDObject*)self)->cell_id.uint64));
+}
+
 PyObject *dap_chain_hash_slow_to_str_py(PyObject *self, PyObject *args){
     PyObject *obj_hash_slow;
     char *str;
-- 
GitLab