public void Init() { var system = TestBlockchain.TheNeoSystem; snapshot = system.GetSnapshot().CreateSnapshot(); _block = new Block() { Header = new Header() { Index = 1, PrevHash = system.GenesisBlock.Hash, Witness = new Witness() { InvocationScript = System.Array.Empty <byte>(), VerificationScript = System.Array.Empty <byte>() }, NextConsensus = UInt160.Zero, MerkleRoot = UInt256.Zero, }, Transactions = new Transaction[] { new Transaction() { Attributes = System.Array.Empty <TransactionAttribute>(), Signers = new Signer[] { new Signer() { Account = UInt160.Zero, AllowedContracts = System.Array.Empty <UInt160>(), AllowedGroups = System.Array.Empty <Cryptography.ECC.ECPoint>(), Rules = System.Array.Empty <WitnessRule>(), Scopes = WitnessScope.Global } }, Witnesses = System.Array.Empty <Witness>(), Script = System.Array.Empty <byte>() } } }; snapshot.BlocksAdd(_block.Hash, _block.Trim()); snapshot.TransactionAdd(new TransactionState() { BlockIndex = _block.Index, Transaction = _block.Transactions[0], State = VMState.HALT }); _engine = new TestEngine(snapshot: snapshot, persistingBlock: _block); var method2 = typeof(LedgerContract).GetMethod("PostPersist", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); method2.Invoke(NativeContract.Ledger, new object[] { _engine }); _engine.AddEntryScript("./TestClasses/Contract_Blockchain.cs"); }