コード例 #1
0
class TxSerializer(Serializer):
    """The transaction serializer."""
    model_class = Tx
    version = fields.UInt32LEField()
    tx_in = fields.ListField(TxInSerializer)
    tx_out = fields.ListField(TxOutSerializer)
    lock_time = fields.UInt32LEField()
コード例 #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)
コード例 #3
0
class HeaderVectorSerializer(Serializer):
    """Serializer for the block header vector."""
    model_class = HeaderVector
    headers = fields.ListField(BlockHeaderSerializer)
コード例 #4
0
class NotFoundSerializer(Serializer):
    """Serializer for the NotFound message."""
    model_class = NotFound
    inventory = fields.ListField(InventorySerializer)
コード例 #5
0
class GetDataSerializer(Serializer):
    """Serializer for the GetData command."""
    model_class = GetData
    inventory = fields.ListField(InventorySerializer)
コード例 #6
0
class AddressVectorSerializer(Serializer):
    """Serializer for the addresses vector."""
    model_class = AddressVector
    addresses = fields.ListField(IPv4AddressTimestampSerializer)
コード例 #7
0
class InventoryVectorSerializer(Serializer):
    """The serializer for the vector of inventories."""
    model_class = InventoryVector
    inventory = fields.ListField(InventorySerializer)