private ChainedHeaderBlock CreateBlockWithVotingData(List <VotingData> data, int height)
        {
            var votingData = new List <byte>(VotingDataEncoder.VotingOutputPrefixBytes);

            votingData.AddRange(this.encoder.Encode(data));

            var votingOutputScript = new Script(OpcodeType.OP_RETURN, Op.GetPushOp(votingData.ToArray()));

            Transaction tx = this.network.CreateTransaction();

            tx.AddOutput(Money.COIN, votingOutputScript);

            Block block = PoaTestHelper.CreateBlock(this.network, tx, height);

            return(new ChainedHeaderBlock(block, new ChainedHeader(block.Header, block.GetHash(), height)));
        }
        private ChainedHeaderBlock CreateBlockWithVotingRequest(JoinFederationRequest votingRequest, int height)
        {
            var encoder = new JoinFederationRequestEncoder();

            var votingRequestData = new List <byte>();

            votingRequestData.AddRange(encoder.Encode(votingRequest));

            var votingRequestOutputScript = new Script(OpcodeType.OP_RETURN, Op.GetPushOp(votingRequestData.ToArray()));

            Transaction tx = this.network.CreateTransaction();

            tx.AddOutput(Money.COIN, votingRequestOutputScript);

            Block block = PoaTestHelper.CreateBlock(this.network, tx, height);

            return(new ChainedHeaderBlock(block, new ChainedHeader(block.Header, block.GetHash(), height)));
        }