parent
67907b6c4c
commit
a0d89c0785
@ -0,0 +1,24 @@
|
||||
from apps.common.writers import (
|
||||
write_bytes,
|
||||
write_uint8,
|
||||
write_uint32_be,
|
||||
write_uint64_be,
|
||||
)
|
||||
|
||||
write_uint8 = write_uint8
|
||||
write_uint32 = write_uint32_be
|
||||
write_uint64 = write_uint64_be
|
||||
write_bytes = write_bytes
|
||||
|
||||
|
||||
def write_bool(w: bytearray, boolean: bool):
|
||||
if boolean:
|
||||
write_uint8(w, 255)
|
||||
else:
|
||||
write_uint8(w, 0)
|
||||
|
||||
|
||||
# write uint16 in be
|
||||
def write_uint16(w: bytearray, n: int):
|
||||
w.append((n >> 8) & 0xFF)
|
||||
w.append(n & 0xFF)
|
@ -0,0 +1,27 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
import protobuf as p
|
||||
|
||||
|
||||
class TezosBallotOp(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
source: bytes = None,
|
||||
period: int = None,
|
||||
proposal: bytes = None,
|
||||
ballot: bytes = None,
|
||||
) -> None:
|
||||
self.source = source
|
||||
self.period = period
|
||||
self.proposal = proposal
|
||||
self.ballot = ballot
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('source', p.BytesType, 0),
|
||||
2: ('period', p.UVarintType, 0),
|
||||
3: ('proposal', p.BytesType, 0),
|
||||
4: ('ballot', p.BytesType, 0),
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
import protobuf as p
|
||||
|
||||
|
||||
class TezosProposalOp(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
source: bytes = None,
|
||||
period: int = None,
|
||||
bytes_in_next_field: int = None,
|
||||
proposals: bytes = None,
|
||||
) -> None:
|
||||
self.source = source
|
||||
self.period = period
|
||||
self.bytes_in_next_field = bytes_in_next_field
|
||||
self.proposals = proposals
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('source', p.BytesType, 0),
|
||||
2: ('period', p.UVarintType, 0),
|
||||
3: ('bytes_in_next_field', p.UVarintType, 0),
|
||||
4: ('proposals', p.BytesType, 0),
|
||||
}
|
Loading…
Reference in new issue