public void StateRefDocBlockHash() { var address = new PrivateKey().ToAddress(); var random = new Random(); var bytes = new byte[32]; random.NextBytes(bytes); var hashDigest = new HashDigest <SHA256>(bytes); var stateRef = new DefaultStore.StateRefDoc { StateKey = address.ToHex().ToLowerInvariant(), BlockIndex = 123, BlockHash = hashDigest, }; var stateRef2 = new DefaultStore.StateRefDoc { StateKey = stateRef.StateKey, BlockIndex = 123, BlockHashString = stateRef.BlockHashString, }; Assert.Equal(stateRef.BlockHash, stateRef2.BlockHash); }
public void StateRefDocBlockHash() { var address = new PrivateKey().PublicKey.ToAddress(); var random = new Random(); var bytes = new byte[32]; random.NextBytes(bytes); var hashDigest = new HashDigest <SHA256>(bytes); var stateRef = new DefaultStore.StateRefDoc { Address = address, BlockIndex = 123, BlockHash = hashDigest, }; var stateRef2 = new DefaultStore.StateRefDoc { AddressString = stateRef.AddressString, BlockIndex = 123, BlockHashString = stateRef.BlockHashString, }; Assert.Equal(stateRef.Address, stateRef2.Address); Assert.Equal(stateRef.BlockHash, stateRef2.BlockHash); }