extensible
— Customizable payload¶
This module contains several classes for working with network addresses.
The ExtensiblePayload
is used in the consensus mechanism, as well can be used for sending
custom messages (i.e. in a plugin).
-
class
neo3.network.payloads.
ExtensiblePayload
(category, valid_block_start, valid_block_end, sender, data, witness)¶ Bases:
neo3.network.payloads.inventory.IInventory
-
deserialize
(reader)¶ Deserialize the object from a binary stream.
- Parameters
reader (
BinaryReader
) – instance.- Raises
ValueError – if the check byte is not 1.
- Return type
-
classmethod
deserialize_from_bytes
(data)¶ Parse data into an object instance.
-
deserialize_unsigned
(reader)¶ Deserialize the unsigned data part of the object from a binary stream.
- Parameters
reader (
BinaryReader
) – instance.- Raises
ValueError – if the valid_block_start exceeds the valid_block_end field.
- Return type
-
get_hash_data
(protocol_magic)¶ Get the unsigned data
-
get_script_hashes_for_verifying
(snapshot)¶ Helper method to get the data used in verifying the object.
-
hash
()¶ Get a unique identifier based on the unsigned data portion of the object.
- Return type
-
serialize
(writer)¶ Serialize the object into a binary stream.
- Parameters
writer (
BinaryWriter
) – instance.- Return type
-
serialize_unsigned
(writer)¶ Serialize the unsigned part of the object into a binary stream.
- Parameters
writer (
BinaryWriter
) – instance.- Return type
-
category
¶ An identifier to which category the data belongs
-
data
¶ Arbitrary data as required by the payload category
-
property
inventory_type
¶ Inventory type identifier.
- Return type
-
sender
¶ The hash of the account who has send the payload to the network
-
valid_block_end
¶ Last height height in which the payload is valid
-
valid_block_start
¶ Starting height in which the payload is valid
-
witness
¶ The witness of the payload
-