public void Test12() { StateRepositoryRoot repository = new StateRepositoryRoot(new MemoryDictionarySource()); IStateRepository track = repository.StartTracking(); track.SetCode(new uint160(cow), cowCode); track.SetCode(new uint160(horse), horseCode); Assert.Equal(cowCode, track.GetCode(new uint160(cow))); Assert.Equal(horseCode, track.GetCode(new uint160(horse))); track.Rollback(); Assert.Null(repository.GetCode(new uint160(cow))); Assert.Null(repository.GetCode(new uint160(horse))); }
public void Test3() { StateRepositoryRoot repository = new StateRepositoryRoot(new MemoryDictionarySource()); uint160 cow = 100; uint160 horse = 2000; byte[] cowCode = "A1A2A3".HexToByteArray(); byte[] horseCode = "B1B2B3".HexToByteArray(); repository.SetCode(cow, cowCode); repository.SetCode(horse, horseCode); Assert.Equal(cowCode, repository.GetCode(cow)); Assert.Equal(horseCode, repository.GetCode(horse)); }