From a6dc67d43ae7b072c9f97fa743b75d99f316be79 Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Fri, 6 Dec 2019 22:09:33 +0700
Subject: [PATCH] [+] Added integration with libdap-chain-net-python library.

---
 include/python-cellframe.h |  8 ++++++++
 src/python-cellframe.c     | 18 +++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/include/python-cellframe.h b/include/python-cellframe.h
index cc02a5fb..69e90ba4 100644
--- a/include/python-cellframe.h
+++ b/include/python-cellframe.h
@@ -18,6 +18,14 @@
 #include "wrapping_dap_chain_datum_tx.h"
 #include "wrapping_dap_chain_ledger.h"
 // ============
+// === Chain net ===
+#include "libdap_chain_net_python.h"
+#include "wrapping_dap_chain_net_node.h"
+#include "wrapping_dap_chain_net_node_cli.h"
+#include "wrapping_dap_chain_net_node_client.h"
+#include "wrapping_dap_chain_net_node_info.h"
+#include "wrapping_dap_chain_net_state.h"
+// ============
 #include "dap_common.h"
 
 
diff --git a/src/python-cellframe.c b/src/python-cellframe.c
index 5e525c79..432eab7d 100644
--- a/src/python-cellframe.c
+++ b/src/python-cellframe.c
@@ -143,7 +143,15 @@ PyMODINIT_FUNC PyInit_CellFrame(void){
             PyType_Ready(&DapChainTxType_DapChainTxCondTypeObject) < 0 ||
             PyType_Ready(&DapChainDatumTx_DapChainDatumTxObjectType) < 0 ||
             PyType_Ready(&DapChainTxOutCond_DapChainTxOutCondObjectType) < 0 ||
-            PyType_Ready(&DapChainLedger_DapChainLedgerType) < 0
+            PyType_Ready(&DapChainLedger_DapChainLedgerType) < 0 ||
+            // =============
+            // === Chain net ===
+            PyType_Ready(&DapChainNetObject_DapChainNetObjectType) < 0 ||
+            PyType_Ready(&DapChainNodeCliObject_DapChainNodeCliObjectType) < 0 ||
+            PyType_Ready(&DapChainNodeClientObject_DapChainNodeClientObjectType) < 0 ||
+            PyType_Ready(&DapChainNodeInfoObject_DapChainNodeInfoObjectType) < 0 ||
+            PyType_Ready(&DapChainNetNodeObject_DapChainNetNodeObjectType) < 0 ||
+            PyType_Ready(&DapChainNetStateObject_DapChainNetStateObjectType) < 0
             // =============
             )
                return NULL;
@@ -199,6 +207,14 @@ PyMODINIT_FUNC PyInit_CellFrame(void){
     PyModule_AddObject(module, "ChainTxOutCond", (PyObject*)&DapChainTxOutCond_DapChainTxOutCondObjectType);
     PyModule_AddObject(module, "ChainLedger", (PyObject*)&DapChainLedger_DapChainLedgerType);
     // =============
+    // === Chain net ===
+    PyModule_AddObject(module, "ChainNet", (PyObject*)&DapChainNetObject_DapChainNetObjectType);
+    PyModule_AddObject(module, "ChainNodeCLI", (PyObject*)&DapChainNodeCliObject_DapChainNodeCliObjectType);
+    PyModule_AddObject(module, "ChainNodeClient", (PyObject*)&DapChainNodeClientObject_DapChainNodeClientObjectType);
+    PyModule_AddObject(module, "ChainNodeInfo", (PyObject*)&DapChainNodeInfoObject_DapChainNodeInfoObjectType);
+    PyModule_AddObject(module, "ChainNetNode", (PyObject*)&DapChainNetNodeObject_DapChainNetNodeObjectType);
+    PyModule_AddObject(module, "ChainNetState", (PyObject*)&DapChainNetStateObject_DapChainNetStateObjectType);
+    // =============
 
 
     return module;
-- 
GitLab