Skip to content
Snippets Groups Projects
Commit 7c3af121 authored by Dmitry Puzyrkov's avatar Dmitry Puzyrkov
Browse files

Merge branch 'feature-16344' into 'master'

Feature 16344

See merge request !451
parents 19d28d3f efeb8cc7
No related branches found
No related tags found
1 merge request!451Feature 16344
...@@ -172,6 +172,8 @@ class TxOutCond(Protocol): ...@@ -172,6 +172,8 @@ class TxOutCond(Protocol):
def typeSubtype(self) -> ChainTxOutCondSubType: ... def typeSubtype(self) -> ChainTxOutCondSubType: ...
@property @property
def usedBy(self) -> HashFast | None: ... def usedBy(self) -> HashFast | None: ...
@property
def tag(self) -> str | None: ...
# DapChainTxOutCondSubTypeSrvPayObjectType # DapChainTxOutCondSubTypeSrvPayObjectType
......
...@@ -50,6 +50,7 @@ PyObject *wrapping_dap_chain_tx_out_cond_get_value(PyObject *self, void *closure ...@@ -50,6 +50,7 @@ PyObject *wrapping_dap_chain_tx_out_cond_get_value(PyObject *self, void *closure
PyObject *wrapping_dap_chain_tx_out_cond_get_type_subtype(PyObject *self, void *closure); PyObject *wrapping_dap_chain_tx_out_cond_get_type_subtype(PyObject *self, void *closure);
PyObject *wrapping_dap_chain_tx_out_cond_get_subtype(PyObject *self, void *closure); PyObject *wrapping_dap_chain_tx_out_cond_get_subtype(PyObject *self, void *closure);
PyObject *wrapping_dap_chain_tx_out_cound_used_by(PyObject *self, void *closure); PyObject *wrapping_dap_chain_tx_out_cound_used_by(PyObject *self, void *closure);
PyObject *wrapping_dap_chain_tx_out_cond_get_tag(PyObject *self, void *closure);
extern PyTypeObject DapChainTxOutCondObjectType; extern PyTypeObject DapChainTxOutCondObjectType;
......
...@@ -8,6 +8,8 @@ static PyGetSetDef PyDapChainTxOutCondGetsSetsDef[] = { ...@@ -8,6 +8,8 @@ static PyGetSetDef PyDapChainTxOutCondGetsSetsDef[] = {
{"typeSubtype", (getter)wrapping_dap_chain_tx_out_cond_get_type_subtype, NULL, "", NULL}, {"typeSubtype", (getter)wrapping_dap_chain_tx_out_cond_get_type_subtype, NULL, "", NULL},
{"subtype", (getter)wrapping_dap_chain_tx_out_cond_get_subtype, NULL, "", NULL}, {"subtype", (getter)wrapping_dap_chain_tx_out_cond_get_subtype, NULL, "", NULL},
{"usedBy", (getter)wrapping_dap_chain_tx_out_cound_used_by, NULL, "", NULL}, {"usedBy", (getter)wrapping_dap_chain_tx_out_cound_used_by, NULL, "", NULL},
{"tag", (getter)wrapping_dap_chain_tx_out_cond_get_tag, NULL,
"Return TSD tag if present, else None", NULL},
{} {}
}; };
...@@ -72,3 +74,32 @@ PyObject *PyDapChainTxOutCondSubType_str(PyObject *self){ ...@@ -72,3 +74,32 @@ PyObject *PyDapChainTxOutCondSubType_str(PyObject *self){
dap_chain_tx_out_cond_subtype_to_str(*((PyDapChainTxOutCondSubTypeObject*)self)->out_cond_subtype) dap_chain_tx_out_cond_subtype_to_str(*((PyDapChainTxOutCondSubTypeObject*)self)->out_cond_subtype)
); );
} }
PyObject *wrapping_dap_chain_tx_out_cond_get_tag(PyObject *self, void *closure)
{
(void)closure;
PyDapChainTxOutCondObject *obj_cond = (PyDapChainTxOutCondObject *)self;
if (!obj_cond->out_cond) {
Py_RETURN_NONE;
}
dap_chain_tx_out_cond_t *l_cond = obj_cond->out_cond;
dap_tsd_t *l_tsd = NULL;
size_t l_tsd_size = 0;
dap_tsd_iter(l_tsd, l_tsd_size, l_cond->tsd, l_cond->tsd_size) {
if (l_tsd->type == DAP_CHAIN_TX_OUT_COND_TSD_STR) {
const char *l_str = (const char *)l_tsd->data;
if (l_str && *l_str) {
return Py_BuildValue("s", l_str);
}
Py_RETURN_NONE;
}
}
Py_RETURN_NONE;
}
\ No newline at end of file
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