Пример #1
0
        public void Set_take_snapshot()
        {
            StateDb db = new StateDb(new MemDb());

            db.Set(_hash1, _bytes1);
            Assert.AreEqual(0, db.TakeSnapshot());
        }
Пример #2
0
        public void Restore_in_the_middle()
        {
            StateDb db = new StateDb(new MemDb());

            db.Set(_hash1, _bytes1);
            int snapshot = db.TakeSnapshot();

            db.Set(_hash2, _bytes2);
            db.Restore(snapshot);
            byte[] getResult = db.Get(_hash2);
            Assert.IsNull(getResult);
        }
Пример #3
0
        public void Initial_take_snapshot()
        {
            StateDb db = new StateDb(new MemDb());

            Assert.AreEqual(-1, db.TakeSnapshot());
        }