コード例 #1
0
ファイル: UT_IssueTransaction.cs プロジェクト: ys8090/NEU
 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)));
 }
コード例 #2
0
ファイル: UT_IssueTransaction.cs プロジェクト: vcgato29/XCoin
        public void GetScriptHashesForVerifying_ThrowsException_NullAsset()
        {
            TestUtils.SetupTestBlockchain(UInt256.Zero);
            uut = TestUtils.GetIssueTransaction(false, 10, UInt256.Zero);
            Action test = () => uut.GetScriptHashesForVerifying();

            test.ShouldThrow <InvalidOperationException>();
        }
コード例 #3
0
 public void GetScriptHashesForVerifying_Ordered()
 {
     TestUtils.SetupTestBlockchain(UInt256.Zero);
     uut = new IssueTransaction
     {
         Attributes = new TransactionAttribute[0],
         Inputs     = new CoinReference[0],
         Outputs    = new[]
         {
             new TransactionOutput
             {
                 AssetId    = Blockchain.UtilityToken.Hash,
                 Value      = Fixed8.FromDecimal(10),
                 ScriptHash = Contract.CreateMultiSigRedeemScript(1, TestUtils.StandbyValidators).ToScriptHash()
             },
             new TransactionOutput
             {
                 AssetId    = Blockchain.GoverningToken.Hash,
                 Value      = Fixed8.FromDecimal(10),
                 ScriptHash = Contract.CreateMultiSigRedeemScript(1, TestUtils.StandbyValidators).ToScriptHash()
             },
         },
         Scripts = new[]
         {
             new Witness
             {
                 InvocationScript   = new byte[0],
                 VerificationScript = new[] { (byte)OpCode.PUSHT }
             }
         }
     };
     UInt160[] res = uut.GetScriptHashesForVerifying();
     res.Length.Should().Be(2);
     res[0].Should().Be(new UInt160(TestUtils.GetByteArray(20, 0x9b)));
     res[1].Should().Be(new UInt160(TestUtils.GetByteArray(20, 0xe7)));
 }