Add test contract
This commit is contained in:
parent
53abda625a
commit
e3c82e954d
@ -202,6 +202,7 @@ compilable_contracts() ->
|
||||
"polymorphism_contract_interface_extensions",
|
||||
"polymorphism_contract_interface_same_decl_multi_interface",
|
||||
"polymorphism_contract_interface_same_name_same_type",
|
||||
"polymorphism_chain_create",
|
||||
"missing_init_fun_state_unit",
|
||||
"complex_compare_leq",
|
||||
"complex_compare",
|
||||
|
23
test/contracts/polymorphism_chain_create.aes
Normal file
23
test/contracts/polymorphism_chain_create.aes
Normal file
@ -0,0 +1,23 @@
|
||||
contract interface I =
|
||||
entrypoint f : () => int
|
||||
|
||||
contract C1 : I =
|
||||
entrypoint f() = 123
|
||||
|
||||
contract C2 : I =
|
||||
entrypoint f() = 888
|
||||
|
||||
namespace Make =
|
||||
stateful function new1() : I = Chain.create() : C1
|
||||
stateful function new2() : I = Chain.create() : C2
|
||||
|
||||
stateful function new(c : I) : int = c.f()
|
||||
|
||||
main contract Main =
|
||||
stateful entrypoint test1() =
|
||||
let c = Make.new1()
|
||||
Make.new(c)
|
||||
|
||||
stateful entrypoint test2() =
|
||||
let c = Make.new2()
|
||||
Make.new(c)
|
Loading…
x
Reference in New Issue
Block a user