From 91b83cfb895cf53d91d1a72f246d8d84f95919a7 Mon Sep 17 00:00:00 2001 From: skkw Date: Tue, 30 Jul 2019 15:09:47 +0200 Subject: [PATCH] add subname id --- src/aeser_api_encoder.erl | 5 +++++ src/aeser_chain_objects.erl | 4 ++++ src/aeser_id.erl | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/aeser_api_encoder.erl b/src/aeser_api_encoder.erl index e66bdec..ad67ca5 100644 --- a/src/aeser_api_encoder.erl +++ b/src/aeser_api_encoder.erl @@ -32,6 +32,7 @@ | account_pubkey | signature | name + | subname | commitment | peer_pubkey | state @@ -195,6 +196,7 @@ type2enc(signature) -> ?BASE58; type2enc(commitment) -> ?BASE58; type2enc(peer_pubkey) -> ?BASE58; type2enc(name) -> ?BASE58; +type2enc(subname) -> ?BASE58; type2enc(state) -> ?BASE64; type2enc(poi) -> ?BASE64; type2enc(state_trees) -> ?BASE64; @@ -223,6 +225,7 @@ type2pfx(signature) -> <<"sg">>; type2pfx(commitment) -> <<"cm">>; type2pfx(peer_pubkey) -> <<"pp">>; type2pfx(name) -> <<"nm">>; +type2pfx(subname) -> <<"sn">>; type2pfx(state) -> <<"st">>; type2pfx(poi) -> <<"pi">>; type2pfx(state_trees) -> <<"ss">>; @@ -250,6 +253,7 @@ pfx2type(<<"sg">>) -> signature; pfx2type(<<"cm">>) -> commitment; pfx2type(<<"pp">>) -> peer_pubkey; pfx2type(<<"nm">>) -> name; +pfx2type(<<"sn">>) -> subname; pfx2type(<<"st">>) -> state; pfx2type(<<"pi">>) -> poi; pfx2type(<<"ss">>) -> state_trees; @@ -277,6 +281,7 @@ byte_size_for_type(oracle_response) -> not_applicable; byte_size_for_type(account_pubkey) -> 32; byte_size_for_type(signature) -> 64; byte_size_for_type(name) -> not_applicable; +byte_size_for_type(subname) -> not_applicable; byte_size_for_type(commitment) -> 32; byte_size_for_type(peer_pubkey) -> 32; byte_size_for_type(state) -> 32; diff --git a/src/aeser_chain_objects.erl b/src/aeser_chain_objects.erl index 7eb6e13..14d1f24 100644 --- a/src/aeser_chain_objects.erl +++ b/src/aeser_chain_objects.erl @@ -52,6 +52,8 @@ tag(name_preclaim_tx) -> 33; tag(name_update_tx) -> 34; tag(name_revoke_tx) -> 35; tag(name_transfer_tx) -> 36; +tag(subname) -> 38; +tag(subname_tx) -> 39; tag(contract) -> 40; tag(contract_call) -> 41; tag(contract_create_tx) -> 42; @@ -109,6 +111,8 @@ rev_tag(33) -> name_preclaim_tx; rev_tag(34) -> name_update_tx; rev_tag(35) -> name_revoke_tx; rev_tag(36) -> name_transfer_tx; +rev_tag(38) -> subname; +rev_tag(39) -> subname_tx; rev_tag(40) -> contract; rev_tag(41) -> contract_call; rev_tag(42) -> contract_create_tx; diff --git a/src/aeser_id.erl b/src/aeser_id.erl index 229cfda..e71fd21 100644 --- a/src/aeser_id.erl +++ b/src/aeser_id.erl @@ -24,7 +24,7 @@ , val }). --type tag() :: 'account' | 'oracle' | 'name' +-type tag() :: 'account' | 'oracle' | 'name' | 'subname' | 'commitment' | 'contract' | 'channel'. -type val() :: <<_:256>>. -opaque(id() :: #id{}). @@ -41,6 +41,7 @@ -define(IS_TAG(___TAG___), ___TAG___ =:= account; ___TAG___ =:= oracle; ___TAG___ =:= name; + ___TAG___ =:= subname; ___TAG___ =:= commitment; ___TAG___ =:= contract; ___TAG___ =:= channel