convertToBlockInfo function
Implementation
types.BlockInfo convertToBlockInfo(pb.BlockInfo pbBlockInfo) {
return types.BlockInfo(
hash: pbBlockInfo.hash.reversed.toHex(),
prevHash: pbBlockInfo.prevHash.reversed.toHex(),
height: pbBlockInfo.height,
nBits: pbBlockInfo.nBits,
timestamp: pbBlockInfo.timestamp.toInt(),
isFinal: pbBlockInfo.isFinal,
blockSize: pbBlockInfo.blockSize.toInt(),
numTxs: pbBlockInfo.numTxs.toInt(),
numInputs: pbBlockInfo.numInputs.toInt(),
numOutputs: pbBlockInfo.numOutputs.toInt(),
sumInputSats: pbBlockInfo.sumInputSats.toInt(),
sumCoinbaseOutputSats: pbBlockInfo.sumCoinbaseOutputSats.toInt(),
sumNormalOutputSats: pbBlockInfo.sumNormalOutputSats.toInt(),
sumBurnedSats: pbBlockInfo.sumBurnedSats.toInt(),
);
}