Ejemplo n.º 1
0
        public void TxTest(IUtxoDatabase utxoDb, IMemoryPool mempool, IConsensus consensus, ITransaction tx, bool isCoinbase)
        {
            var verifier = new TransactionVerifier(false, utxoDb, mempool, consensus);

            bool b = isCoinbase ?
                     verifier.VerifyCoinbasePrimary(tx, out string error) :
                     verifier.Verify(tx, out error);

            Assert.False(b, TxValidTests.BuildErrorStr(tx, error));
            Assert.NotNull(error);
        }
Ejemplo n.º 2
0
        public void VerifyCoinbasePrimaryTest(IConsensus consensus, ITransaction tx, bool expB, string expErr, int expOpCount)
        {
            var verifier = new TransactionVerifier(false, new MockUtxoDatabase(), new MockMempool(null), consensus);

            bool actualB = verifier.VerifyCoinbasePrimary(tx, out string error);

            Assert.Equal(expB, actualB);
            Assert.Equal(expErr, error);
            Assert.Equal(expOpCount, verifier.TotalSigOpCount);
            Assert.Equal(0UL, verifier.TotalFee);
        }