Example #1
0
        private static Transaction CreateValidTx(DataCache snapshot, NEP6Wallet wallet, UInt160 account, uint nonce)
        {
            var tx = wallet.MakeTransaction(snapshot, new TransferOutput[]
            {
                new TransferOutput()
                {
                    AssetId    = NativeContract.GAS.Hash,
                    ScriptHash = account,
                    Value      = new BigDecimal(BigInteger.One, 8)
                }
            },
                                            account);

            tx.Nonce = nonce;

            var data = new ContractParametersContext(snapshot, tx, ProtocolSettings.Default.Network);

            Assert.IsNull(data.GetSignatures(tx.Sender));
            Assert.IsTrue(wallet.Sign(data));
            Assert.IsTrue(data.Completed);
            Assert.AreEqual(1, data.GetSignatures(tx.Sender).Count());

            tx.Witnesses = data.GetWitnesses();
            return(tx);
        }