Add MCL_BLS12_381 types to from_fate_builtin

This commit is contained in:
Gaith Hallak 2022-05-04 13:41:02 +04:00
parent 85879f5380
commit fdac0d7027

View File

@ -136,6 +136,8 @@ from_fate_builtin(QType, Val) ->
Str = {id, [], "string"}, Str = {id, [], "string"},
Adr = {id, [], "address"}, Adr = {id, [], "address"},
Hsh = {bytes_t, [], 32}, Hsh = {bytes_t, [], 32},
I32 = {bytes_t, [], 32},
I48 = {bytes_t, [], 48},
Qid = fun(Name) -> {qid, [], Name} end, Qid = fun(Name) -> {qid, [], Name} end,
Map = fun(KT, VT) -> {app_t, [], {id, [], "map"}, [KT, VT]} end, Map = fun(KT, VT) -> {app_t, [], {id, [], "map"}, [KT, VT]} end,
ChainTxArities = [3, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 0], ChainTxArities = [3, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 0],
@ -208,6 +210,11 @@ from_fate_builtin(QType, Val) ->
{["Chain", "base_tx"], {variant, ChainTxArities, 21, {}}} -> {["Chain", "base_tx"], {variant, ChainTxArities, 21, {}}} ->
App(["Chain","GAAttachTx"], []); App(["Chain","GAAttachTx"], []);
{["MCL_BLS12_381", "fp"], X} ->
App(["MCL_BLS12_381", "fp"], [Chk(I32, X)]);
{["MCL_BLS12_381", "fr"], X} ->
App(["MCL_BLS12_381", "fr"], [Chk(I48, X)]);
_ -> _ ->
throw(cannot_translate_to_sophia) throw(cannot_translate_to_sophia)
end. end.