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

Merge branch 'support-3689' into 'master'

Support 3689

See merge request !26
parents c67dd84c 79ecc775
No related branches found
No related tags found
1 merge request!26Support 3689
Showing
with 1810 additions and 42 deletions
......@@ -2,42 +2,3 @@
path = cellframe-sdk
url = https://gitlab.demlabs.net/cellframe/cellframe-sdk
branch = master
[submodule "cellframe-sdk-python/libdap-chain-common-python"]
path = cellframe-sdk-python/libdap-chain-common-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-common-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-server-core-python"]
path = cellframe-sdk-python/libdap-server-core-python
url = https://gitlab.demlabs.net/cellframe/libdap-server-core-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-python"]
path = cellframe-sdk-python/libdap-python
url = https://gitlab.demlabs.net/cellframe/libdap-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-crypto-python"]
path = cellframe-sdk-python/libdap-crypto-python
url = https://gitlab.demlabs.net/cellframe/libdap-crypto-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-chain-python"]
path = cellframe-sdk-python/libdap-chain-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-chain-net-python"]
path = cellframe-sdk-python/libdap-chain-net-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-net-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-chain-gdb-python"]
path = cellframe-sdk-python/libdap-chain-gdb-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-gdb-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-client-python"]
path = cellframe-sdk-python/libdap-client-python
url = https://gitlab.demlabs.net/cellframe/libdap-client-python.git/
branch = master
[submodule "cellframe-sdk-python/libdap-app-cli-python"]
path = cellframe-sdk-python/libdap-app-cli-python
url = https://gitlab.demlabs.net/cellframe/libdap-app-cli-python.git
branch = master
[submodule "cellframe-sdk-python/libdap-chain-wallet-python"]
path = cellframe-sdk-python/libdap-chain-wallet-python
url = https://gitlab.demlabs.net/cellframe/libdap-chain-wallet-python.git
Subproject commit a974d1f228b82ba6471eb449d848f8c28368283e
project(dap_app_cli_python_module C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_C_STANDARD 11)
#set(SUBMODULES_NO_BUILD ON)
add_definitions("-fpic")
add_definitions("-DDAP_LOG_MT")
if(NOT (${SUBMODULES_NO_BUILD} MATCHES ON))
if (NOT (TARGET dap_core))
add_subdirectory(libdap)
target_compile_options(
dap_core PRIVATE
"-fpic"
)
endif()
endif()
file(GLOB APP_CLI_PYTHON_SRCS src/*.c)
file(GLOB APP_CLI_PYTHON_HEADERS include/*.h)
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
find_package (PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIR} include/)
add_library(${PROJECT_NAME} STATIC ${APP_CLI_PYTHON_SRCS} ${APP_CLI_PYTHON_HEADERS})
target_link_libraries(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} dap_core dap_app_cli )
target_include_directories(${PROJECT_NAME} PUBLIC include/ )
# libdap-chain-cli-python
#pragma once
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "dap_common.h"
#include "dap_app_cli.h"
#include "dap_strfuncs.h"
typedef struct PyAppCli{
PyObject_HEAD
}PyAppCliObject;
PyObject* dap_app_cli_main_py(PyObject *self, PyObject *args);
static PyMethodDef AppCliMethods[] = {
{"main", dap_app_cli_main_py, METH_VARARGS | METH_STATIC, "Main CLI function"},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapAppCli_dapAppCliType = {
PyVarObject_HEAD_INIT(NULL, 0)
"AppCli", /* tp_name */
sizeof(PyAppCliObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"AppCli object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
AppCliMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc*/
0, /* tp_bases*/
0, /* tp_mro */
0, /* tp_cache */
0, /* tp_subclasses */
0, /* tp_weaklist */
0, /* tp_del */
0, /* tp_version_tag*/
0, /* tp_finalize*/
};
#include "dap_common.h"
#include "libdap-app-cli-python.h"
#define LOG_TAG "libdap-app-cli-crypto"
/**
* @brief dap_app_cli_main_py
* @param self
* @param args
* @return
*/
PyObject* dap_app_cli_main_py(PyObject *self, PyObject *args)
{
(void) self;
char *l_app_name = NULL;
char *l_socket_path = NULL;
int l_argc = 0;
char **l_argv = NULL;
PyObject *l_argv_py = NULL;
PyObject *l_from_list_obj = NULL;
PyObject *l_value_obj = NULL;
if (!PyArg_ParseTuple(args, "ssO", &l_app_name, &l_socket_path, & l_argv_py))
return NULL;
Py_ssize_t l_argv_size_py = PyList_Size(l_argv_py);
l_argc = (int)l_argv_size_py;
if (l_argv_size_py > 1){
l_argv = PyMem_Calloc((size_t)l_argv_size_py, sizeof(char**));
for (Py_ssize_t i=0; i < l_argv_size_py; i++){
l_from_list_obj = PyList_GetItem(l_argv_py, i);
l_value_obj = PyList_GetItem(l_argv_py, i);
l_argv[i] = dap_strdup(PyUnicode_AsUTF8(l_value_obj));
}
int res = dap_app_cli_main(l_app_name, l_socket_path, l_argc, l_argv);
for (Py_ssize_t i=0; i < l_argv_size_py; i++){
DAP_FREE(l_argv[i]);
}
PyMem_Free(l_argv);
return PyLong_FromLong(res);
}
else
return PyLong_FromLong(-1024);
}
Subproject commit 97158dabda11b65023dfb13bb5ee229c05855cec
build/
*.user
project(dap_chain_common_python_module C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_C_STANDARD 11)
add_definitions("-fpic")
if(UNIX)
add_definitions("-DDAP_OS_UNIX")
endif()
if (NOT (${SUBMODULES_NO_BUILD} MATCHES ON))
set (SUBMODULES_NO_BUILD ON)
if (NOT (TARGET dap_core))
add_subdirectory(libdap)
target_compile_options(
dap_core PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_crypto))
add_subdirectory(libdap-crypto)
target_compile_options(
dap_crypto PRIVATE
"-fpic"
)
endif()
if (NOT (TARGET dap_chain_common))
add_subdirectory(libdap-chain-common)
target_compile_options(
dap_chain_common PRIVATE
"-fpic"
)
endif()
#if (NOT (TARGET dap_chain_coommon))
# add_subdirectory(libdap-chain-common)
# target_compile_options(
# dap_chain_common PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain))
# add_subdirectory(libdap-chain)
# target_compile_options(
# dap_chain PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_crypto))
# add_subdirectory(libdap-chain-crypto)
# target_compile_options(
# dap_chain_crypto PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_mempool))
# add_subdirectory(libdap-chain-mempool)
# target_compile_options(
# dap_chain_mempool PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_net))
# add_subdirectory(libdap-chain-net)
# target_compile_options(
# dap_chain_net PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_server_core))
# add_subdirectory(libdap-server-core)
# target_compile_options(
# dap_server_core PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_global_db))
# add_subdirectory(libdap-chain-global-db)
# target_compile_options(
# dap_chain_global_db PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_client))
# add_subdirectory(libdap-client)
# target_compile_options(
# dap_client PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET libdap-server))
# add_subdirectory(libdap-server)
# # target_compile_options(
# # libdap-server PRIVATE
# # "-fpic"
# # )
#endif()
#if (NOT (TARGET dap_stream))
# add_subdirectory(libdap-stream)
# target_compile_options(
# dap_stream PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_stream_ch))
# add_subdirectory(libdap-stream-ch)
# target_compile_options(
# dap_stream_ch PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_stream_ch_chain))
# add_subdirectory(libdap-stream-ch-chain)
# target_compile_options(
# dap_stream_ch_chain PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_stream_ch_chain_net))
# add_subdirectory(libdap-stream-ch-chain-net)
# target_compile_options(
# dap_stream_ch_chain_net PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_udp_server))
# add_subdirectory(libdap-server-udp)
# target_compile_options(
# dap_udp_server PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_wallet))
# add_subdirectory(libdap-chain-wallet)
# target_compile_options(
# dap_chain_wallet PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_net_srv))
# add_subdirectory(libdap-chain-net-srv)
# target_compile_options(
# dap_chain_net_srv PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_server_http_db_auth))
# add_subdirectory(libdap-server-http-db-auth)
# target_compile_options(
# dap_server_http_db_auth PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_chain_gdb))
# add_subdirectory(libdap-chain-gdb)
# target_compile_options(
# dap_chain_gdb PRIVATE
# "-fpic"
# )
#endif()
# if (NOT (TARGET dap_chain_net_srv_vpn))
# add_subdirectory(libdap-chain-net-srv-vpn)
# target_compile_options(
# dap_chain_net_srv_vpn PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET dap_server_http_db))
# add_subdirectory(libdap-server-http-db)
# target_compile_options(
# dap_server_http_db PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET (dap_python_module)))
# add_subdirectory(libdap-python)
# target_compile_options(
# dap_python_module PRIVATE
# "-fpic"
# )
#endif()
#if (NOT (TARGET (dap_chain_python_module)))
# add_subdirectory(libdap-chain-python)
# target_compile_options(
# dap_chain_python_module PRIVATE
# "-fpic"
# )
#endif()
if (NOT (TARGET (dap_crypto_python_module)))
add_subdirectory(libdap-crypto-python)
target_compile_options(
dap_crypto_python_module PRIVATE
"-fpic"
)
endif()
endif()
file(GLOB CHAIN_COMMON_PYTHON_SRCS src/*.c)
file(GLOB CHAIN_COMMON_PYTHON_HEADERS include/*.h)
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
find_package (PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIR} include/)
add_library(${PROJECT_NAME} STATIC ${CHAIN_COMMON_PYTHON_SRCS} ${CHAIN_COMMON_PYTHON_HEADERS})
target_link_libraries(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} dap_chain_common dap_core dap_crypto dap_crypto_python_module)
target_include_directories(${PROJECT_NAME} PUBLIC include/ )
# libdap-chain-common-python
#ifndef _WRAPPING_DAP_CHAIN_COMMON_
#define _WRAPPING_DAP_CHAIN_COMMON_
#include <Python.h>
#include "dap_chain_common.h"
#include "libdap_crypto_key_python.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Chain hash slow */
typedef struct PyDapChainHashSlow{
PyObject_HEAD
dap_chain_hash_slow_t *hash_slow;
}PyDapChainHashSlowObject;
PyObject *dap_chain_hash_slow_to_str_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainHashSlowMethod[] = {
{"toStr", (PyCFunction)dap_chain_hash_slow_to_str_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainHashSlowObject_DapChainHashSlowObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.HashSlow", /* tp_name */
sizeof(PyDapChainHashSlowObject),/* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain hash slow object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainHashSlowMethod, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain addr */
typedef struct PyDapChainAddr{
PyObject_HEAD
dap_chain_addr_t *addr;
}PyDapChainAddrObject;
PyObject *dap_chain_addr_to_str_py(PyObject *self, PyObject *args);
PyObject *dap_chain_addr_from_str_py(PyObject *self, PyObject *args);
PyObject *dap_chain_addr_fill_py(PyObject *self, PyObject *args);
PyObject *dap_chain_addr_check_sum_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainAddrMethods[] = {
{"toStr", (PyCFunction)dap_chain_addr_to_str_py, METH_VARARGS, ""},
{"fromStr", (PyCFunction)dap_chain_addr_from_str_py, METH_VARARGS | METH_STATIC, ""},
{"fill", (PyCFunction)dap_chain_addr_fill_py, METH_VARARGS, ""},
{"checkSum", (PyCFunction)dap_chain_addr_check_sum_py, METH_VARARGS, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainAddrObject_DapChainAddrObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Addr", /* tp_name */
sizeof(PyDapChainAddrObject),/* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain addr object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainAddrMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain net id */
typedef struct PyDapChainNetId{
PyObject_HEAD
dap_chain_net_id_t net_id;
}PyDapChainNetIdObject;
PyObject *dap_chain_net_id_from_str_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNetIdObjectMethods[] = {
{"fromStr", (PyCFunction)dap_chain_net_id_from_str_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNetIdObject_DapChainNetIdObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.NetID", /* tp_name */
sizeof(PyDapChainNetIdObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net id object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetIdObjectMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain net srv uid */
typedef struct PyDapChainNetSrvUID{
PyObject_HEAD
dap_chain_net_srv_uid_t net_srv_uid;
}PyDapChainNetSrvUIDObject;
PyObject *dap_chain_net_srv_uid_from_str_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainNetSrvUIDObject[] = {
{"fromStr", (PyCFunction)dap_chain_net_srv_uid_from_str_py, METH_VARARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainNetSrvUIDObject_DapChainNetSrvUIDObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainNetSrvUID", /* tp_name */
sizeof(dap_chain_net_srv_uid_t), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net srv uid object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainNetSrvUIDObject, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain net srv uid */
typedef struct PyDapChainNetSrvPriceUnitUID{
PyObject_HEAD
dap_chain_net_srv_price_unit_uid_t price_unit_uid;
}PyDapChainNetSrvPriceUnitUIDObject;
static PyTypeObject DapChainNetSrvPriceUnitUIDObject_DapChainNetSrvPriceUnitUIDObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainNetSrvPriceUnitUID", /* tp_name */
sizeof(PyDapChainNetSrvPriceUnitUIDObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain net srv price unit uid object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain cell id */
typedef struct PyDapChainID{
PyObject_HEAD
dap_chain_id_t *chain_id;
}PyDapChainIDObject;
static PyTypeObject DapChainIDObject_DapChainIDType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainID" , /* tp_name */
sizeof(PyDapChainIDObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain id object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain cell id */
typedef struct PyDapChainCellID{
PyObject_HEAD
dap_chain_cell_id_t cell_id;
}PyDapChainCellIDObject;
static PyTypeObject DapChainCellIDObject_DapChainCellIDType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainCellID" , /* tp_name */
sizeof(PyDapChainCellIDObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain cell id object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain cell id */
typedef struct PyDapChainNodeAddr{
PyObject_HEAD
dap_chain_node_addr_t *node_addr;
}PyDapChainNodeAddrObject;
static PyTypeObject DapChainNodeAddrObject_DapChainNodeAddrObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainNodeAddr" , /* tp_name */
sizeof(PyDapChainCellIDObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain node addr object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
/* Chain cell id */
typedef struct PyDapChainHashSlowKind{
PyObject_HEAD
dap_chain_hash_slow_kind_t *slow_kind;
}PyDapChainHashSlowKindObject;
static PyTypeObject DapChainSlowKindObject_DapChainSlowKindType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainSlowKind" , /* tp_name */
sizeof(PyDapChainHashSlowKindObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain slow kind object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/*=================*/
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_COMMON_
#ifndef _WRAPPING_DAP_CHAIN_DATUM_
#define _WRAPPING_DAP_CHAIN_DATUM_
#include "Python.h"
#include "dap_chain_datum.h"
#ifdef __cplusplus
extern "C" {
#endif
/* DAP Chain datum type id */
typedef struct PyDapChainDatumTypeId{
PyObject_HEAD
dap_chain_datum_typeid_t *type_id;
}PyDapChainDatumTypeIdObject;
static PyTypeObject DapChainDatumTypeIdObject_DapChainDatumTypeIdObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumTypeId", /* tp_name */
sizeof(PyDapChainDatumTypeIdObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum type id object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------- */
typedef struct PyDapChainDatum{
PyObject_HEAD
dap_chain_datum_t *datum;
}PyDapChainDatumObject;
//void PyDapChainDatumObject_dealloc(PyDapChainDatumObject* object);
PyObject *PyDapChainDatumObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
PyObject *dap_chain_datum_size_py(PyObject *self, PyObject *args);
static PyMethodDef DapChainDatumMethods[] = {
{"size", dap_chain_datum_size_py, METH_VARARGS, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainDatumObject_DapChainDatumObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.Datum", /* tp_name */
sizeof(PyDapChainDatumObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyDapChainDatumObject_new, /* tp_new */
};
/* -------------------------------- */
/* DAP Chain datum iter*/
typedef struct PyDapChainDatumIter{
PyObject_HEAD
dap_chain_datum_iter_t *datum_iter;
}PyDapChainDatumIterObject;
static PyTypeObject DapChainDatumIterObject_DapChainDatumIterObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumIter", /* tp_name */
sizeof(PyDapChainDatumIterObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum iter object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------- */
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_DATUM_
#ifndef _WRAPPING_DAP_CHAIN_DATUM_HASHTREE_ROOTS_
#define _WRAPPING_DAP_CHAIN_DATUM_HASHTREE_ROOTS_
#include <Python.h>
typedef struct PyDapChainBlockRootsV1{
PyObject_HEAD
}PyDapChainBlockRootsV1Object;
static PyTypeObject DapChainBlockRootsV1Object_DapChainBlockRootsV1Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainBlockRootsV1Object", /* tp_name */
sizeof(PyDapChainBlockRootsV1Object), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain block roots v1 object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
typedef struct PyDapChainBlockRootsV2{
PyObject_HEAD
}PyDapChainBlockRootsV2Object;
static PyTypeObject DapChainBlockRootsV2Object_DapChainBlockRootsV2Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainBlockRootsV2Object", /* tp_name */
sizeof(PyDapChainBlockRootsV2Object), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain block roots v2 object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#endif //_WRAPPING_DAP_CHAIN_DATUM_HASHTREE_ROOTS_
#ifndef _WRAPPING_DAP_CHAIN_DATUM_TOKEN_
#define _WRAPPING_DAP_CHAIN_DATUM_TOKEN_
#include "Python.h"
#include "dap_chain_datum_token.h"
#ifdef __cplusplus
extern "C" {
#endif
/* DAP chain datum token */
typedef struct PyDapChainDatumToken{
PyObject_HEAD
dap_chain_datum_token_t *token;
}PyDapChainDatumTokenObject;
static PyTypeObject DapChainDatumToken_DapChainDatumTokenObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumTokenObject", /* tp_name */
sizeof(PyDapChainDatumTokenObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum token object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* ------------------------------------------- */
/* DAP chain datum token emission */
typedef struct PyDapChainDatumTokenEmission{
PyObject_HEAD
dap_chain_datum_token_emission_t *token_emission;
}PyDapChainDatumTokenEmissionObject;
static PyTypeObject DapChainDatumTokenEmission_DapChainDatumTokenEmissionObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumTokenEmission", /* tp_name */
sizeof(PyDapChainDatumTokenEmissionObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum token emission object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* ------------------------------------------- */
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_DATUM_TOKEN_
#ifndef _WRAPPING_DAP_CHAIN_DATUM_TX_
#define _WRAPPING_DAP_CHAIN_DATUM_TX_
#include "Python.h"
#include "wrapping_dap_chain_common.h"
#include "libdap_crypto_key_python.h"
#include "dap_chain_datum_tx_out_cond.h"
#include "wrapping_dap_hash.h"
#include "dap_chain_datum_tx_items.h"
#ifdef __cplusplus
extern "C" {
#endif
/* DAP chain tx iter type */
typedef struct PyDapChainTxItemType{
PyObject_HEAD
}PyDapChainTxItemTypeObject;
PyObject *TX_ITEM_TYPE_IN_PY(void);
PyObject *TX_ITEM_TYPE_OUT_PY(void);
PyObject *TX_ITEM_TYPE_PKEY_PY(void);
PyObject *TX_ITEM_TYPE_SIG_PY(void);
PyObject *TX_ITEM_TYPE_TOKEN_PY(void);
PyObject *TX_ITEM_TYPE_IN_COND_PY(void);
PyObject *TX_ITEM_TYPE_OUT_COND_PY(void);
PyObject *TX_ITEM_TYPE_RECEIPT_PY(void);
static PyMethodDef PyDapChainTxItemTypeObjectMethods[] ={
{"TX_ITEM_TYPE_IN", (PyCFunction)TX_ITEM_TYPE_IN_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_OUT", (PyCFunction)TX_ITEM_TYPE_OUT_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_PKEY", (PyCFunction)TX_ITEM_TYPE_PKEY_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_SIG", (PyCFunction)TX_ITEM_TYPE_SIG_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_TOKEN", (PyCFunction)TX_ITEM_TYPE_TOKEN_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_IN_COND", (PyCFunction)TX_ITEM_TYPE_IN_COND_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_OUT_COND", (PyCFunction)TX_ITEM_TYPE_OUT_COND_PY, METH_NOARGS | METH_STATIC, ""},
{"TX_ITEM_TYPE_RECEIPT", (PyCFunction)TX_ITEM_TYPE_RECEIPT_PY,
METH_NOARGS | METH_STATIC, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainTxItemObject_DapChainTxItemTypeObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.TxItemType", /* tp_name */
sizeof(PyDapChainTxItemTypeObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain tx item type object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
PyDapChainTxItemTypeObjectMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------------- */
/* DAP chain tx cond type */
typedef struct PyDapChainTxCondType{
PyObject_HEAD
dap_chain_tx_cond_type_t tx_cond_type_t;
}PyDapChainTxCondTypeObject;
PyObject *COND_SERVICE_PROVIDE_PY();
PyObject *COND_SERVICE_BILL_PY();
static PyMethodDef DapChainTxCondTypeMethods[] = {
{"COND_SERVICE_PROVIDE", COND_SERVICE_PROVIDE_PY, METH_NOARGS | METH_STATIC, ""},
{"COND_SERVICE_BILL", COND_SERVICE_BILL_PY, METH_NOARGS | METH_STATIC, ""},
{NULL, NULL,0, NULL}
};
static PyTypeObject DapChainTxCondType_DapChainTxCondTypeObject = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.TxCondType", /* tp_name */
sizeof(PyDapChainTxCondTypeObject),/* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain tx cond type object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
DapChainTxCondTypeMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------------- */
/* DAP chain datum tx */
typedef struct PyDapChainDatumTx{
PyObject_HEAD
dap_chain_datum_tx_t *datum_tx;
}PyDapChainDatumTxObject;
PyObject *PyDapChainDatumTxObject_create(PyTypeObject *type_object, PyObject *args, PyObject *kwds);
void PyDapChainDatumTxObject_delete(PyDapChainDatumTxObject* datumTx);
PyObject *dap_chain_datum_tx_get_size_py(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_tx_add_item_py(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_tx_add_in_item_py(PyObject *self, PyObject *args);
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_cond_item_py(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_tx_add_sign_item_py(PyObject *self, PyObject *args);
PyObject *dap_chain_datum_tx_verify_sign_py(PyObject *self, PyObject *args);
static PyMethodDef PyDapChainDatumTxObjectMethods[] ={
{"getSize", (PyCFunction)dap_chain_datum_tx_get_size_py, METH_VARARGS, ""},
{"addItem", (PyCFunction)dap_chain_datum_tx_add_item_py, METH_VARARGS, ""},
{"addInItem", (PyCFunction)dap_chain_datum_tx_add_in_item_py, METH_VARARGS, ""},
{"addInCondItem", (PyCFunction)dap_chain_datum_tx_add_in_cond_item_py, METH_VARARGS, ""},
{"addOutItem", (PyCFunction)dap_chain_datum_tx_add_out_item_py, METH_VARARGS, ""},
{"addOutCond", (PyCFunction)dap_chain_datum_tx_add_out_cond_item_py, METH_VARARGS, ""},
{"addSignItem", (PyCFunction)dap_chain_datum_tx_add_sign_item_py, METH_VARARGS, ""},
{"verifySign", (PyCFunction)dap_chain_datum_tx_verify_sign_py, METH_VARARGS, ""},
{NULL, NULL, 0, NULL}
};
static PyTypeObject DapChainDatumTx_DapChainDatumTxObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.DatumTx", /* tp_name */
sizeof(PyDapChainDatumTxObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)PyDapChainDatumTxObject_delete, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain datum tx object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
PyDapChainDatumTxObjectMethods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyDapChainDatumTxObject_create, /* tp_new */
};
/* -------------------------------------- */
typedef struct PyDapChainTxOutCond{
PyObject_HEAD
dap_chain_tx_out_cond_t *out_cond;
}PyDapChainTxOutCondObject;
static PyTypeObject DapChainTxOutCond_DapChainTxOutCondObjectType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.Chain.TxOutCond", /* tp_name */
sizeof(PyDapChainTxOutCondObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain tx out cond object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
/* -------------------------------------- */
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_DATUM_TX_
#ifndef _WRAPPING_DAP_CHAIN_TX_TOKEN_
#define _WRAPPING_DAP_CHAIN_TX_TOKEN_
#include <Python.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PyDapChainTxToken{
PyObject_HEAD
}PyDapChainTxTokenObject;
static PyTypeObject DapChainTxToken_DapChainTxTokenType = {
PyVarObject_HEAD_INIT(NULL, 0)
"CellFrame.ChainTxToken", /* tp_name */
sizeof(PyDapChainTxTokenObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT |
Py_TPFLAGS_BASETYPE, /* tp_flags */
"Chain tx token object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
PyType_GenericNew, /* tp_new */
};
#ifdef __cplusplus
}
#endif
#endif //_WRAPPING_DAP_CHAIN_TX_TOKEN_
#include "wrapping_dap_chain_common.h"
PyObject *dap_chain_hash_slow_to_str_py(PyObject *self, PyObject *args){
PyObject *obj_hash_slow;
char *str;
size_t str_max;
if (!PyArg_ParseTuple(args, "O|s|n", &obj_hash_slow, &str, &str_max))
return NULL;
size_t res = dap_chain_hash_slow_to_str(((PyDapChainHashSlowObject*)obj_hash_slow)->hash_slow, str, str_max);
return Py_BuildValue("ns", res, str_max);
}
PyObject *dap_chain_addr_to_str_py(PyObject *self, PyObject *args){
PyObject *obj_chain_addr;
if (!PyArg_ParseTuple(args, "O", &obj_chain_addr))
return NULL;
const dap_chain_addr_t *addr = ((PyDapChainAddrObject*)obj_chain_addr)->addr;
char *res = dap_chain_addr_to_str(addr);
return Py_BuildValue("s", res);
}
PyObject *dap_chain_addr_from_str_py(PyObject *self, PyObject *args){
const char *str;
if (!PyArg_ParseTuple(args, "s", &str))
return NULL;
PyObject *obj = _PyObject_New(&DapChainAddrObject_DapChainAddrObjectType);
((PyDapChainAddrObject*)obj)->addr = dap_chain_addr_from_str(str);
return Py_BuildValue("O", obj);
}
PyObject *dap_chain_addr_fill_py(PyObject *self, PyObject *args){
PyObject *key;
PyObject *net_id;
if (!PyArg_ParseTuple(args, "O|O", &key, &net_id))
return NULL;
dap_chain_addr_fill(((PyDapChainAddrObject*)self)->addr, ((PyCryptoKeyObject*)key)->key, &(((PyDapChainNetIdObject*)net_id)->net_id));
return self;
}
PyObject *dap_chain_addr_check_sum_py(PyObject *self, PyObject *args){
int res = dap_chain_addr_check_sum(((PyDapChainAddrObject*)self)->addr);
return PyLong_FromLong(res);
}
PyObject *dap_chain_net_id_from_str_py(PyObject *self, PyObject *args){
const char *str;
if (!PyArg_ParseTuple(args, "s", &str))
return NULL;
PyObject *obj_net_id = _PyObject_New(&DapChainNetIdObject_DapChainNetIdObjectType);
((PyDapChainNetIdObject*)obj_net_id)->net_id = dap_chain_net_id_from_str(str);
return Py_BuildValue("O", obj_net_id);
}
PyObject *dap_chain_net_srv_uid_from_str_py(PyObject *self, PyObject *args){
const char *str;
if (!PyArg_ParseTuple(args, "s", &str))
return NULL;
PyObject *obj = _PyObject_New(&DapChainNetSrvUIDObject_DapChainNetSrvUIDObjectType);
((PyDapChainNetSrvUIDObject*)obj)->net_srv_uid = dap_chain_net_srv_uid_from_str(str);
return Py_BuildValue("O", obj);
}
#include "wrapping_dap_chain_datum.h"
//void PyDapChainDatumObject_dealloc(PyDapChainDatumObject* object){
//}
PyObject *PyDapChainDatumObject_new(PyTypeObject *type_object, PyObject *args, PyObject *kwds){
uint16_t type_id;
PyBytesObject *bytes;
size_t data_size;
if (!PyArg_ParseTuple(args, "H|S|n", &type_id, &bytes, &data_size))
return NULL;
PyDapChainDatumObject *obj = (PyDapChainDatumObject*)PyType_GenericNew(type_object, args, kwds);
void* bytes_v = (void *)PyBytes_AsString((PyObject*)bytes);
obj->datum = dap_chain_datum_create(type_id, bytes_v, data_size);
return (PyObject *)obj;
}
PyObject *dap_chain_datum_size_py(PyObject *self, PyObject *args){
size_t size = dap_chain_datum_size(((PyDapChainDatumObject*)self)->datum);
return PyLong_FromSize_t(size);
}
#include "wrapping_dap_chain_datum_tx.h"
/* DAP chain tx iter type */
PyObject *TX_ITEM_TYPE_IN_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_IN);
}
PyObject *TX_ITEM_TYPE_OUT_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_OUT);
}
PyObject *TX_ITEM_TYPE_PKEY_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_PKEY);
}
PyObject *TX_ITEM_TYPE_SIG_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_SIG);
}
PyObject *TX_ITEM_TYPE_TOKEN_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_TOKEN);
}
PyObject *TX_ITEM_TYPE_IN_COND_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_IN_COND);
}
PyObject *TX_ITEM_TYPE_OUT_COND_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_OUT_COND);
}
PyObject *TX_ITEM_TYPE_RECEIPT_PY(void){
return PyLong_FromLong(TX_ITEM_TYPE_RECEIPT);
}
/* -------------------------------------- */
/* DAP chain tx cond type */
PyObject *COND_SERVICE_PROVIDE_PY(){
PyObject *obj = _PyObject_New(&DapChainTxCondType_DapChainTxCondTypeObject);
((PyDapChainTxCondTypeObject*)obj)->tx_cond_type_t = COND_SERVICE_PROVIDE;
return Py_BuildValue("O", obj);
}
PyObject *COND_SERVICE_BILL_PY(){
PyObject *obj = _PyObject_New(&DapChainTxCondType_DapChainTxCondTypeObject);
((PyDapChainTxCondTypeObject*)obj)->tx_cond_type_t = COND_SERVICE_BILL;
return Py_BuildValue("O", obj);
}
/* -------------------------------------- */
/* DAP chain datum tx */
PyObject *PyDapChainDatumTxObject_create(PyTypeObject *type_object, PyObject *args, PyObject *kwds){
PyDapChainDatumTxObject *obj = (PyDapChainDatumTxObject*)PyType_GenericNew(type_object, args, kwds);
obj->datum_tx = dap_chain_datum_tx_create();
return (PyObject *)obj;
}
void PyDapChainDatumTxObject_delete(PyDapChainDatumTxObject* datumTx){
dap_chain_datum_tx_delete(datumTx->datum_tx);
Py_TYPE(datumTx)->tp_free((PyObject*)datumTx);
}
PyObject *dap_chain_datum_tx_get_size_py(PyObject *self, PyObject *args){
(void)args;
size_t size = dap_chain_datum_tx_get_size(((PyDapChainDatumTxObject*)self)->datum_tx);
return PyLong_FromSize_t(size);
}
PyObject *dap_chain_datum_tx_add_item_py(PyObject *self, PyObject *args){
uint8_t *a_item;
if (!PyArg_ParseTuple(args, "b", &a_item))
return NULL;
int res = dap_chain_datum_tx_add_item(&(((PyDapChainDatumTxObject*)self)->datum_tx), a_item);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_add_in_item_py(PyObject *self, PyObject *args){
PyObject *in_obj_hash_fast;
uint32_t in_tx_out_pref_idx;
if (!PyArg_ParseTuple(args, "O|I", &in_obj_hash_fast, &in_tx_out_pref_idx))
return NULL;
int res = dap_chain_datum_tx_add_in_item(&(((PyDapChainDatumTxObject*)self)->datum_tx),
((PyDapHashFastObject*)in_obj_hash_fast)->hash_fast,
in_tx_out_pref_idx);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_add_in_cond_item_py(PyObject *self, PyObject *args){
PyObject *in_chain_hash_fast;
unsigned int in_tx_out_prev_idx;
unsigned int in_receipt_idx;
if (!PyArg_ParseTuple(args, "O|I|I", &in_chain_hash_fast, &in_tx_out_prev_idx, &in_receipt_idx))
return NULL;
int res = dap_chain_datum_tx_add_in_cond_item(&(((PyDapChainDatumTxObject*)self)->datum_tx),
((PyDapHashFastObject*)in_chain_hash_fast)->hash_fast,
in_tx_out_prev_idx,
in_receipt_idx);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_add_out_item_py(PyObject *self, PyObject *args){
PyObject *in_addr;
uint64_t value;
if (!PyArg_ParseTuple(args, "O|k", &in_addr, &value))
return NULL;
int res = dap_chain_datum_tx_add_out_item(&(((PyDapChainDatumTxObject*)self)->datum_tx),
((PyDapChainAddrObject*)in_addr)->addr,
value);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_add_out_cond_item_py(PyObject *self, PyObject *args){
PyObject *obj_key;
PyObject *obj_srv_uid;
uint64_t value;
uint64_t value_max_per_unit;
PyObject *obj_srv_price_unit_uid;
PyObject *obj_cond_bytes;
Py_ssize_t cond_size;
if (!PyArg_ParseTuple(args, "O|O|k|k|O|O|n", &obj_key, &obj_srv_uid, &value, &value_max_per_unit,
&obj_srv_price_unit_uid, &obj_cond_bytes, &cond_size))
return NULL;
void *cond = (void*)PyBytes_AsString(obj_cond_bytes);
int res = dap_chain_datum_tx_add_out_cond_item(&(((PyDapChainDatumTxObject*)self)->datum_tx),
((PyCryptoKeyObject*)obj_key)->key,
((PyDapChainNetSrvUIDObject*)obj_srv_uid)->net_srv_uid,
value, value_max_per_unit,
((PyDapChainNetSrvPriceUnitUIDObject*)obj_srv_price_unit_uid)->price_unit_uid,
cond, (size_t)cond_size);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_add_sign_item_py(PyObject *self, PyObject *args){
PyObject *obj_key;
if (!PyArg_ParseTuple(args, "O", &obj_key))
return NULL;
int res = dap_chain_datum_tx_add_sign_item(&(((PyDapChainDatumTxObject*)self)->datum_tx),
((PyCryptoKeyObject*)obj_key)->key);
return PyLong_FromLong(res);
}
PyObject *dap_chain_datum_tx_verify_sign_py(PyObject *self, PyObject *args){
(void)args;
int res = dap_chain_datum_tx_verify_sign(((PyDapChainDatumTxObject*)self)->datum_tx);
return PyLong_FromLong(res);
}
/* -------------------------------------- */
Subproject commit 510c499d547f0457e1ec9e7a109e3716a0f2e415
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