1616mod builder;
1717mod checkpoints;
1818pub mod emission_schedule;
19+ pub mod regtest;
1920pub use builder:: Builder ;
2021use crypto:: key:: PublicKey ;
2122use crypto:: vrf:: VRFPublicKey ;
@@ -28,14 +29,13 @@ use crate::chain::block::timestamp::BlockTimestamp;
2829use crate :: chain:: transaction:: Destination ;
2930use crate :: chain:: upgrades:: NetUpgrades ;
3031use crate :: chain:: TxOutput ;
31- use crate :: chain:: { GenBlock , Genesis , PoolId } ;
32+ use crate :: chain:: { GenBlock , Genesis } ;
3233use crate :: chain:: { PoWChainConfig , UpgradeVersion } ;
3334use crate :: primitives:: id:: { Id , Idable , WithId } ;
3435use crate :: primitives:: per_thousand:: PerThousand ;
3536use crate :: primitives:: semver:: SemVer ;
3637use crate :: primitives:: { Amount , BlockDistance , BlockHeight , H256 } ;
3738use crypto:: key:: hdkd:: { child_number:: ChildNumber , u31:: U31 } ;
38- use crypto:: { key:: PrivateKey , vrf:: VRFPrivateKey } ;
3939use std:: num:: NonZeroU64 ;
4040use std:: sync:: Arc ;
4141use std:: time:: Duration ;
@@ -597,73 +597,6 @@ fn create_testnet_genesis() -> Genesis {
597597 )
598598}
599599
600- pub fn regtest_genesis_values ( ) -> (
601- PoolId ,
602- Box < StakePoolData > ,
603- PrivateKey ,
604- PublicKey ,
605- VRFPrivateKey ,
606- VRFPublicKey ,
607- ) {
608- let genesis_pool_id =
609- decode_hex :: < PoolId > ( "123c4c600097c513e088b9be62069f0c74c7671c523c8e3469a1c3f14b7ea2c4" ) ;
610-
611- let genesis_stake_private_key = decode_hex :: < PrivateKey > (
612- "008717e6946febd3a33ccdc3f3a27629ec80c33461c33a0fc56b4836fcedd26638" ,
613- ) ;
614-
615- let genesis_stake_public_key = decode_hex :: < PublicKey > (
616- "0003c53526caf73cd990148e127cb57249a5e266d78df23968642c976a532197fdaa" ,
617- ) ;
618-
619- let genesis_vrf_private_key = decode_hex :: < VRFPrivateKey > ( "003fcf7b813bec2a293f574b842988895278b396dd72471de2583b242097a59f06e9f3cd7b78d45750afd17292031373fddb5e7a8090db51221038f5e05f29998e" ) ;
620-
621- let genesis_vrf_public_key = decode_hex :: < VRFPublicKey > (
622- "00fa2f59dc7a7e176058e4f2d155cfa03ee007340e0285447892158823d332f744" ,
623- ) ;
624-
625- let genesis_pool_stake_data = Box :: new ( StakePoolData :: new (
626- MIN_STAKE_POOL_PLEDGE ,
627- Destination :: PublicKey ( genesis_stake_public_key. clone ( ) ) ,
628- genesis_vrf_public_key. clone ( ) ,
629- Destination :: PublicKey ( genesis_stake_public_key. clone ( ) ) ,
630- PerThousand :: new ( 1000 ) . expect ( "Valid per thousand" ) ,
631- Amount :: ZERO ,
632- ) ) ;
633-
634- (
635- genesis_pool_id,
636- genesis_pool_stake_data,
637- genesis_stake_private_key,
638- genesis_stake_public_key,
639- genesis_vrf_private_key,
640- genesis_vrf_public_key,
641- )
642- }
643-
644- pub fn create_regtest_pos_genesis ( premine_destination : Destination ) -> Genesis {
645- let (
646- genesis_pool_id,
647- genesis_stake_pool_data,
648- _genesis_stake_private_key,
649- _genesis_stake_public_key,
650- _genesis_vrf_private_key,
651- _genesis_vrf_public_key,
652- ) = regtest_genesis_values ( ) ;
653-
654- let create_genesis_pool_txoutput =
655- TxOutput :: CreateStakePool ( genesis_pool_id, genesis_stake_pool_data) ;
656-
657- let premine_output =
658- TxOutput :: Transfer ( OutputValue :: Coin ( DEFAULT_INITIAL_MINT ) , premine_destination) ;
659-
660- Genesis :: new (
661- String :: new ( ) ,
662- BlockTimestamp :: from_int_seconds ( 1639975460 ) ,
663- vec ! [ premine_output, create_genesis_pool_txoutput] ,
664- )
665- }
666-
667600fn create_unit_test_genesis ( premine_destination : Destination ) -> Genesis {
668601 let genesis_message = String :: new ( ) ;
669602
0 commit comments