Add native_token encoding support

This commit is contained in:
Ulf Wiger 2024-07-15 16:39:04 +02:00
parent db7a9f62f2
commit 8336d8113c
4 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{erl_opts, [debug_info]}.
{deps, [ {base58, {git, "https://github.com/aeternity/erl-base58.git", {ref, "60a3356"}}}
, {enacl, {git, "https://github.com/aeternity/enacl.git", {ref, "67fceef"}}}
, {enacl, {git, "https://gitlab.com/ioecs/enacl.git", {ref, "4eb7ec70"}}}
]}.

View File

@ -3,6 +3,6 @@
{ref,"60a335668a60328a29f9731b67c4a0e9e3d50ab6"}},
0},
{<<"enacl">>,
{git,"https://github.com/aeternity/enacl.git",
{ref,"67fceef42c0d055570f2e67b571f8d1f8de2f204"}},
{git,"https://gitlab.com/ioecs/enacl.git",
{ref,"4eb7ec70084ba7c87b1af8797c4c4e90c84f95a2"}},
0}].

View File

@ -35,6 +35,7 @@
| associate_chain
| signature
| name
| native_token
| commitment
| peer_pubkey
| state
@ -170,6 +171,7 @@ id2type(channel) -> channel;
id2type(commitment) -> commitment;
id2type(contract) -> contract_pubkey;
id2type(name) -> name;
id2type(native_token) -> native_token;
id2type(oracle) -> oracle_pubkey.
type2id(account_pubkey) -> account;
@ -178,6 +180,7 @@ type2id(channel) -> channel;
type2id(commitment) -> commitment;
type2id(contract_pubkey) -> contract;
type2id(name) -> name;
type2id(native_token) -> native_token;
type2id(oracle_pubkey) -> oracle.
type2enc(key_block_hash) -> ?BASE58;
@ -204,6 +207,7 @@ type2enc(signature) -> ?BASE58;
type2enc(commitment) -> ?BASE58;
type2enc(peer_pubkey) -> ?BASE58;
type2enc(name) -> ?BASE58;
type2enc(native_token) -> ?BASE58;
type2enc(state) -> ?BASE64;
type2enc(poi) -> ?BASE64;
type2enc(state_trees) -> ?BASE64;
@ -237,6 +241,7 @@ type2pfx(signature) -> <<"sg">>;
type2pfx(commitment) -> <<"cm">>;
type2pfx(peer_pubkey) -> <<"pp">>;
type2pfx(name) -> <<"nm">>;
type2pfx(native_token) -> <<"nt">>;
type2pfx(state) -> <<"st">>;
type2pfx(poi) -> <<"pi">>;
type2pfx(state_trees) -> <<"ss">>;
@ -269,6 +274,7 @@ pfx2type(<<"sg">>) -> signature;
pfx2type(<<"cm">>) -> commitment;
pfx2type(<<"pp">>) -> peer_pubkey;
pfx2type(<<"nm">>) -> name;
pfx2type(<<"nt">>) -> native_token;
pfx2type(<<"st">>) -> state;
pfx2type(<<"pi">>) -> poi;
pfx2type(<<"ss">>) -> state_trees;
@ -301,6 +307,7 @@ byte_size_for_type(account_seckey) -> 32;
byte_size_for_type(associate_chain) -> 32;
byte_size_for_type(signature) -> 64;
byte_size_for_type(name) -> not_applicable;
byte_size_for_type(native_token) -> 32;
byte_size_for_type(commitment) -> 32;
byte_size_for_type(peer_pubkey) -> 32;
byte_size_for_type(state) -> 32;

View File

@ -20,6 +20,7 @@
, {account_pubkey , 32}
, {signature , 64}
, {name , not_applicable}
, {native_token , 32}
, {commitment , 32}
, {peer_pubkey , 32}
, {state , 32}