Exemple #1
0
        public void SystemFee_Get_Version_0_Coin()
        {
            uut         = TestUtils.GetIssueTransaction(false, 10, Blockchain.UtilityToken.Hash);
            uut.Version = 0;

            uut.SystemFee.Should().Be(Fixed8.Zero);
        }
Exemple #2
0
        public void SystemFee_Get_Version_0_OtherAsset()
        {
            uut         = TestUtils.GetIssueTransaction(false, 10, new UInt256(TestUtils.GetByteArray(32, 0x42)));
            uut.Version = 0;

            uut.SystemFee.Should().Be(Fixed8.FromDecimal(500));
        }
Exemple #3
0
        public void GetScriptHashesForVerifying_ThrowsException_NullAsset()
        {
            TestUtils.SetupTestBlockchain(UInt256.Zero);
            uut = TestUtils.GetIssueTransaction(false, 10, UInt256.Zero);
            Action test = () => uut.GetScriptHashesForVerifying();

            test.ShouldThrow <InvalidOperationException>();
        }
Exemple #4
0
 public void GetScriptHashesForVerifying()
 {
     TestUtils.SetupTestBlockchain(UInt256.Zero);
     uut = TestUtils.GetIssueTransaction(false, 10, Blockchain.UtilityToken.Hash);
     UInt160[] res = uut.GetScriptHashesForVerifying();
     res.Length.Should().Be(1);
     res[0].Should().Be(new UInt160(TestUtils.GetByteArray(20, 0xe7)));
 }
Exemple #5
0
        public void CalculateNetFee_SystemFee()
        {
            UInt256 val256 = UInt256.Zero;
            UInt256 merkRootVal;
            UInt160 val160;
            uint    timestampVal, indexVal;
            ulong   consensusDataVal;
            Witness scriptVal;

            Transaction[] transactionsVal;
            TestUtils.SetupBlockWithValues(uut, val256, out merkRootVal, out val160, out timestampVal, out indexVal, out consensusDataVal, out scriptVal, out transactionsVal, 0);

            uut.Transactions = new Transaction[1] {
                TestUtils.GetIssueTransaction(true, 0, new UInt256(TestUtils.GetByteArray(32, 0x42)))
            };

            Block.CalculateNetFee(uut.Transactions).Should().Be(Fixed8.FromDecimal(-500));
        }