Skip to content

Commit

Permalink
Merge pull request #210 from formal-land/bk@compile-more-of-ink_env-8
Browse files Browse the repository at this point in the history
Compile more of ink_env.v 8
  • Loading branch information
clarus authored Sep 19, 2023
2 parents 5a03c98 + d8d26d4 commit 876f3e4
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 276 deletions.
56 changes: 31 additions & 25 deletions CoqOfRust/ink/erc20.v
Original file line number Diff line number Diff line change
Expand Up @@ -3103,7 +3103,7 @@ Module
let* _ :=
let* α0 := output_result.["is_err"] in
let* α1 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
α0 in
let* α2 := output_result.["map"] (fun _ => Pure tt) in
let* α3 := ink_primitives.ConstructorResult::["Ok"] α2 in
Expand Down Expand Up @@ -3440,7 +3440,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -3507,7 +3507,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -3574,7 +3574,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -3641,7 +3641,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -3708,7 +3708,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -3775,7 +3775,7 @@ Module
else
Pure tt in
let* α0 :=
ink_env.backend_and_call_builder_and_error.ReturnFlags::["new_with_reverted"]
ink_env.backend_and_call_builder_and_engine_and_error.ReturnFlags::["new_with_reverted"]
is_reverted in
let* α1 := ink_primitives.MessageResult::["Ok"] result in
ink_env.api.return_value α0 (addr_of α1)
Expand Down Expand Up @@ -4543,17 +4543,18 @@ Module Impl_erc20_erc20___CallBuilder_18.
(self : ref Self)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
ink_env.call.execution_input.EmptyArgumentList))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType erc20.erc20.Balance))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 219; 99; 117; 168 ] in
Expand All @@ -4572,10 +4573,10 @@ Module Impl_erc20_erc20___CallBuilder_18.
(__ink_binding_0 : erc20.erc20.AccountId)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
Expand All @@ -4584,7 +4585,8 @@ Module Impl_erc20_erc20___CallBuilder_18.
ink_env.call.execution_input.EmptyArgumentList)))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType erc20.erc20.Balance))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 15; 117; 90; 86 ] in
Expand All @@ -4605,10 +4607,10 @@ Module Impl_erc20_erc20___CallBuilder_18.
(__ink_binding_1 : erc20.erc20.AccountId)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
Expand All @@ -4620,7 +4622,8 @@ Module Impl_erc20_erc20___CallBuilder_18.
ink_env.call.execution_input.EmptyArgumentList))))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType erc20.erc20.Balance))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 106; 0; 22; 94 ] in
Expand All @@ -4642,10 +4645,10 @@ Module Impl_erc20_erc20___CallBuilder_18.
(__ink_binding_1 : erc20.erc20.Balance)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
Expand All @@ -4657,7 +4660,8 @@ Module Impl_erc20_erc20___CallBuilder_18.
ink_env.call.execution_input.EmptyArgumentList))))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType (erc20.erc20.Result unit)))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 132; 161; 93; 161 ] in
Expand All @@ -4679,10 +4683,10 @@ Module Impl_erc20_erc20___CallBuilder_18.
(__ink_binding_1 : erc20.erc20.Balance)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
Expand All @@ -4694,7 +4698,8 @@ Module Impl_erc20_erc20___CallBuilder_18.
ink_env.call.execution_input.EmptyArgumentList))))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType (erc20.erc20.Result unit)))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 104; 18; 102; 160 ] in
Expand All @@ -4717,10 +4722,10 @@ Module Impl_erc20_erc20___CallBuilder_18.
(__ink_binding_2 : erc20.erc20.Balance)
:
M (H := H')
(ink_env.backend_and_call_builder_and_error.CallBuilder
(ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
erc20.erc20.Environment
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call
(ink_env.backend_and_call_builder_and_engine_and_error.Call
erc20.erc20.Environment))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput
Expand All @@ -4735,7 +4740,8 @@ Module Impl_erc20_erc20___CallBuilder_18.
ink_env.call.execution_input.EmptyArgumentList)))))
(ink_env.call.common.Set_
(ink_env.call.common.ReturnType (erc20.erc20.Result unit)))) :=
let* α0 := ink_env.backend_and_call_builder_and_error.build_call in
let* α0 :=
ink_env.backend_and_call_builder_and_engine_and_error.build_call in
let* α1 := ink.contract_ref.ToAccountId.to_account_id self in
let* α2 := α0.["call"] α1 in
let* α3 := ink_env.call.selector.Selector::["new"] [ 11; 57; 111; 24 ] in
Expand Down
8 changes: 4 additions & 4 deletions CoqOfRust/ink/ink_e2e.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Parameter constructor_exec_input :

Module client.
Definition CallBuilderFinal (E Args RetType : Set) : Set :=
ink_env.backend_and_call_builder_and_error.CallBuilder
ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
E
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call E))
(ink_env.backend_and_call_builder_and_engine_and_error.Call E))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput Args))
(ink_env.call.common.Set_ (ink_env.call.common.ReturnType RetType)).
Expand Down Expand Up @@ -244,10 +244,10 @@ Module client.
End client.

Definition CallBuilderFinal (E Args RetType : Set) : Set :=
ink_env.backend_and_call_builder_and_error.CallBuilder
ink_env.backend_and_call_builder_and_engine_and_error.CallBuilder
E
(ink_env.call.common.Set_
(ink_env.backend_and_call_builder_and_error.Call E))
(ink_env.backend_and_call_builder_and_engine_and_error.Call E))
(ink_env.call.common.Set_
(ink_env.call.execution_input.ExecutionInput Args))
(ink_env.call.common.Set_ (ink_env.call.common.ReturnType RetType)).
Expand Down
Loading

0 comments on commit 876f3e4

Please sign in to comment.