public static Dictionary MarshalPreEvaluationBlockHeader(IPreEvaluationBlockHeader header) { return(MarshalPreEvaluationBlockHeader( MarshalBlockMetadata(header), header.Nonce, header.PreEvaluationHash )); }
public static void AssertPreEvaluationBlockHeadersEqual( IPreEvaluationBlockHeader expected, IPreEvaluationBlockHeader actual ) { AssertBlockMetadataEqual(expected, actual); Assert.Same(expected.HashAlgorithm, actual.HashAlgorithm); AssertBytesEqual(expected.PreEvaluationHash, actual.PreEvaluationHash); }
/// <summary> /// Creates a <see cref="PreEvaluationBlockHeader"/> by copying the fields of another /// pre-evaluation block <paramref name="header"/>. /// </summary> /// <param name="header">A pre-evaluation block header to copy.</param> /// <exception cref="InvalidBlockProtocolVersionException">Thrown when /// the <paramref name="header"/>'s to set is <see cref="IBlockMetadata.ProtocolVersion"/> /// is less than 0, or greater than <see cref="BlockMetadata.CurrentProtocolVersion"/>, /// the latest known protocol version.</exception> /// <exception cref="InvalidBlockIndexException">Thrown when the <paramref name="header"/> /// has a negative <see cref="IBlockMetadata.Index"/>.</exception> /// <exception cref="InvalidBlockDifficultyException">Thrown when /// the <paramref name="header"/>'s <see cref="IBlockMetadata.Difficulty"/> is negative. /// </exception> /// <exception cref="InvalidBlockTotalDifficultyException">Thrown when /// the <paramref name="header"/>'s <see cref="IBlockMetadata.TotalDifficulty"/> is less /// than its <see cref="IBlockMetadata.Difficulty"/>.</exception> /// <exception cref="InvalidBlockPreEvaluationHashException">Thrown when the given /// pre-evaluation <paramref name="header"/>'s /// <seealso cref="IPreEvaluationBlockHeader.PreEvaluationHash"/> is invalid.</exception> /// <exception cref="InvalidBlockNonceException">Thrown when the given /// pre-evaluation <paramref name="header"/>'s /// <seealso cref="IPreEvaluationBlockHeader.Nonce"/> does not satisfy the required /// <see cref="IBlockMetadata.Difficulty"/>. /// </exception> public PreEvaluationBlockHeader(IPreEvaluationBlockHeader header) : this(header, header.HashAlgorithm, header.Nonce, header.PreEvaluationHash) { }