@keep-network/tbtc-v2 1.0.0-dev.4 → 1.0.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/BLS.json +1 -1
- package/artifacts/Bank.json +2 -2
- package/artifacts/BeaconAuthorization.json +1 -1
- package/artifacts/BeaconDkg.json +1 -1
- package/artifacts/BeaconDkgValidator.json +1 -1
- package/artifacts/BeaconInactivity.json +1 -1
- package/artifacts/BeaconSortitionPool.json +3 -3
- package/artifacts/Bridge.json +5 -5
- package/artifacts/BridgeGovernance.json +2 -2
- package/artifacts/BridgeGovernanceParameters.json +1 -1
- package/artifacts/Deposit.json +1 -1
- package/artifacts/DepositSweep.json +1 -1
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +3 -3
- package/artifacts/Fraud.json +1 -1
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/LightRelay.json +2 -2
- package/artifacts/MaintainerProxy.json +2 -2
- package/artifacts/MovingFunds.json +1 -1
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeacon.json +2 -2
- package/artifacts/RandomBeaconChaosnet.json +2 -2
- package/artifacts/RandomBeaconGovernance.json +2 -2
- package/artifacts/Redemption.json +1 -1
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +2 -2
- package/artifacts/TBTCToken.json +2 -2
- package/artifacts/TBTCVault.json +2 -2
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +2 -2
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +1 -1
- package/deploy/06_deploy_bridge.ts +2 -1
- package/export/deploy/06_deploy_bridge.js +2 -1
- package/export/tasks/test-utils.js +133 -43
- package/export/test/integration/data/bls.js +12 -0
- package/export/test/integration/data/integration.js +133 -0
- package/export/test/integration/utils/random-beacon.js +193 -0
- package/package.json +3 -3
- package/tasks/test-utils.ts +88 -4
|
@@ -1269,7 +1269,7 @@
|
|
|
1269
1269
|
"transactionIndex": 0,
|
|
1270
1270
|
"gasUsed": "3456607",
|
|
1271
1271
|
"logsBloom": "0x00002004000000000102000000001000000040000000000000000000000008000000000020000000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000010000000000010000800020000000002000000000800000000000000000000000000000000001000002000000000200002000040000000000000000008000000000000000202000000001040000000000000000000000000000004000000001000000000000000000000000000000000000040000000000000001000000100080000800020000000000000000000000000000000000001000000000000000000000000002000",
|
|
1272
|
-
"blockHash": "
|
|
1272
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e",
|
|
1273
1273
|
"transactionHash": "0xcb02a40eb220a8d0cb30392196f3c3bf58a283a200727b0b3c79983870bddab5",
|
|
1274
1274
|
"logs": [
|
|
1275
1275
|
{
|
|
@@ -1282,7 +1282,7 @@
|
|
|
1282
1282
|
],
|
|
1283
1283
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000096",
|
|
1284
1284
|
"logIndex": 0,
|
|
1285
|
-
"blockHash": "
|
|
1285
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1286
1286
|
},
|
|
1287
1287
|
{
|
|
1288
1288
|
"transactionIndex": 0,
|
|
@@ -1294,7 +1294,7 @@
|
|
|
1294
1294
|
],
|
|
1295
1295
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019",
|
|
1296
1296
|
"logIndex": 1,
|
|
1297
|
-
"blockHash": "
|
|
1297
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1298
1298
|
},
|
|
1299
1299
|
{
|
|
1300
1300
|
"transactionIndex": 0,
|
|
@@ -1306,7 +1306,7 @@
|
|
|
1306
1306
|
],
|
|
1307
1307
|
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033ec",
|
|
1308
1308
|
"logIndex": 2,
|
|
1309
|
-
"blockHash": "
|
|
1309
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1310
1310
|
},
|
|
1311
1311
|
{
|
|
1312
1312
|
"transactionIndex": 0,
|
|
@@ -1318,7 +1318,7 @@
|
|
|
1318
1318
|
],
|
|
1319
1319
|
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001039d",
|
|
1320
1320
|
"logIndex": 3,
|
|
1321
|
-
"blockHash": "
|
|
1321
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1322
1322
|
},
|
|
1323
1323
|
{
|
|
1324
1324
|
"transactionIndex": 0,
|
|
@@ -1330,7 +1330,7 @@
|
|
|
1330
1330
|
],
|
|
1331
1331
|
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033ec",
|
|
1332
1332
|
"logIndex": 4,
|
|
1333
|
-
"blockHash": "
|
|
1333
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1334
1334
|
},
|
|
1335
1335
|
{
|
|
1336
1336
|
"transactionIndex": 0,
|
|
@@ -1342,7 +1342,7 @@
|
|
|
1342
1342
|
],
|
|
1343
1343
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c7c905b505f0cf40ab6600d05e677f717916f6b",
|
|
1344
1344
|
"logIndex": 5,
|
|
1345
|
-
"blockHash": "
|
|
1345
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1346
1346
|
},
|
|
1347
1347
|
{
|
|
1348
1348
|
"transactionIndex": 0,
|
|
@@ -1357,7 +1357,7 @@
|
|
|
1357
1357
|
],
|
|
1358
1358
|
"data": "0x",
|
|
1359
1359
|
"logIndex": 6,
|
|
1360
|
-
"blockHash": "
|
|
1360
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1361
1361
|
},
|
|
1362
1362
|
{
|
|
1363
1363
|
"transactionIndex": 0,
|
|
@@ -1372,7 +1372,7 @@
|
|
|
1372
1372
|
],
|
|
1373
1373
|
"data": "0x",
|
|
1374
1374
|
"logIndex": 7,
|
|
1375
|
-
"blockHash": "
|
|
1375
|
+
"blockHash": "0xf39f8e604f03c4ff726d04888bba8fe806d06c234ae4202a0db811c25c15fe6e"
|
|
1376
1376
|
}
|
|
1377
1377
|
],
|
|
1378
1378
|
"blockNumber": 19,
|
|
@@ -750,7 +750,7 @@
|
|
|
750
750
|
"transactionIndex": 0,
|
|
751
751
|
"gasUsed": "1617384",
|
|
752
752
|
"logsBloom": "0x000000040000000008020000000000000a0000000000000080000000000000000000000000000000000000000001000000000000000000000200000010600000000000000000000000000000000000000010000000000000000000000001000000000800020000400000000000000800000000000000000000020000000000000000000000000000000000000000000000000000000008080000000000000000000000000020000000000000000000000000000004000000001000000000000000000000000000004000000000000000000200000000000100000000000020000000000000001000000000000000000001400000000000000000000000000000",
|
|
753
|
-
"blockHash": "
|
|
753
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37",
|
|
754
754
|
"transactionHash": "0xebcda2c70b5e49631d4a83bd96710fd1541e6dcd4236db8bb70b69e3fee9addc",
|
|
755
755
|
"logs": [
|
|
756
756
|
{
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
],
|
|
767
767
|
"data": "0x",
|
|
768
768
|
"logIndex": 0,
|
|
769
|
-
"blockHash": "
|
|
769
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
770
770
|
},
|
|
771
771
|
{
|
|
772
772
|
"transactionIndex": 0,
|
|
@@ -781,7 +781,7 @@
|
|
|
781
781
|
],
|
|
782
782
|
"data": "0x",
|
|
783
783
|
"logIndex": 1,
|
|
784
|
-
"blockHash": "
|
|
784
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
785
785
|
},
|
|
786
786
|
{
|
|
787
787
|
"transactionIndex": 0,
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
],
|
|
797
797
|
"data": "0x",
|
|
798
798
|
"logIndex": 2,
|
|
799
|
-
"blockHash": "
|
|
799
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
800
800
|
},
|
|
801
801
|
{
|
|
802
802
|
"transactionIndex": 0,
|
|
@@ -811,7 +811,7 @@
|
|
|
811
811
|
],
|
|
812
812
|
"data": "0x",
|
|
813
813
|
"logIndex": 3,
|
|
814
|
-
"blockHash": "
|
|
814
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
815
815
|
},
|
|
816
816
|
{
|
|
817
817
|
"transactionIndex": 0,
|
|
@@ -826,7 +826,7 @@
|
|
|
826
826
|
],
|
|
827
827
|
"data": "0x",
|
|
828
828
|
"logIndex": 4,
|
|
829
|
-
"blockHash": "
|
|
829
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
830
830
|
},
|
|
831
831
|
{
|
|
832
832
|
"transactionIndex": 0,
|
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
],
|
|
842
842
|
"data": "0x",
|
|
843
843
|
"logIndex": 5,
|
|
844
|
-
"blockHash": "
|
|
844
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
845
845
|
},
|
|
846
846
|
{
|
|
847
847
|
"transactionIndex": 0,
|
|
@@ -853,7 +853,7 @@
|
|
|
853
853
|
],
|
|
854
854
|
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a300",
|
|
855
855
|
"logIndex": 6,
|
|
856
|
-
"blockHash": "
|
|
856
|
+
"blockHash": "0xeed84cec4fd0c7051d9f3a2a294599cf2c6c682da3c0da5bcce46c9f76bafc37"
|
|
857
857
|
}
|
|
858
858
|
],
|
|
859
859
|
"blockNumber": 18,
|
|
@@ -517,7 +517,7 @@
|
|
|
517
517
|
"transactionIndex": 0,
|
|
518
518
|
"gasUsed": "1456351",
|
|
519
519
|
"logsBloom": "0x00000000000000000002000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000800020000000000000000000800000000000000000000000000000000400080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000001000000000000000000000000000000",
|
|
520
|
-
"blockHash": "
|
|
520
|
+
"blockHash": "0x60713300a320724739f6ac17767600a4c760dd0164cc3f4a1193e3c978fc6a5e",
|
|
521
521
|
"transactionHash": "0x29bb982ec127fc62fca6d1244b0ba6e91ee96b738babbc439bf41fcf8810330d",
|
|
522
522
|
"logs": [
|
|
523
523
|
{
|
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
],
|
|
533
533
|
"data": "0x",
|
|
534
534
|
"logIndex": 0,
|
|
535
|
-
"blockHash": "
|
|
535
|
+
"blockHash": "0x60713300a320724739f6ac17767600a4c760dd0164cc3f4a1193e3c978fc6a5e"
|
|
536
536
|
}
|
|
537
537
|
],
|
|
538
538
|
"blockNumber": 57,
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"transactionIndex": 0,
|
|
273
273
|
"gasUsed": "804148",
|
|
274
274
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
275
|
-
"blockHash": "
|
|
275
|
+
"blockHash": "0x867f32a3a1962d70a2b43c67b634436624cbdb5b846bb968eed9c29de444a109",
|
|
276
276
|
"transactionHash": "0x1fa2edd54ffe85f0c76ff2a5c2242c208fe52f4144b5a916cf7be8efa5dc44d4",
|
|
277
277
|
"logs": [],
|
|
278
278
|
"blockNumber": 10,
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"transactionIndex": 0,
|
|
273
273
|
"gasUsed": "804160",
|
|
274
274
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
275
|
-
"blockHash": "
|
|
275
|
+
"blockHash": "0xf2756efcac705ee4e9ff5d5abc1106f8553fc959646053b7bc2bc70b5f052707",
|
|
276
276
|
"transactionHash": "0xdc9a0b9fe0ff91fb7ccf6bc9f4d48430e56764f684f2d527e5ba8e327ade9260",
|
|
277
277
|
"logs": [],
|
|
278
278
|
"blockNumber": 11,
|
|
@@ -1891,7 +1891,7 @@
|
|
|
1891
1891
|
"transactionIndex": 0,
|
|
1892
1892
|
"gasUsed": "1047233",
|
|
1893
1893
|
"logsBloom": "0x00000000000000000000000000000000400000004040000000000000000000200040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000800000000000000000000000000000000000000000000000000000000800000000008000008000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000020000000020000000000040000000000000400000000000000000000000000000000000000000800000000000000000000000000000000000000000000",
|
|
1894
|
-
"blockHash": "
|
|
1894
|
+
"blockHash": "0x82ad3d1986c07b059bba3c954f317681ae3a5684431ba3c2c32f501bca7080c2",
|
|
1895
1895
|
"transactionHash": "0xd3807c6b6cb8d9004608d9d265db4ac1e40471b222356e454cb20ddc93230319",
|
|
1896
1896
|
"logs": [
|
|
1897
1897
|
{
|
|
@@ -1905,7 +1905,7 @@
|
|
|
1905
1905
|
],
|
|
1906
1906
|
"data": "0x",
|
|
1907
1907
|
"logIndex": 0,
|
|
1908
|
-
"blockHash": "
|
|
1908
|
+
"blockHash": "0x82ad3d1986c07b059bba3c954f317681ae3a5684431ba3c2c32f501bca7080c2"
|
|
1909
1909
|
},
|
|
1910
1910
|
{
|
|
1911
1911
|
"transactionIndex": 0,
|
|
@@ -1917,7 +1917,7 @@
|
|
|
1917
1917
|
],
|
|
1918
1918
|
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c8",
|
|
1919
1919
|
"logIndex": 1,
|
|
1920
|
-
"blockHash": "
|
|
1920
|
+
"blockHash": "0x82ad3d1986c07b059bba3c954f317681ae3a5684431ba3c2c32f501bca7080c2"
|
|
1921
1921
|
},
|
|
1922
1922
|
{
|
|
1923
1923
|
"transactionIndex": 0,
|
|
@@ -1929,7 +1929,7 @@
|
|
|
1929
1929
|
],
|
|
1930
1930
|
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
1931
1931
|
"logIndex": 2,
|
|
1932
|
-
"blockHash": "
|
|
1932
|
+
"blockHash": "0x82ad3d1986c07b059bba3c954f317681ae3a5684431ba3c2c32f501bca7080c2"
|
|
1933
1933
|
},
|
|
1934
1934
|
{
|
|
1935
1935
|
"transactionIndex": 0,
|
|
@@ -1941,7 +1941,7 @@
|
|
|
1941
1941
|
],
|
|
1942
1942
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000afdacd509e73115ea1654b1a770f1a807e7c9c0",
|
|
1943
1943
|
"logIndex": 3,
|
|
1944
|
-
"blockHash": "
|
|
1944
|
+
"blockHash": "0x82ad3d1986c07b059bba3c954f317681ae3a5684431ba3c2c32f501bca7080c2"
|
|
1945
1945
|
}
|
|
1946
1946
|
],
|
|
1947
1947
|
"blockNumber": 44,
|
|
@@ -1963,7 +1963,7 @@
|
|
|
1963
1963
|
"transactionIndex": 0,
|
|
1964
1964
|
"gasUsed": "3938527",
|
|
1965
1965
|
"logsBloom": "0x00000000000000000002000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000002000800020000000000000000000800000000000000000000000000000000400000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000001000002000000000000000000000000",
|
|
1966
|
-
"blockHash": "
|
|
1966
|
+
"blockHash": "0x85f576c08af222b5e38c845d999878700eb8c9646ca49a30f44fc163acba8adb",
|
|
1967
1967
|
"transactionHash": "0xd74f80e4f5e2effb2c65d08d07dd067de2196118911bc5019a89b375ffeac7c7",
|
|
1968
1968
|
"logs": [
|
|
1969
1969
|
{
|
|
@@ -1978,7 +1978,7 @@
|
|
|
1978
1978
|
],
|
|
1979
1979
|
"data": "0x",
|
|
1980
1980
|
"logIndex": 0,
|
|
1981
|
-
"blockHash": "
|
|
1981
|
+
"blockHash": "0x85f576c08af222b5e38c845d999878700eb8c9646ca49a30f44fc163acba8adb"
|
|
1982
1982
|
}
|
|
1983
1983
|
],
|
|
1984
1984
|
"blockNumber": 48,
|
package/artifacts/Wallets.json
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"transactionIndex": 0,
|
|
112
112
|
"gasUsed": "911756",
|
|
113
113
|
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
114
|
-
"blockHash": "
|
|
114
|
+
"blockHash": "0xcddacca72d12df5c4e9e104b2959dbcfa743d13f652e575232a33e4ba441665c",
|
|
115
115
|
"transactionHash": "0x83f7c682168e4a50da2f0537a48ccf82131afb601908fb34e9c5000ca171df2c",
|
|
116
116
|
"logs": [],
|
|
117
117
|
"blockNumber": 63,
|
|
@@ -14,7 +14,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|
|
14
14
|
// For local tests use `1`.
|
|
15
15
|
const txProofDifficultyFactor =
|
|
16
16
|
deployments.getNetworkName() === "hardhat" ||
|
|
17
|
-
deployments.getNetworkName() === "development"
|
|
17
|
+
deployments.getNetworkName() === "development" ||
|
|
18
|
+
deployments.getNetworkName() === "system_tests"
|
|
18
19
|
? 1
|
|
19
20
|
: 6
|
|
20
21
|
|
|
@@ -90,7 +90,8 @@ var func = function (hre) {
|
|
|
90
90
|
case 5:
|
|
91
91
|
ReimbursementPool = _h.sent();
|
|
92
92
|
txProofDifficultyFactor = deployments.getNetworkName() === "hardhat" ||
|
|
93
|
-
deployments.getNetworkName() === "development"
|
|
93
|
+
deployments.getNetworkName() === "development" ||
|
|
94
|
+
deployments.getNetworkName() === "system_tests"
|
|
94
95
|
? 1
|
|
95
96
|
: 6;
|
|
96
97
|
deployOptions = {
|
|
@@ -37,11 +37,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
40
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
44
|
var config_1 = require("hardhat/config");
|
|
42
45
|
var staking_1 = require("../test/integration/utils/staking");
|
|
43
46
|
var ecdsa_wallet_registry_1 = require("../test/integration/utils/ecdsa-wallet-registry");
|
|
44
|
-
|
|
47
|
+
var integration_1 = require("../test/integration/data/integration");
|
|
48
|
+
var bls_1 = __importDefault(require("../test/integration/data/bls"));
|
|
49
|
+
var random_beacon_1 = require("../test/integration/utils/random-beacon");
|
|
50
|
+
(0, config_1.task)("test-utils:register-operators", "Registers operators in the sortition pools")
|
|
45
51
|
.addOptionalParam("numberOfOperators", "Number of operators to register", 110, config_1.types.int)
|
|
46
52
|
.addOptionalParam("unnamedSignersOffset", "Offset indicating the unnamed signers", 0, config_1.types.int)
|
|
47
53
|
.addOptionalParam("stakeAmount", "Amount of each operator's stake", "40000000000000000000000", config_1.types.string)
|
|
@@ -75,35 +81,58 @@ var ecdsa_wallet_registry_1 = require("../test/integration/utils/ecdsa-wallet-re
|
|
|
75
81
|
}); });
|
|
76
82
|
function registerOperators(hre, numberOfOperators, unnamedSignersOffset, stakeAmount) {
|
|
77
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var helpers, walletRegistry,
|
|
79
|
-
return __generator(this, function (
|
|
80
|
-
switch (
|
|
84
|
+
var helpers, chaosnetOwner, walletRegistry, ecdsaSortitionPool, t, staking, randomBeacon, beaconSortitionPool, signers, i, owner, stakingProvider, operator, beneficiary, authorizer, _a, _b;
|
|
85
|
+
return __generator(this, function (_c) {
|
|
86
|
+
switch (_c.label) {
|
|
81
87
|
case 0:
|
|
82
88
|
helpers = hre.helpers;
|
|
83
|
-
return [4 /*yield*/, helpers.
|
|
89
|
+
return [4 /*yield*/, helpers.signers.getNamedSigners()];
|
|
84
90
|
case 1:
|
|
85
|
-
|
|
86
|
-
return [4 /*yield*/, helpers.contracts.getContract("
|
|
91
|
+
chaosnetOwner = (_c.sent()).chaosnetOwner;
|
|
92
|
+
return [4 /*yield*/, helpers.contracts.getContract("WalletRegistry")];
|
|
87
93
|
case 2:
|
|
88
|
-
|
|
89
|
-
return [4 /*yield*/, helpers.contracts.getContract("
|
|
94
|
+
walletRegistry = _c.sent();
|
|
95
|
+
return [4 /*yield*/, helpers.contracts.getContract("EcdsaSortitionPool")];
|
|
90
96
|
case 3:
|
|
91
|
-
|
|
92
|
-
return [4 /*yield*/, helpers.contracts.getContract("
|
|
97
|
+
ecdsaSortitionPool = _c.sent();
|
|
98
|
+
return [4 /*yield*/, helpers.contracts.getContract("T")];
|
|
93
99
|
case 4:
|
|
94
|
-
|
|
95
|
-
return [4 /*yield*/, helpers.
|
|
100
|
+
t = _c.sent();
|
|
101
|
+
return [4 /*yield*/, helpers.contracts.getContract("TokenStaking")];
|
|
96
102
|
case 5:
|
|
97
|
-
|
|
103
|
+
staking = _c.sent();
|
|
104
|
+
return [4 /*yield*/, ecdsaSortitionPool.isChaosnetActive()];
|
|
105
|
+
case 6:
|
|
106
|
+
if (!_c.sent()) return [3 /*break*/, 8];
|
|
107
|
+
return [4 /*yield*/, ecdsaSortitionPool.connect(chaosnetOwner).deactivateChaosnet()];
|
|
108
|
+
case 7:
|
|
109
|
+
_c.sent();
|
|
110
|
+
_c.label = 8;
|
|
111
|
+
case 8: return [4 /*yield*/, helpers.contracts.getContract("RandomBeacon")];
|
|
112
|
+
case 9:
|
|
113
|
+
randomBeacon = _c.sent();
|
|
114
|
+
return [4 /*yield*/, helpers.contracts.getContract("BeaconSortitionPool")];
|
|
115
|
+
case 10:
|
|
116
|
+
beaconSortitionPool = _c.sent();
|
|
117
|
+
return [4 /*yield*/, beaconSortitionPool.isChaosnetActive()];
|
|
118
|
+
case 11:
|
|
119
|
+
if (!_c.sent()) return [3 /*break*/, 13];
|
|
120
|
+
return [4 /*yield*/, beaconSortitionPool.connect(chaosnetOwner).deactivateChaosnet()];
|
|
121
|
+
case 12:
|
|
122
|
+
_c.sent();
|
|
123
|
+
_c.label = 13;
|
|
124
|
+
case 13: return [4 /*yield*/, helpers.signers.getUnnamedSigners()];
|
|
125
|
+
case 14:
|
|
126
|
+
signers = (_c.sent()).slice(unnamedSignersOffset);
|
|
98
127
|
// We use unique accounts for each staking role for each operator.
|
|
99
128
|
if (signers.length < numberOfOperators * 5) {
|
|
100
129
|
throw new Error("not enough unnamed signers; update hardhat network's configuration account count");
|
|
101
130
|
}
|
|
102
131
|
console.log("Starting registration of ".concat(numberOfOperators, " operators"));
|
|
103
132
|
i = 0;
|
|
104
|
-
|
|
105
|
-
case
|
|
106
|
-
if (!(i < numberOfOperators)) return [3 /*break*/,
|
|
133
|
+
_c.label = 15;
|
|
134
|
+
case 15:
|
|
135
|
+
if (!(i < numberOfOperators)) return [3 /*break*/, 24];
|
|
107
136
|
owner = signers[i];
|
|
108
137
|
stakingProvider = signers[1 * numberOfOperators + i];
|
|
109
138
|
operator = signers[2 * numberOfOperators + i];
|
|
@@ -111,19 +140,32 @@ function registerOperators(hre, numberOfOperators, unnamedSignersOffset, stakeAm
|
|
|
111
140
|
authorizer = signers[4 * numberOfOperators + i];
|
|
112
141
|
console.log("Registering operator ".concat(i, " with address ").concat(operator.address));
|
|
113
142
|
return [4 /*yield*/, (0, staking_1.stake)(hre, t, staking, stakeAmount, owner, stakingProvider.address, beneficiary.address, authorizer.address)];
|
|
114
|
-
case
|
|
115
|
-
|
|
143
|
+
case 16:
|
|
144
|
+
_c.sent();
|
|
116
145
|
return [4 /*yield*/, (0, staking_1.authorizeApplication)(staking, walletRegistry.address, authorizer, stakingProvider.address, stakeAmount)];
|
|
117
|
-
case
|
|
118
|
-
|
|
119
|
-
return [4 /*yield*/, (0,
|
|
120
|
-
case
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
case
|
|
146
|
+
case 17:
|
|
147
|
+
_c.sent();
|
|
148
|
+
return [4 /*yield*/, (0, staking_1.authorizeApplication)(staking, randomBeacon.address, authorizer, stakingProvider.address, stakeAmount)];
|
|
149
|
+
case 18:
|
|
150
|
+
_c.sent();
|
|
151
|
+
return [4 /*yield*/, (0, ecdsa_wallet_registry_1.registerOperator)(walletRegistry, ecdsaSortitionPool, stakingProvider, operator)];
|
|
152
|
+
case 19:
|
|
153
|
+
_c.sent();
|
|
154
|
+
_b = (_a = randomBeacon
|
|
155
|
+
.connect(stakingProvider))
|
|
156
|
+
.registerOperator;
|
|
157
|
+
return [4 /*yield*/, operator.getAddress()];
|
|
158
|
+
case 20: return [4 /*yield*/, _b.apply(_a, [_c.sent()])];
|
|
159
|
+
case 21:
|
|
160
|
+
_c.sent();
|
|
161
|
+
return [4 /*yield*/, randomBeacon.connect(operator).joinSortitionPool()];
|
|
162
|
+
case 22:
|
|
163
|
+
_c.sent();
|
|
164
|
+
_c.label = 23;
|
|
165
|
+
case 23:
|
|
124
166
|
i++;
|
|
125
|
-
return [3 /*break*/,
|
|
126
|
-
case
|
|
167
|
+
return [3 /*break*/, 15];
|
|
168
|
+
case 24:
|
|
127
169
|
console.log("Registered ".concat(numberOfOperators, " sortition pool operators"));
|
|
128
170
|
return [2 /*return*/];
|
|
129
171
|
}
|
|
@@ -132,23 +174,71 @@ function registerOperators(hre, numberOfOperators, unnamedSignersOffset, stakeAm
|
|
|
132
174
|
}
|
|
133
175
|
function createWallet(hre, walletPublicKey) {
|
|
134
176
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var ethers, helpers, governance, bridge, walletRegistry, walletRegistryGovernance, requestNewWalletTx;
|
|
136
|
-
return __generator(this, function (
|
|
137
|
-
switch (
|
|
177
|
+
var ethers, helpers, governance, bridge, walletRegistry, walletRegistryGovernance, randomBeacon, randomBeaconGovernance, genesisTx, genesisBlock, genesisSeed, sortitionPool, signers, _a, members, signingMembersIndices, signaturesBytes, membersHash, dkgResult, submitter, requestNewWalletTx;
|
|
178
|
+
return __generator(this, function (_b) {
|
|
179
|
+
switch (_b.label) {
|
|
138
180
|
case 0:
|
|
139
181
|
ethers = hre.ethers, helpers = hre.helpers;
|
|
140
182
|
return [4 /*yield*/, helpers.signers.getNamedSigners()];
|
|
141
183
|
case 1:
|
|
142
|
-
governance = (
|
|
184
|
+
governance = (_b.sent()).governance;
|
|
143
185
|
return [4 /*yield*/, helpers.contracts.getContract("Bridge")];
|
|
144
186
|
case 2:
|
|
145
|
-
bridge =
|
|
187
|
+
bridge = _b.sent();
|
|
146
188
|
return [4 /*yield*/, helpers.contracts.getContract("WalletRegistry")];
|
|
147
189
|
case 3:
|
|
148
|
-
walletRegistry =
|
|
190
|
+
walletRegistry = _b.sent();
|
|
149
191
|
return [4 /*yield*/, helpers.contracts.getContract("WalletRegistryGovernance")];
|
|
150
192
|
case 4:
|
|
151
|
-
walletRegistryGovernance =
|
|
193
|
+
walletRegistryGovernance = _b.sent();
|
|
194
|
+
return [4 /*yield*/, helpers.contracts.getContract("RandomBeacon")];
|
|
195
|
+
case 5:
|
|
196
|
+
randomBeacon = _b.sent();
|
|
197
|
+
return [4 /*yield*/, helpers.contracts.getContract("RandomBeaconGovernance")];
|
|
198
|
+
case 6:
|
|
199
|
+
randomBeaconGovernance = _b.sent();
|
|
200
|
+
return [4 /*yield*/, (0, random_beacon_1.updateDkgResultChallengePeriodLength)(hre, governance, randomBeaconGovernance)];
|
|
201
|
+
case 7:
|
|
202
|
+
_b.sent();
|
|
203
|
+
return [4 /*yield*/, randomBeacon.genesis()];
|
|
204
|
+
case 8:
|
|
205
|
+
genesisTx = _b.sent();
|
|
206
|
+
genesisBlock = genesisTx.blockNumber;
|
|
207
|
+
return [4 /*yield*/, (0, random_beacon_1.getGenesisSeed)(hre, genesisBlock)];
|
|
208
|
+
case 9:
|
|
209
|
+
genesisSeed = _b.sent();
|
|
210
|
+
return [4 /*yield*/, helpers.time.mineBlocksTo(genesisBlock + integration_1.offchainDkgTime + 1)];
|
|
211
|
+
case 10:
|
|
212
|
+
_b.sent();
|
|
213
|
+
return [4 /*yield*/, helpers.contracts.getContract("BeaconSortitionPool")];
|
|
214
|
+
case 11:
|
|
215
|
+
sortitionPool = _b.sent();
|
|
216
|
+
return [4 /*yield*/, (0, random_beacon_1.selectGroup)(hre, sortitionPool, genesisSeed)];
|
|
217
|
+
case 12:
|
|
218
|
+
signers = _b.sent();
|
|
219
|
+
return [4 /*yield*/, (0, random_beacon_1.signDkgResult)(hre, signers, bls_1.default.groupPubKey, [], genesisBlock, 33)];
|
|
220
|
+
case 13:
|
|
221
|
+
_a = _b.sent(), members = _a.members, signingMembersIndices = _a.signingMembersIndices, signaturesBytes = _a.signaturesBytes;
|
|
222
|
+
membersHash = (0, random_beacon_1.hashDKGMembers)(hre, members, []);
|
|
223
|
+
dkgResult = {
|
|
224
|
+
submitterMemberIndex: 1,
|
|
225
|
+
groupPubKey: bls_1.default.groupPubKey,
|
|
226
|
+
misbehavedMembersIndices: [],
|
|
227
|
+
signatures: signaturesBytes,
|
|
228
|
+
signingMembersIndices: signingMembersIndices,
|
|
229
|
+
members: members,
|
|
230
|
+
membersHash: membersHash,
|
|
231
|
+
};
|
|
232
|
+
submitter = signers[0].signer;
|
|
233
|
+
return [4 /*yield*/, randomBeacon.connect(submitter).submitDkgResult(dkgResult)];
|
|
234
|
+
case 14:
|
|
235
|
+
_b.sent();
|
|
236
|
+
return [4 /*yield*/, helpers.time.mineBlocks(integration_1.dkgResultChallengePeriodLength + 1)];
|
|
237
|
+
case 15:
|
|
238
|
+
_b.sent();
|
|
239
|
+
return [4 /*yield*/, randomBeacon.connect(submitter).approveDkgResult(dkgResult)];
|
|
240
|
+
case 16:
|
|
241
|
+
_b.sent();
|
|
152
242
|
return [4 /*yield*/, bridge.requestNewWallet({
|
|
153
243
|
txHash: ethers.constants.HashZero,
|
|
154
244
|
txOutputIndex: 0,
|
|
@@ -158,8 +248,8 @@ function createWallet(hre, walletPublicKey) {
|
|
|
158
248
|
// task environment. In order to provide a relay entry to the registry, we
|
|
159
249
|
// set the governance as the random beacon and provide a relay entry as usual.
|
|
160
250
|
];
|
|
161
|
-
case
|
|
162
|
-
requestNewWalletTx =
|
|
251
|
+
case 17:
|
|
252
|
+
requestNewWalletTx = _b.sent();
|
|
163
253
|
// Using smock to make a fake RandomBeacon instance does not work in the
|
|
164
254
|
// task environment. In order to provide a relay entry to the registry, we
|
|
165
255
|
// set the governance as the random beacon and provide a relay entry as usual.
|
|
@@ -168,21 +258,21 @@ function createWallet(hre, walletPublicKey) {
|
|
|
168
258
|
.upgradeRandomBeacon(governance.address)
|
|
169
259
|
// eslint-disable-next-line no-underscore-dangle
|
|
170
260
|
];
|
|
171
|
-
case
|
|
261
|
+
case 18:
|
|
172
262
|
// Using smock to make a fake RandomBeacon instance does not work in the
|
|
173
263
|
// task environment. In order to provide a relay entry to the registry, we
|
|
174
264
|
// set the governance as the random beacon and provide a relay entry as usual.
|
|
175
|
-
|
|
265
|
+
_b.sent();
|
|
176
266
|
// eslint-disable-next-line no-underscore-dangle
|
|
177
267
|
return [4 /*yield*/, walletRegistry
|
|
178
268
|
.connect(governance)
|
|
179
269
|
.__beaconCallback(ethers.utils.randomBytes(32), 0)];
|
|
180
|
-
case
|
|
270
|
+
case 19:
|
|
181
271
|
// eslint-disable-next-line no-underscore-dangle
|
|
182
|
-
|
|
272
|
+
_b.sent();
|
|
183
273
|
return [4 /*yield*/, (0, ecdsa_wallet_registry_1.performEcdsaDkg)(hre, walletRegistry, walletPublicKey, requestNewWalletTx.blockNumber)];
|
|
184
|
-
case
|
|
185
|
-
|
|
274
|
+
case 20:
|
|
275
|
+
_b.sent();
|
|
186
276
|
console.log("Created wallet with public key ".concat(walletPublicKey));
|
|
187
277
|
return [2 /*return*/];
|
|
188
278
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var blsData = {
|
|
4
|
+
// data generated using master secret key 123
|
|
5
|
+
secretKey: 123,
|
|
6
|
+
// altbn128 public key for secret key 123. For implementation details refer to bls_test.go
|
|
7
|
+
groupPubKey: "0x1f1954b33144db2b5c90da089e8bde287ec7089d5d6433f3b6becaefdb678b1b2a9de3" +
|
|
8
|
+
"8d14bef2cf9afc3c698a4211fa7ada7b4f036a2dfef0dc122b423259d01659dc18b57722" +
|
|
9
|
+
"ecf6a4beb4d04dfe780a660c4c3bb2b165ab8486114c464c621bf37ecdba226629c20908" +
|
|
10
|
+
"c7f475c5b3a7628ce26d696436eab0b0148034dfcd",
|
|
11
|
+
};
|
|
12
|
+
exports.default = blsData;
|