mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-09 08:08:09 +00:00
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
# Automatically generated by pb2py
|
|
# fmt: off
|
|
# isort:skip_file
|
|
from .. import protobuf as p
|
|
|
|
if __debug__:
|
|
try:
|
|
from typing import Dict, List, Optional # noqa: F401
|
|
from typing_extensions import Literal # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
class HDNodeType(p.MessageType):
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
depth: int,
|
|
fingerprint: int,
|
|
child_num: int,
|
|
chain_code: bytes,
|
|
public_key: bytes,
|
|
private_key: Optional[bytes] = None,
|
|
) -> None:
|
|
self.depth = depth
|
|
self.fingerprint = fingerprint
|
|
self.child_num = child_num
|
|
self.chain_code = chain_code
|
|
self.public_key = public_key
|
|
self.private_key = private_key
|
|
|
|
@classmethod
|
|
def get_fields(cls) -> Dict:
|
|
return {
|
|
1: ('depth', p.UVarintType, p.FLAG_REQUIRED),
|
|
2: ('fingerprint', p.UVarintType, p.FLAG_REQUIRED),
|
|
3: ('child_num', p.UVarintType, p.FLAG_REQUIRED),
|
|
4: ('chain_code', p.BytesType, p.FLAG_REQUIRED),
|
|
5: ('private_key', p.BytesType, None),
|
|
6: ('public_key', p.BytesType, p.FLAG_REQUIRED),
|
|
}
|