src/Stratis.FederatedPeg.Tests/CrossChainTestBase.cs
/// <summary>
/// Create a block and add it to the dictionary used by the mock block repository.
/// </summary>
/// <param name="transactions">Additional transactions to add to the block.</param>
/// <returns>The last chained header.</returns>
Create a block and add it to the dictionary used by the mock block repository.
Create a block and add it to the dictionary used by the mock block repository .
protected ChainedHeader AppendBlock(params Transaction[] transactions)
        {
            Block block = this.network.CreateBlock();
            block.AddTransaction(this.network.CreateTransaction());
            foreach (Transaction transaction in transactions)
            {
                block.AddTransaction(transaction);
            }
            block.UpdateMerkleRoot();
            block.Header.HashPrevBlock = this.chain.Tip.HashBlock;
            block.Header.Nonce = RandomUtils.GetUInt32();
            return AppendBlock(block);
        }
protected ChainedHeader AppendBlock ( params Transaction [ ] transactions ) { Block block = this . network . CreateBlock ( ) ; block . AddTransaction ( this . network . CreateTransaction ( ) ) ; foreach ( Transaction transaction in transactions ) { block . AddTransaction ( transaction ) ; } block . UpdateMerkleRoot ( ) ; block . Header . HashPrevBlock = this . chain . Tip . HashBlock ; block . Header . Nonce = RandomUtils . GetUInt32 ( ) ; return AppendBlock ( block ) ; }
Create a block and add it to the dictionary used by the mock block repository.
Create a block and add it to the dictionary used by the mock block repository .
// Create coinbase. // Add additional transactions if any.
The last chained header.
The last chained header .
transactions
Additional transactions to add to the block.
Additional transactions to add to the block .