mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-03 13:22:33 +00:00

core: refactor writing native_call with length core: removed hex encoded string branch from native_call calculation common: nested OntologyTransaction into OntologySignTx core: fix ontology layout formatting python: change the way ontology message signing works python: add expected fields to ontology core+python+common: remove type field from OntologyTransaction core: inline write_push_bytes
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
# Automatically generated by pb2py
|
|
# fmt: off
|
|
from .. import protobuf as p
|
|
|
|
from .OntologyTxAttribute import OntologyTxAttribute
|
|
|
|
if __debug__:
|
|
try:
|
|
from typing import Dict, List # noqa: F401
|
|
from typing_extensions import Literal # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
class OntologyTransaction(p.MessageType):
|
|
|
|
def __init__(
|
|
self,
|
|
version: int = None,
|
|
nonce: int = None,
|
|
gas_price: int = None,
|
|
gas_limit: int = None,
|
|
payer: str = None,
|
|
tx_attributes: List[OntologyTxAttribute] = None,
|
|
) -> None:
|
|
self.version = version
|
|
self.nonce = nonce
|
|
self.gas_price = gas_price
|
|
self.gas_limit = gas_limit
|
|
self.payer = payer
|
|
self.tx_attributes = tx_attributes if tx_attributes is not None else []
|
|
|
|
@classmethod
|
|
def get_fields(cls) -> Dict:
|
|
return {
|
|
1: ('version', p.UVarintType, 0),
|
|
2: ('nonce', p.UVarintType, 0),
|
|
3: ('gas_price', p.UVarintType, 0),
|
|
4: ('gas_limit', p.UVarintType, 0),
|
|
5: ('payer', p.UnicodeType, 0),
|
|
6: ('tx_attributes', OntologyTxAttribute, p.FLAG_REPEATED),
|
|
}
|