public static ApplicationEngine Run(byte[] script, Snapshot snapshot, IScriptContainer container = null, Block persistingBlock = null, bool testMode = false, Fixed8 extraGAS = default(Fixed8), bool beginDebug = false) { snapshot.PersistingBlock = persistingBlock ?? snapshot.PersistingBlock ?? new Block { Version = 0, PrevHash = snapshot.CurrentBlockHash, MerkleRoot = new UInt256(), Timestamp = snapshot.Blocks[snapshot.CurrentBlockHash].TrimmedBlock.Timestamp + Blockchain.SecondsPerBlock, Index = snapshot.Height + 1, ConsensusData = 0, NextConsensus = snapshot.Blocks[snapshot.CurrentBlockHash].TrimmedBlock.NextConsensus, Witness = new Witness { InvocationScript = new byte[0], VerificationScript = new byte[0] }, Transactions = new Transaction[0] }; ApplicationEngine engine = new ApplicationEngine(TriggerType.Application, container, snapshot, extraGAS, testMode); if (beginDebug) { engine.BeginDebug(); } engine.LogScript(script); engine.LoadScript(script); engine.Execute(); return(engine); }