BitSharp.Core.Test.TestBlocks.TestBlocks C# (CSharp) Method

TestBlocks() public method

public TestBlocks ( BitSharp.Core.Domain.Block genesisBlock = null ) : BitSharp.Common
genesisBlock BitSharp.Core.Domain.Block
return BitSharp.Common
        public TestBlocks(Block genesisBlock = null)
        {
            // create the key pair that block rewards will be sent to
            var keyPair = txManager.CreateKeyPair();
            coinbasePrivateKey = keyPair.Item1;
            coinbasePublicKey = keyPair.Item2;

            // create and mine the genesis block
            genesisBlock = genesisBlock ?? MineEmptyBlock(UInt256.Zero);

            // initialize unit test rules
            rules = new UnitTestRules()
            {
                // disable execution of rules validation
                ValidateTransactionAction = (_, __) => { },
                ValidationTransactionScriptAction = (_, __, ___, ____, _____) => { }
            };
            ChainParams.SetGenesisBlock(genesisBlock);

            blocks.Add(genesisBlock);
            chain.AddBlock(ChainParams.GenesisChainedHeader);
        }

Same methods

TestBlocks::TestBlocks ( TestBlocks parent ) : BitSharp.Common