public static SimpleApplicationEngine Run(byte[] script, DbSnapshot snapshot, IScriptContainer container = null, Block persistingBlock = null, bool testMode = false, Fixed8 extraGAS = default(Fixed8)) { snapshot.PersistingBlock = new Block { Version = 0, PrevHash = snapshot.CurrentBlockHash, MerkleRoot = new UInt256(), Timestamp = snapshot.Blocks[snapshot.CurrentBlockHash].TrimmedBlock.Timestamp + 15, 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] }; SimpleApplicationEngine engine = new SimpleApplicationEngine(TriggerType.Application, container, snapshot, extraGAS, testMode); engine.LoadScript(script); engine.Execute(); return(engine); }
public Indexer(DbSnapshot snapshot) { this.snapshot = snapshot; snapshot.recipeMap = new Dictionary<Guid, RecipeNode>(); snapshot.ingredientMap = new Dictionary<Guid, IngredientNode>(); snapshot.recipeList = new IEnumerable<RecipeNode>[RecipeTag.NumberOfTags]; }
public void LoadSnapshot() { this.dateBaseSnapshot = new DbSnapshot(this.context); }