split coerce/3 into two functions

Also renamed coerce_bindings to erlang_args_to_fate, to match.
This commit is contained in:
Jarvis Carroll
2026-01-09 04:39:58 +00:00
parent d2163c1ff8
commit 3da9bd570b
2 changed files with 204 additions and 165 deletions
+2 -2
View File
@@ -716,7 +716,7 @@ decode_bytearray_fate(EncodedStr) ->
decode_bytearray(Type, EncodedStr) ->
case decode_bytearray_fate(EncodedStr) of
{ok, none} -> {ok, none};
{ok, Object} -> hz_aaci:coerce(Type, Object, from_fate);
{ok, Object} -> hz_aaci:fate_to_erlang(Type, Object);
{error, Reason} -> {error, Reason}
end.
@@ -1518,7 +1518,7 @@ encode_call_data({aaci, Label}, Fun, Args) ->
end.
encode_call_data2(ArgDef, Fun, Args) ->
case hz_aaci:coerce_bindings(ArgDef, Args, to_fate) of
case hz_aaci:erlang_args_to_fate(ArgDef, Args) of
{ok, Coerced} -> gmb_fate_abi:create_calldata(Fun, Coerced);
Errors -> Errors
end.