1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +00:00
trezor-firmware/legacy/firmware/nem_mosaics.c.mako

46 lines
1.0 KiB
Plaintext
Raw Normal View History

2018-07-30 15:40:07 +00:00
<%
ATTRIBUTES_REQUIRED = (
2018-07-30 15:40:07 +00:00
("namespace", c_str),
("mosaic", c_str),
)
ATTRIBUTES_OPTIONAL = (
("name", c_str),
("ticker", lambda s: c_str(" " + s) if s else "NULL"),
2018-07-30 15:40:07 +00:00
("divisibility", int),
("levy", lambda s: "NEMMosaicLevy_" + s),
2018-07-30 15:40:07 +00:00
("fee", int),
("levy_namespace", c_str),
("levy_mosaic", c_str),
)
%>\
// This file is automatically generated from nem_mosaics.c.mako
// DO NOT EDIT
#include "nem_mosaics.h"
const NEMMosaicDefinition NEM_MOSAIC_DEFINITIONS[NEM_MOSAIC_DEFINITIONS_COUNT] = {
2018-07-30 15:40:07 +00:00
% for m in supported_on("trezor1", nem):
{
% for attr, func in ATTRIBUTES_REQUIRED:
% if attr in m:
.${attr} = ${func(m[attr])},
% endif
% endfor
.description = "",
% for attr, func in ATTRIBUTES_OPTIONAL:
2018-07-30 15:40:07 +00:00
% if attr in m:
.has_${attr} = true,
.${attr} = ${func(m[attr])},
% endif
% endfor
% if "networks" in m:
.networks_count = ${len(m["networks"])},
.networks = { ${", ".join(map(str, m["networks"]))} },
% endif
},
% endfor
};
const NEMMosaicDefinition *NEM_MOSAIC_DEFINITION_XEM = NEM_MOSAIC_DEFINITIONS;