File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
convex-core/src/test/java/convex/core/lang Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -4933,12 +4933,18 @@ public void testSetParent() {
4933
4933
// set-parent
4934
4934
assertEquals (VILLAIN , eval ("(set-parent " +VILLAIN +")" ));
4935
4935
assertEquals (VILLAIN , eval ("(do (set-parent " +VILLAIN +") *parent*)" ));
4936
+
4937
+ // Behaviour for a deployed actor with *caller* as parent
4938
+ assertEquals (CVMLong .ONE , eval ("(do (def a 1) (def actor (deploy '(set-parent *caller*))) actor/a)" ));
4939
+ assertUndeclaredError (step ("(do (def a 1) (def actor (deploy '(set-parent *caller*))) actor/b)" ));
4940
+
4936
4941
4937
4942
// non-existent parent accounts
4938
4943
assertNobodyError (step ("(set-parent #99999)" ));
4939
4944
4940
4945
// protection against account being it's own parent
4941
4946
assertArgumentError (step ("(set-parent *address*)" ));
4947
+
4942
4948
4943
4949
assertCastError (step ("(set-parent :foo)" ));
4944
4950
assertCastError (step ("(set-parent [#8 :foo])" ));
You can’t perform that action at this time.
0 commit comments