@@ -12,9 +12,9 @@ import {TestERC20} from "@aztec/mock/TestERC20.sol";
1212
1313struct RegistrationData {
1414 address attester;
15+ G1Point proofOfPossession;
1516 G1Point publicKeyInG1;
1617 G2Point publicKeyInG2;
17- G1Point proofOfPossession;
1818}
1919
2020contract MigrationScript is Test {
@@ -46,7 +46,7 @@ contract MigrationScript is Test {
4646 function emulate () public {
4747 // If emulating we will deploy a rollup and other components ahead of time, otherwise
4848 // you should provide them by updating the values above.
49- RollupBuilder builder = new RollupBuilder (ME).setUpdateOwnerships (false ).deploy ();
49+ RollupBuilder builder = new RollupBuilder (ME).setUpdateOwnerships (false ).setCheckProofOfPossession ( true ). deploy ();
5050
5151 INSTANCE = IInstance (address (builder.getConfig ().rollup));
5252 STAKING_ASSET = builder.getConfig ().testERC20;
@@ -57,6 +57,20 @@ contract MigrationScript is Test {
5757 migrate ();
5858 }
5959
60+ function print () public {
61+ RegistrationData memory r = $registrations[0 ];
62+ emit log_named_address ("Attester " , r.attester);
63+ emit log_named_address ("Withdrawer " , WITHDRAWER);
64+ emit log_named_bytes32 ("PublicKeyInG1.x " , bytes32 (r.publicKeyInG1.x));
65+ emit log_named_bytes32 ("PublicKeyInG1.y " , bytes32 (r.publicKeyInG1.y));
66+ emit log_named_bytes32 ("PublicKeyInG2.x0 " , bytes32 (r.publicKeyInG2.x0));
67+ emit log_named_bytes32 ("PublicKeyInG2.x1 " , bytes32 (r.publicKeyInG2.x1));
68+ emit log_named_bytes32 ("PublicKeyInG2.y0 " , bytes32 (r.publicKeyInG2.y0));
69+ emit log_named_bytes32 ("PublicKeyInG2.y1 " , bytes32 (r.publicKeyInG2.y1));
70+ emit log_named_bytes32 ("ProofOfPossession.x " , bytes32 (r.proofOfPossession.x));
71+ emit log_named_bytes32 ("ProofOfPossession.y " , bytes32 (r.proofOfPossession.y));
72+ }
73+
6074 function migrate () public {
6175 uint256 activationThreshold = INSTANCE.getActivationThreshold ();
6276
@@ -69,6 +83,8 @@ contract MigrationScript is Test {
6983 uint256 end = $registrations.length ;
7084 uint256 batchSize = 10 ;
7185
86+ uint256 sizeBefore = INSTANCE.getActiveAttesterCount () + INSTANCE.getEntryQueueLength ();
87+
7288 while (start < end) {
7389 uint256 batchEnd = start + batchSize;
7490 if (batchEnd > end) {
@@ -91,8 +107,11 @@ contract MigrationScript is Test {
91107 vm.startBroadcast (ME);
92108 ADDER.addValidators (args);
93109 vm.stopBroadcast ();
94-
95110 start = batchEnd;
96111 }
112+
113+ uint256 sizeAfter = INSTANCE.getActiveAttesterCount () + INSTANCE.getEntryQueueLength ();
114+
115+ assertGe (sizeAfter, sizeBefore + end);
97116 }
98117}
0 commit comments