@@ -33,7 +33,7 @@ public class CNSTest extends ACVMTest {
33
33
@ Test public void testConstantSetup () {
34
34
assertEquals (Init .REGISTRY_ADDRESS ,eval ("*registry*" ));
35
35
assertEquals (Init .REGISTRY_ADDRESS ,eval ("cns" ));
36
- assertEquals (Init .REGISTRY_ADDRESS ,eval ("(* registry*/resolve 'cns) " ));
36
+ assertEquals (Init .REGISTRY_ADDRESS ,eval ("@convex. registry" ));
37
37
38
38
// TODO: fix this
39
39
// assertEquals(Init.REGISTRY_ADDRESS,eval("@cns"));
@@ -46,6 +46,7 @@ public class CNSTest extends ACVMTest {
46
46
}
47
47
48
48
@ Test public void testTrust () {
49
+ // Root CNS node should only trust governance account
49
50
assertFalse (evalB ("(trust/trusted? [cns []] *address*)" ));
50
51
assertTrue (evalB ("(query-as #6 `(~trust/trusted? [~cns []] *address*))" ));
51
52
}
@@ -70,26 +71,26 @@ public class CNSTest extends ACVMTest {
70
71
// HERO shouldn't be able to create a top level CNS entry
71
72
assertTrustError (step ("(*registry*/create 'foo)" ));
72
73
73
- // INIT should be able to create a top level CNS entry
74
- Context ictx =context ().forkWithAddress (Init .GOVERNANCE_ADDRESS );
75
- ictx =step (ictx ,"(import convex.trust :as trust)" );
76
- ictx =(step (ictx ,"(*registry*/create 'foo #17)" ));
77
- assertNotError (ictx );
78
- ictx =step (ictx ,"(def ref [*registry* [\" foo\" ]])" );
79
- AVector <?> ref =ictx .getResult ();
74
+ // NEed governance address to be able to create a top level CNS entry
75
+ Context ctx =context ().forkWithAddress (Init .GOVERNANCE_ADDRESS );
76
+ ctx =step (ctx ,"(import convex.trust :as trust)" );
77
+ ctx =(step (ctx ,"(*registry*/create 'foo #17)" ));
78
+ assertNotError (ctx );
79
+ ctx =step (ctx ,"(def ref [*registry* [\" foo\" ]])" );
80
+ AVector <?> ref =ctx .getResult ();
80
81
assertNotNull (ref );
81
82
82
83
// System.out.println(eval(ictx,"*registry*/cns-database"));
83
84
84
- assertEquals (Address .create (17 ),eval (ictx ,"(*registry*/resolve 'foo)" ));
85
+ assertEquals (Address .create (17 ),eval (ctx ,"(*registry*/resolve 'foo)" ));
85
86
86
- ictx =(step (ictx ,"(*registry*/create 'foo #666)" ));
87
- assertEquals (Address .create (666 ),eval (ictx ,"(*registry*/resolve 'foo)" ));
87
+ ctx =(step (ctx ,"(*registry*/create 'foo #666)" ));
88
+ assertEquals (Address .create (666 ),eval (ctx ,"(*registry*/resolve 'foo)" ));
88
89
89
90
// HERO still shouldn't be able to update a top level CNS entry
90
- ictx = ictx .forkWithAddress (HERO );
91
- assertTrustError (step (ictx ,"(*registry*/create 'foo *address* *address* {})" ));
92
- assertTrustError (step (ictx ,"(trust/change-control " +ref +" *address*)" ));
91
+ ctx = ctx .forkWithAddress (HERO );
92
+ assertTrustError (step (ctx ,"(*registry*/create 'foo *address* *address* {})" ));
93
+ assertTrustError (step (ctx ,"(trust/change-control " +ref +" *address*)" ));
93
94
94
95
}
95
96
0 commit comments