helium_py.proto.BlockchainBlockV1

class helium_py.proto.BlockchainBlockV1(prev_hash: bytes = <object object at 0x7fdce1e05210>, height: int = <object object at 0x7fdce1e05210>, time: int = <object object at 0x7fdce1e05210>, hbbft_round: int = <object object at 0x7fdce1e05210>, transactions: List[ForwardRef('BlockchainTxn')] = <object object at 0x7fdce1e05210>, signatures: List[ForwardRef('BlockchainSignatureV1')] = <object object at 0x7fdce1e05210>, election_epoch: int = <object object at 0x7fdce1e05210>, epoch_start: int = <object object at 0x7fdce1e05210>, rescue_signature: bytes = <object object at 0x7fdce1e05210>, seen_votes: List[ForwardRef('BlockchainSeenVoteV1')] = <object object at 0x7fdce1e05210>, bba_completion: bytes = <object object at 0x7fdce1e05210>, snapshot_hash: bytes = <object object at 0x7fdce1e05210>, rescue_signatures: List[bytes] = <object object at 0x7fdce1e05210>)[source]

Bases: Message

__init__(prev_hash: bytes = <object object>, height: int = <object object>, time: int = <object object>, hbbft_round: int = <object object>, transactions: ~typing.List[~helium_py.proto.BlockchainTxn] = <object object>, signatures: ~typing.List[~helium_py.proto.BlockchainSignatureV1] = <object object>, election_epoch: int = <object object>, epoch_start: int = <object object>, rescue_signature: bytes = <object object>, seen_votes: ~typing.List[~helium_py.proto.BlockchainSeenVoteV1] = <object object>, bba_completion: bytes = <object object>, snapshot_hash: bytes = <object object>, rescue_signatures: ~typing.List[bytes] = <object object>) None

Methods

FromString(data)

Parse the binary encoded Protobuf into this message instance.

SerializeToString()

Get the binary encoded Protobuf representation of this message instance.

__init__([prev_hash, height, time, ...])

from_dict(value)

Parse the key/value pairs into the current message instance.

from_json(value)

A helper function to return the message instance from its JSON representation.

parse(data)

Parse the binary encoded Protobuf into this message instance.

to_dict([casing, include_default_values])

Returns a JSON serializable dict representation of this object.

to_json([indent])

A helper function to parse the message instance into its JSON representation.

Attributes

bba_completion

election_epoch

epoch_start

hbbft_round

height

prev_hash

rescue_signature

rescue_signatures

seen_votes

signatures

snapshot_hash

time

transactions

classmethod FromString(data: bytes) T

Parse the binary encoded Protobuf into this message instance. This returns the instance itself and is therefore assignable and chainable.

Note

This is a method for compatibility with other libraries, you should really use parse().

data: bytes

The data to parse the protobuf from.

Message

The initialized message.

SerializeToString() bytes

Get the binary encoded Protobuf representation of this message instance.

Note

This is a method for compatibility with other libraries, you should really use bytes(x).

bytes

The binary encoded Protobuf representation of this message instance

from_dict(value: Dict[str, Any]) T

Parse the key/value pairs into the current message instance. This returns the instance itself and is therefore assignable and chainable.

value: Dict[str, Any]

The dictionary to parse from.

Message

The initialized message.

from_json(value: Union[str, bytes]) T

A helper function to return the message instance from its JSON representation. This returns the instance itself and is therefore assignable and chainable.

This is equivalent to:

return message.from_dict(json.loads(value))
value: Union[str, bytes]

The value to pass to json.loads().

Message

The initialized message.

parse(data: bytes) T

Parse the binary encoded Protobuf into this message instance. This returns the instance itself and is therefore assignable and chainable.

data: bytes

The data to parse the protobuf from.

Message

The initialized message.

to_dict(casing: ~betterproto.Casing = <function camel_case>, include_default_values: bool = False) Dict[str, Any]

Returns a JSON serializable dict representation of this object.

casing: Casing

The casing to use for key values. Default is Casing.CAMEL for compatibility purposes.

include_default_values: bool

If True will include the default values of fields. Default is False. E.g. an int32 field will be included with a value of 0 if this is set to True, otherwise this would be ignored.

Dict[str, Any]

The JSON serializable dict representation of this object.

to_json(indent: Union[None, int, str] = None) str

A helper function to parse the message instance into its JSON representation.

This is equivalent to:

json.dumps(message.to_dict(), indent=indent)
indent: Optional[Union[int, str]]

The indent to pass to json.dumps().

str

The JSON representation of the message.