From 66960f1f337c9751e1848ca1c675b4bc4ecc5d79 Mon Sep 17 00:00:00 2001 From: Tobias Lindahl Date: Wed, 13 Mar 2019 15:29:41 +0100 Subject: [PATCH] Add call_state_tree --- src/aeser_api_encoder.erl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/aeser_api_encoder.erl b/src/aeser_api_encoder.erl index 32a253c..3a54395 100644 --- a/src/aeser_api_encoder.erl +++ b/src/aeser_api_encoder.erl @@ -33,7 +33,8 @@ | peer_pubkey | state | poi - | state_trees. + | state_trees + | call_state_tree. -type extended_type() :: known_type() | block_hash | {id_hash, [known_type()]}. @@ -190,7 +191,8 @@ type2enc(peer_pubkey) -> ?BASE58; type2enc(name) -> ?BASE58; type2enc(state) -> ?BASE64; type2enc(poi) -> ?BASE64; -type2enc(state_trees) -> ?BASE64. +type2enc(state_trees) -> ?BASE64; +type2enc(call_state_tree) -> ?BASE64. type2pfx(key_block_hash) -> <<"kh">>; @@ -214,7 +216,8 @@ type2pfx(peer_pubkey) -> <<"pp">>; type2pfx(name) -> <<"nm">>; type2pfx(state) -> <<"st">>; type2pfx(poi) -> <<"pi">>; -type2pfx(state_trees) -> <<"ss">>. +type2pfx(state_trees) -> <<"ss">>; +type2pfx(call_state_tree) -> <<"cs">>. pfx2type(<<"kh">>) -> key_block_hash; pfx2type(<<"mh">>) -> micro_block_hash; @@ -237,7 +240,8 @@ pfx2type(<<"pp">>) -> peer_pubkey; pfx2type(<<"nm">>) -> name; pfx2type(<<"st">>) -> state; pfx2type(<<"pi">>) -> poi; -pfx2type(<<"ss">>) -> state_trees. +pfx2type(<<"ss">>) -> state_trees; +pfx2type(<<"cs">>) -> call_state_tree. -spec byte_size_for_type(known_type()) -> non_neg_integer() | not_applicable. @@ -262,7 +266,8 @@ byte_size_for_type(commitment) -> 32; byte_size_for_type(peer_pubkey) -> 32; byte_size_for_type(state) -> 32; byte_size_for_type(poi) -> not_applicable; -byte_size_for_type(state_trees) -> not_applicable. +byte_size_for_type(state_trees) -> not_applicable; +byte_size_for_type(call_state_tree) -> not_applicable. %% TODO: Fix the base58 module so that it consistently uses binaries instead