Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-cellframe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
python-cellframe
Commits
b8d780b3
Commit
b8d780b3
authored
4 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Patches
Plain Diff
[-] Removed unnecessary comments.
parent
3adc7bde
No related branches found
Branches containing commit
No related tags found
1 merge request
!26
Support 3689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/wrapping_dap_chain_datum_tx.h
+0
-19
0 additions, 19 deletions
include/wrapping_dap_chain_datum_tx.h
src/wrapping_dap_chain_datum_tx.c
+0
-55
0 additions, 55 deletions
src/wrapping_dap_chain_datum_tx.c
with
0 additions
and
74 deletions
include/wrapping_dap_chain_datum_tx.h
+
0
−
19
View file @
b8d780b3
...
...
@@ -159,9 +159,6 @@ 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 dap_chain_datum_tx_t **PyListToDapChainDatumTxArray(PyObject *a_in_obj);
//static PyObject* DapChainDatumTxArrayToPyList(dap_chain_datum_tx_t** datum_txs);
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
,
""
},
...
...
@@ -174,19 +171,6 @@ static PyMethodDef PyDapChainDatumTxObjectMethods[] ={
{
NULL
,
NULL
,
0
,
NULL
}
};
//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 | METH_STATIC, ""},
// {"addInItem", (PyCFunction)dap_chain_datum_tx_add_in_item_py, METH_VARARGS | METH_STATIC, ""},
// {"addInCondItem", (PyCFunction)dap_chain_datum_tx_add_in_cond_item_py, METH_VARARGS | METH_STATIC, ""},
// {"addOutItem", (PyCFunction)dap_chain_datum_tx_add_out_item_py, METH_VARARGS | METH_STATIC, ""},
// {"addOutCond", (PyCFunction)dap_chain_datum_tx_add_out_cond_item_py, METH_VARARGS | METH_STATIC, ""},
// {"addSignItem", (PyCFunction)dap_chain_datum_tx_add_sign_item_py, METH_VARARGS | METH_STATIC, ""},
// {"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 */
...
...
@@ -278,9 +262,6 @@ static PyTypeObject DapChainTxOutCond_DapChainTxOutCondObjectType = {
PyType_GenericNew
,
/* tp_new */
};
//dap_chain_tx_out_cond_t **PyListToDapChainTxOutCond(PyObject *list);
//PyObject *DapChainTxOutCondObjectToPyList(dap_chain_tx_out_cond_t **out_cond);
/* -------------------------------------- */
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
src/wrapping_dap_chain_datum_tx.c
+
0
−
55
View file @
b8d780b3
...
...
@@ -64,12 +64,6 @@ PyObject *dap_chain_datum_tx_add_item_py(PyObject *self, PyObject *args){
return
NULL
;
int
res
=
dap_chain_datum_tx_add_item
(
&
(((
PyDapChainDatumTxObject
*
)
self
)
->
datum_tx
),
a_item
);
return
PyLong_FromLong
(
res
);
// if (res == -1){
// return NULL;
// } else {
// PyObject *out = DapChainDatumTxArrayToPyList(txs);
// return Py_BuildValue("O", out);
// }
}
PyObject
*
dap_chain_datum_tx_add_in_item_py
(
PyObject
*
self
,
PyObject
*
args
){
PyObject
*
in_obj_hash_fast
;
...
...
@@ -83,13 +77,11 @@ 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 *in_obj_datum_txs;
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
;
// dap_chain_datum_tx_t **a_txs = PyListToDapChainDatumTxArray(in_obj_datum_txs);
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
,
...
...
@@ -98,19 +90,16 @@ 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 *in_obj_datum_txs;
PyObject
*
in_addr
;
uint64_t
value
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|k"
,
&
in_addr
,
&
value
))
return
NULL
;
// dap_chain_datum_tx_t **txs = PyListToDapChainDatumTxArray(in_obj_datum_txs);
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_txs;
PyObject
*
obj_key
;
PyObject
*
obj_srv_uid
;
uint64_t
value
;
...
...
@@ -121,7 +110,6 @@ PyObject *dap_chain_datum_tx_add_out_cond_item_py(PyObject *self, PyObject *args
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
;
// dap_chain_datum_tx_t **txs = PyListToDapChainDatumTxArray(obj_txs);
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
,
...
...
@@ -132,11 +120,9 @@ PyObject *dap_chain_datum_tx_add_out_cond_item_py(PyObject *self, PyObject *args
return
PyLong_FromLong
(
res
);
}
PyObject
*
dap_chain_datum_tx_add_sign_item_py
(
PyObject
*
self
,
PyObject
*
args
){
// PyObject *obj_txs;
PyObject
*
obj_key
;
if
(
!
PyArg_ParseTuple
(
args
,
"O"
,
&
obj_key
))
return
NULL
;
// dap_chain_datum_tx_t **txs = PyListToDapChainDatumTxArray(obj_txs);
int
res
=
dap_chain_datum_tx_add_sign_item
(
&
(((
PyDapChainDatumTxObject
*
)
self
)
->
datum_tx
),
((
PyCryptoKeyObject
*
)
obj_key
)
->
key
);
return
PyLong_FromLong
(
res
);
...
...
@@ -147,45 +133,4 @@ PyObject *dap_chain_datum_tx_verify_sign_py(PyObject *self, PyObject *args){
return
PyLong_FromLong
(
res
);
}
//static dap_chain_datum_tx_t **PyListToDapChainDatumTxArray(PyObject *a_in_obj){
// Py_ssize_t size = PyList_Size(a_in_obj);
// dap_chain_datum_tx_t **txs = calloc(sizeof(dap_chain_datum_tx_t), (size_t)size);
// for (Py_ssize_t i = 0; i < size;i++){
// txs[i] = ((PyDapChainDatumTxObject*)PyList_GetItem(a_in_obj, i))->datum_tx;
// }
// return txs;
//}
//static PyObject* DapChainDatumTxArrayToPyList(dap_chain_datum_tx_t** datum_txs){
//// size_t len = sizeof(datum_txs) / sizeof(*datum_txs);
//// size_t len = dap_chain_datum_item_tx_get_size(datum_txs);
// PyObject* list = PyList_New((Py_ssize_t)len);
// for (size_t i=0; i < len; i++){
// PyObject *obj = _PyObject_New(&DapChainDatumTx_DapChainDatumTxObjectType);
// ((PyDapChainDatumTxObject*)obj)->datum_tx = datum_txs[i];
// PyList_Append(list, obj);
// }
// return list;
//}
//dap_chain_tx_out_cond_t **PyListToDapChainTxOutCond(PyObject *list){
// Py_ssize_t size = PyList_Size(list);
// dap_chain_tx_out_cond_t **out_conds = calloc(sizeof(dap_chain_tx_out_cond_t), (size_t)size);
// for (Py_ssize_t i=0; i < size; i++){
// out_conds[i] = ((PyDapChainTxOutCondObject*)PyList_GetItem(list, i))->out_cond;
// }
// return out_conds;
//}
//PyObject *DapChainTxOutCondObjectToPyList(dap_chain_tx_out_cond_t **out_cond){
// size_t len = sizeof(out_cond) / sizeof(*out_cond);
// PyObject *list = PyList_New((Py_ssize_t)len);
// for (size_t i=0; i< len;i++ ){
// PyObject *obj = _PyObject_New(&DapChainTxOutCond_DapChainTxOutCondObjectType);
// ((PyDapChainTxOutCondObject*)obj)->out_cond = out_cond[i];
// PyList_Append(list, obj);
// }
// return list;
//}
/* -------------------------------------- */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment