Beispiel #1
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)
Beispiel #2
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()
Beispiel #3
0
class RejectSerializer(Serializer):
    model_class = Reject
    message = fields.VariableStringField()
    ccode = fields.FixedStringField(1)
    reason = fields.VariableStringField()
    data = fields.Hash()
Beispiel #4
0
class GetBlocksSerializer(Serializer):
    model_class = GetBlocks
    version = fields.UInt32LEField()
    hash_count = fields.VariableIntegerField()
    block_hashes = fields.BlockLocator()
    hash_stop = fields.Hash()
Beispiel #5
0
class OutPointSerializer(Serializer):
    """The OutPoint representation serializer."""
    model_class = OutPoint
    out_hash = fields.Hash()
    index = fields.UInt32LEField()
Beispiel #6
0
class InventorySerializer(Serializer):
    """The serializer for the Inventory."""
    model_class = Inventory
    inv_type = fields.UInt32LEField()
    inv_hash = fields.Hash()