You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/trezor/messages/CardanoSignTx.py

56 lines
2.0 KiB

# Automatically generated by pb2py
# fmt: off
import protobuf as p
4 years ago
from .CardanoTxCertificateType import CardanoTxCertificateType
from .CardanoTxInputType import CardanoTxInputType
from .CardanoTxOutputType import CardanoTxOutputType
4 years ago
from .CardanoTxWithdrawalType import CardanoTxWithdrawalType
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoSignTx(p.MessageType):
MESSAGE_WIRE_TYPE = 303
def __init__(
self,
inputs: List[CardanoTxInputType] = None,
outputs: List[CardanoTxOutputType] = None,
protocol_magic: int = None,
fee: int = None,
ttl: int = None,
network_id: int = None,
4 years ago
certificates: List[CardanoTxCertificateType] = None,
withdrawals: List[CardanoTxWithdrawalType] = None,
metadata_hash: bytes = None,
) -> None:
self.inputs = inputs if inputs is not None else []
self.outputs = outputs if outputs is not None else []
self.protocol_magic = protocol_magic
self.fee = fee
self.ttl = ttl
self.network_id = network_id
4 years ago
self.certificates = certificates if certificates is not None else []
self.withdrawals = withdrawals if withdrawals is not None else []
self.metadata_hash = metadata_hash
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('inputs', CardanoTxInputType, p.FLAG_REPEATED),
2: ('outputs', CardanoTxOutputType, p.FLAG_REPEATED),
5: ('protocol_magic', p.UVarintType, 0),
6: ('fee', p.UVarintType, 0),
7: ('ttl', p.UVarintType, 0),
8: ('network_id', p.UVarintType, 0),
4 years ago
9: ('certificates', CardanoTxCertificateType, p.FLAG_REPEATED),
10: ('withdrawals', CardanoTxWithdrawalType, p.FLAG_REPEATED),
11: ('metadata_hash', p.BytesType, 0),
}