Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
18
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
cellframe-sdk
Merge requests
!891
support-6913
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
support-6913
support-6913
into
develop
Overview
0
Commits
19
Pipelines
12
Changes
100
Merged
Roman Khlopkov
requested to merge
support-6913
into
develop
2 years ago
Overview
0
Commits
19
Pipelines
12
Changes
2
Expand
[*] Last DAP SDK fixes ported from master
👍
0
👎
0
Merge request reports
Viewing commit
4d569c34
Prev
Next
Show latest version
2 files
+
177
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
4d569c34
[*] Channel module porting
· 4d569c34
Roman Khlopkov
authored
2 years ago
modules/chain/include/dap_chain_tx.h
0 → 100644
+
87
−
0
Options
/*
* Authors:
* Dmitriy A. Gearasimov <gerasimov.dmitriy@demlabs.net>
* DeM Labs Inc. https://demlabs.net
* Cellframe Network https://cellframe.net
* Copyright (c) 2022
* All rights reserved.
This file is part of DAP (Deus Applications Prototypes) the open source project
DAP (Deus Applicaions Prototypes) is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DAP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"dap_chain_common.h"
#include
"dap_chain_datum_token.h"
#include
"dap_hash.h"
#include
"uthash.h"
#include
"dap_chain_datum_tx.h"
#include
"dap_chain_datum_tx_items.h"
#include
"dap_chain_datum_tx_in.h"
#include
"dap_chain_datum_tx_in_cond.h"
#include
"dap_chain_datum_tx_out_cond.h"
#include
"dap_chain_datum_tx_out_ext.h"
#include
"dap_chain_datum_tx_out.h"
typedef
struct
dap_chain_tx
{
enum
{
CHAIN_TX_STORE_TYPE_PACKED
,
CHAIN_TX_STORE_TYPE_UNPACKED
}
store_type
;
dap_chain_datum_tx_t
*
datum_tx
;
// Owner
dap_chain_addr_t
owner
;
const
char
*
token_ticker
[
DAP_CHAIN_TICKER_SIZE_MAX
];
dap_hash_fast_t
token_hash
;
dap_chain_datum_token_t
*
token
;
// Inputs
dap_chain_datum_tx_item_t
*
in
;
dap_chain_tx_in_cond_t
*
in_cond
;
// Outputs
dap_chain_datum_tx_item_t
*
out
;
dap_chain_tx_out_cond_t
*
out_cond
;
// Previous
struct
dap_chain_tx
**
prev
;
size_t
prev_count
;
dap_hash_fast_t
*
prev_hash
;
struct
dap_chain_tx
**
next
;
size_t
next_count
;
dap_hash_fast_t
*
next_hash
;
// Hash and UT hash handle
dap_hash_fast_t
hash
;
UT_hash_handle
hh
;
}
dap_chain_tx_t
;
dap_chain_tx_t
*
dap_chain_tx_wrap_packed
(
dap_chain_datum_tx_t
*
a_tx_packed
);
void
dap_chain_tx_hh_add
(
dap_chain_tx_t
*
a_tx_hh
,
dap_chain_tx_t
*
a_tx
);
/**
* @brief Find tx in hashtable by its datum_tx hash
* @param a_tx_hh
* @param a_tx_hash
* @return
*/
static
inline
dap_chain_tx_t
*
dap_chain_tx_hh_find
(
dap_chain_tx_t
*
a_tx_hh
,
dap_hash_fast_t
*
a_tx_hash
)
{
dap_chain_tx_t
*
l_ret
=
NULL
;
HASH_FIND
(
hh
,
a_tx_hh
,
a_tx_hash
,
sizeof
(
*
a_tx_hash
),
l_ret
);
return
l_ret
;
}
void
dap_chain_tx_hh_free
(
dap_chain_tx_t
*
a_tx_hh
);
dap_chain_tx_t
*
dap_chain_tx_dup
(
dap_chain_tx_t
*
a_tx
);
void
dap_chain_tx_delete
(
dap_chain_tx_t
*
a_tx
);
Loading