public void GetNoBlocksByParentHash() { var store = new InMemoryBlockStore(); var result = store.GetByParentHash(new BlockHash(new byte[] { 1, 2, 3 })); Assert.IsNotNull(result); Assert.AreEqual(0, result.Count()); }
public void SaveAndGetBlockByParentHash() { var block = new Block(42, new BlockHash(new byte[] { 1, 2 })); var hash = block.Hash; var store = new InMemoryBlockStore(); store.Save(block); var result = store.GetByParentHash(block.ParentHash); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count()); Assert.IsTrue(result.First().Hash.Equals(block.Hash)); }