Add creation of fate calldata
This commit is contained in:
parent
29b5ee3e68
commit
242700e084
@ -2,12 +2,12 @@
|
||||
%%% @copyright (C) 2017, Aeternity Anstalt
|
||||
%%% @doc
|
||||
%%% Encode and decode data and function calls according to
|
||||
%%% Sophia-AEVM-ABI.
|
||||
%%% Sophia-AEVM-ABI
|
||||
%%% @end
|
||||
%%% Created : 25 Jan 2018
|
||||
%%%
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(aeb_abi).
|
||||
-module(aeb_aevm_abi).
|
||||
-define(HASH_SIZE, 32).
|
||||
|
||||
-export([ create_calldata/4
|
23
src/aeb_fate_abi.erl
Normal file
23
src/aeb_fate_abi.erl
Normal file
@ -0,0 +1,23 @@
|
||||
%%%-------------------------------------------------------------------
|
||||
%%% @copyright (C) 2019, Aeternity Anstalt
|
||||
%%% @doc
|
||||
%%% Encode and decode data and function calls according to
|
||||
%%% Sophia-FATE-ABI
|
||||
%%% @end
|
||||
%%% Created : 11 Jun 2019
|
||||
%%%
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(aeb_fate_abi).
|
||||
|
||||
-export([ create_calldata/2 ]).
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
||||
-spec create_calldata(list(), [term()]) -> {ok, binary()}.
|
||||
create_calldata(FunName, Args) ->
|
||||
FunctionId = aeb_fate_code:symbol_identifier(list_to_binary(FunName)),
|
||||
{ok, aeb_fate_encoding:serialize(
|
||||
aeb_fate_data:make_tuple({FunctionId,
|
||||
aeb_fate_data:make_tuple(list_to_tuple(Args))}))}.
|
Loading…
x
Reference in New Issue
Block a user