Skip to content
Snippets Groups Projects

Backport 7467

Merged alexey.stratulat requested to merge backport-7467 into develop
Files
24
@@ -32,6 +32,7 @@
#include "dap_pkey.h"
#include "dap_sign.h"
#include "dap_hash.h"
#include <json-c/json.h>
#define DAP_CHAIN_ADDR_VERSION_CURRENT 1
@@ -162,7 +163,7 @@ typedef union {
extern const dap_chain_net_srv_uid_t c_dap_chain_net_srv_uid_null;
extern const dap_chain_cell_id_t c_dap_chain_cell_id_null;
enum serv_unit_enum {
enum dap_chain_srv_unit_enum {
SERV_UNIT_UNDEFINED = 0 ,
SERV_UNIT_MB = 0x00000001, // megabytes
SERV_UNIT_SEC = 0x00000002, // seconds
@@ -171,10 +172,11 @@ enum serv_unit_enum {
SERV_UNIT_B = 0x00000011, // bytes
SERV_UNIT_PCS = 0x00000022 // pieces
};
typedef uint32_t serv_unit_enum_t;
typedef uint32_t dap_chain_srv_unit_enum_t;
DAP_STATIC_INLINE const char *serv_unit_enum_to_str(serv_unit_enum_t *unit_enum){
switch (*unit_enum) {
DAP_STATIC_INLINE const char *dap_chain_srv_unit_enum_to_str(dap_chain_srv_unit_enum_t a_unit_enum)
{
switch (a_unit_enum) {
case SERV_UNIT_UNDEFINED: return "SERV_UNIT_UNDEFINED";
case SERV_UNIT_MB: return "SERV_UNIT_MB";
case SERV_UNIT_SEC: return "SERV_UNIT_SEC";
@@ -189,7 +191,7 @@ DAP_STATIC_INLINE const char *serv_unit_enum_to_str(serv_unit_enum_t *unit_enum)
typedef union {
uint8_t raw[4];
uint32_t uint32;
serv_unit_enum_t enm;
dap_chain_srv_unit_enum_t enm;
} DAP_ALIGN_PACKED dap_chain_net_srv_price_unit_uid_t;
enum dap_chain_tx_item_type {
@@ -237,12 +239,19 @@ typedef struct dap_chain_receipt_info {
extern "C" {
#endif
json_object* dap_chain_receipt_info_to_json(dap_chain_receipt_info_t *a_info);
size_t dap_chain_hash_slow_to_str(dap_chain_hash_slow_t * a_hash, char * a_str, size_t a_str_max);
char* dap_chain_addr_to_str(const dap_chain_addr_t *a_addr);
json_object *dap_chain_addr_to_json(const dap_chain_addr_t *a_addr);
dap_chain_addr_t* dap_chain_addr_from_str(const char *str);
bool dap_chain_addr_is_blank(const dap_chain_addr_t *a_addr);
DAP_STATIC_INLINE json_object *dap_chain_net_id_to_json(dap_chain_net_id_t a_net_id) {
return json_object_new_uint64(a_net_id.uint64);
}
dap_chain_net_srv_uid_t dap_chain_net_srv_uid_from_str(const char* a_str);
void dap_chain_addr_fill(dap_chain_addr_t *a_addr, dap_sign_type_t a_type, dap_chain_hash_fast_t *a_pkey_hash, dap_chain_net_id_t a_net_id);
Loading