diff --git a/include/aeb_heap.hrl b/include/aeb_heap.hrl index ba8c977..f60b270 100644 --- a/include/aeb_heap.hrl +++ b/include/aeb_heap.hrl @@ -1,6 +1,6 @@ --record(pmap, {key_t :: aeso_sophia:type(), - val_t :: aeso_sophia:type(), +-record(pmap, {key_t :: aeb_aevm_data:type(), + val_t :: aeb_aevm_data:type(), parent :: none | non_neg_integer(), size = 0 :: non_neg_integer(), data :: #{aeb_heap:binary_value() => aeb_heap:binary_value() | tombstone} diff --git a/src/aeb_abi.erl b/src/aeb_abi.erl index 7c2f2f5..f5d21b7 100644 --- a/src/aeb_abi.erl +++ b/src/aeb_abi.erl @@ -23,7 +23,7 @@ -type hash() :: <<_:256>>. %% 256 = ?HASH_SIZE * 8. -type function_name() :: binary(). %% String --type typerep() :: aeso_sophia:type(). +-type typerep() :: aeb_aevm_data:type(). -type function_type_info() :: { FunctionHash :: hash() , FunctionName :: function_name() , ArgType :: binary() %% binary typerep diff --git a/src/aeb_aevm_data.erl b/src/aeb_aevm_data.erl new file mode 100644 index 0000000..479e8e1 --- /dev/null +++ b/src/aeb_aevm_data.erl @@ -0,0 +1,30 @@ +-module(aeb_aevm_data). + +-export_type([data/0, + type/0, + heap/0]). + +-type type() :: word | signed_word | string | typerep | function + | {list, type()} + | {option, type()} + | {tuple, [type()]} + | {variant, [[type()]]}. + + +-type data() :: none + | {some, data()} + | {option, data()} + | word + | string + | {list, data()} + | {tuple, [data()]} + | {variant, integer(), [data()]} + | integer() + | binary() + | [data()] + | {} + | {data()} + | {data(), data()}. + +-type heap() :: binary(). + diff --git a/src/aeb_heap.erl b/src/aeb_heap.erl index 906cfe7..158a3bd 100644 --- a/src/aeb_heap.erl +++ b/src/aeb_heap.erl @@ -92,7 +92,7 @@ heap_value_heap({_, Heap}) -> Heap#heap.heap. %% -- Value to binary -------------------------------------------------------- --spec to_binary(aeso_sophia:data()) -> aeso_sophia:heap(). +-spec to_binary(aeb_aevm_data:data()) -> aeb_aevm_data:heap(). %% Encode the data as a heap where the first word is the value (for unboxed %% types) or a pointer to the value (for boxed types). to_binary(Data) -> diff --git a/src/aeb_icode.hrl b/src/aeb_icode.hrl index 56da80a..a338125 100644 --- a/src/aeb_icode.hrl +++ b/src/aeb_icode.hrl @@ -1,5 +1,5 @@ --define(Type(), aeso_sophia:type()). +-define(Type(), aeb_aevm_data:type()). -define(TYPEREP_WORD_TAG, 0). -define(TYPEREP_STRING_TAG, 1).