public static MiningBlockInfoResponse FromMiningBlockInfo(MiningBlockInfo blockInfo) { var obj = JsonConvert.DeserializeObject <MiningBlockInfoResponse>(JsonConvert.SerializeObject(blockInfo)); obj.BlockDataHash = CryptoUtils.GetSha256Hex(JsonConvert.SerializeObject(blockInfo)); return(obj); }
public MinedBlockInfo(MiningBlockInfo mbi) { this.Transactions = mbi.Transactions; this.PreviousBlockHash = mbi.PreviousBlockHash; this.MinedBy = mbi.MinedBy; this.Index = mbi.Index; this.Difficulty = mbi.Difficulty; this.BlockDataHash = mbi.BlockDataHash; }