示例#1
0
class BlockHeaderSerializer(Serializer):
    """The serializer for the block header."""
    model_class = BlockHeader
    version = fields.UInt32LEField()
    prev_block = fields.Hash()
    merkle_root = fields.Hash()
    timestamp = fields.UInt32LEField()
    bits = fields.UInt32LEField()
    nonce = fields.UInt32LEField()
    txns_count = fields.VariableIntegerField()
示例#2
0
class BlockSerializer(Serializer):
    """The deserializer for the blocks."""
    model_class = Block
    version = fields.UInt32LEField()
    prev_block = fields.Hash()
    merkle_root = fields.Hash()
    timestamp = fields.UInt32LEField()
    bits = fields.UInt32LEField()
    nonce = fields.UInt32LEField()
    txns = fields.ListField(TxSerializer)
    blocksig = fields.VariableIntegerField()
示例#3
0
class GetBlocksSerializer(Serializer):
    model_class = GetBlocks
    version = fields.UInt32LEField()
    hash_count = fields.VariableIntegerField()
    block_hashes = fields.BlockLocator()
    hash_stop = fields.Hash()