mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-25 23:01:02 +00:00
Update protobuf
This commit is contained in:
parent
7c66a16bef
commit
e92baf5b02
@ -25,6 +25,12 @@ enum CardanoAddressType {
|
|||||||
REWARD_SCRIPT = 15;
|
REWARD_SCRIPT = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CardanoCertificateType {
|
||||||
|
STAKE_REGISTRATION = 0;
|
||||||
|
STAKE_DEREGISTRATION = 1;
|
||||||
|
STAKE_DELEGATION = 2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure representing cardano PointerAddress pointer,
|
* Structure representing cardano PointerAddress pointer,
|
||||||
* which points to a staking key registration certificate.
|
* which points to a staking key registration certificate.
|
||||||
@ -110,6 +116,9 @@ message CardanoSignTx {
|
|||||||
optional uint64 fee = 6; // transaction fee - added in shelley
|
optional uint64 fee = 6; // transaction fee - added in shelley
|
||||||
optional uint64 ttl = 7; // transaction ttl - added in shelley
|
optional uint64 ttl = 7; // transaction ttl - added in shelley
|
||||||
optional uint32 network_id = 8; // network id - mainnet or testnet
|
optional uint32 network_id = 8; // network id - mainnet or testnet
|
||||||
|
repeated CardanoTxCertificateType certificates = 9; // transaction certificates - added in shelley
|
||||||
|
repeated CardanoTxWithdrawalType withdrawals = 10; // transaction withdrawals - added in shelley
|
||||||
|
optional bytes metadata_hash = 11; // transaction metadata hash - added in shelley
|
||||||
/**
|
/**
|
||||||
* Structure representing cardano transaction input
|
* Structure representing cardano transaction input
|
||||||
*/
|
*/
|
||||||
@ -129,6 +138,21 @@ message CardanoSignTx {
|
|||||||
optional uint64 amount = 3; // amount to spend
|
optional uint64 amount = 3; // amount to spend
|
||||||
optional CardanoAddressParametersType address_parameters = 4; // parameters used to derive the address
|
optional CardanoAddressParametersType address_parameters = 4; // parameters used to derive the address
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Structure representing cardano transaction certificate
|
||||||
|
*/
|
||||||
|
message CardanoTxCertificateType {
|
||||||
|
optional CardanoCertificateType type = 1; // certificate type
|
||||||
|
repeated uint32 path = 2; // BIP-32 path to derive (staking) key
|
||||||
|
optional bytes pool = 3; // pool hash
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Structure representing cardano transaction withdrawals
|
||||||
|
*/
|
||||||
|
message CardanoTxWithdrawalType {
|
||||||
|
repeated uint32 path = 1;
|
||||||
|
optional uint64 amount = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
8
core/src/trezor/messages/CardanoCertificateType.py
Normal file
8
core/src/trezor/messages/CardanoCertificateType.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
if False:
|
||||||
|
from typing_extensions import Literal
|
||||||
|
|
||||||
|
STAKE_REGISTRATION = 0 # type: Literal[0]
|
||||||
|
STAKE_DEREGISTRATION = 1 # type: Literal[1]
|
||||||
|
STAKE_DELEGATION = 2 # type: Literal[2]
|
@ -2,8 +2,10 @@
|
|||||||
# fmt: off
|
# fmt: off
|
||||||
import protobuf as p
|
import protobuf as p
|
||||||
|
|
||||||
|
from .CardanoTxCertificateType import CardanoTxCertificateType
|
||||||
from .CardanoTxInputType import CardanoTxInputType
|
from .CardanoTxInputType import CardanoTxInputType
|
||||||
from .CardanoTxOutputType import CardanoTxOutputType
|
from .CardanoTxOutputType import CardanoTxOutputType
|
||||||
|
from .CardanoTxWithdrawalType import CardanoTxWithdrawalType
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
try:
|
try:
|
||||||
@ -24,6 +26,9 @@ class CardanoSignTx(p.MessageType):
|
|||||||
fee: int = None,
|
fee: int = None,
|
||||||
ttl: int = None,
|
ttl: int = None,
|
||||||
network_id: int = None,
|
network_id: int = None,
|
||||||
|
certificates: List[CardanoTxCertificateType] = None,
|
||||||
|
withdrawals: List[CardanoTxWithdrawalType] = None,
|
||||||
|
metadata_hash: bytes = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.inputs = inputs if inputs is not None else []
|
self.inputs = inputs if inputs is not None else []
|
||||||
self.outputs = outputs if outputs is not None else []
|
self.outputs = outputs if outputs is not None else []
|
||||||
@ -31,6 +36,9 @@ class CardanoSignTx(p.MessageType):
|
|||||||
self.fee = fee
|
self.fee = fee
|
||||||
self.ttl = ttl
|
self.ttl = ttl
|
||||||
self.network_id = network_id
|
self.network_id = network_id
|
||||||
|
self.certificates = certificates if certificates is not None else []
|
||||||
|
self.withdrawals = withdrawals if withdrawals is not None else []
|
||||||
|
self.metadata_hash = metadata_hash
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
@ -41,4 +49,7 @@ class CardanoSignTx(p.MessageType):
|
|||||||
6: ('fee', p.UVarintType, 0),
|
6: ('fee', p.UVarintType, 0),
|
||||||
7: ('ttl', p.UVarintType, 0),
|
7: ('ttl', p.UVarintType, 0),
|
||||||
8: ('network_id', p.UVarintType, 0),
|
8: ('network_id', p.UVarintType, 0),
|
||||||
|
9: ('certificates', CardanoTxCertificateType, p.FLAG_REPEATED),
|
||||||
|
10: ('withdrawals', CardanoTxWithdrawalType, p.FLAG_REPEATED),
|
||||||
|
11: ('metadata_hash', p.BytesType, 0),
|
||||||
}
|
}
|
||||||
|
32
core/src/trezor/messages/CardanoTxCertificateType.py
Normal file
32
core/src/trezor/messages/CardanoTxCertificateType.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
EnumTypeCardanoCertificateType = Literal[0, 1, 2]
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class CardanoTxCertificateType(p.MessageType):
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
type: EnumTypeCardanoCertificateType = None,
|
||||||
|
path: List[int] = None,
|
||||||
|
pool: bytes = None,
|
||||||
|
) -> None:
|
||||||
|
self.type = type
|
||||||
|
self.path = path if path is not None else []
|
||||||
|
self.pool = pool
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('type', p.EnumType("CardanoCertificateType", (0, 1, 2)), 0),
|
||||||
|
2: ('path', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
3: ('pool', p.BytesType, 0),
|
||||||
|
}
|
28
core/src/trezor/messages/CardanoTxWithdrawalType.py
Normal file
28
core/src/trezor/messages/CardanoTxWithdrawalType.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class CardanoTxWithdrawalType(p.MessageType):
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
path: List[int] = None,
|
||||||
|
amount: int = None,
|
||||||
|
) -> None:
|
||||||
|
self.path = path if path is not None else []
|
||||||
|
self.amount = amount
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('path', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('amount', p.UVarintType, 0),
|
||||||
|
}
|
8
python/src/trezorlib/messages/CardanoCertificateType.py
Normal file
8
python/src/trezorlib/messages/CardanoCertificateType.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
if False:
|
||||||
|
from typing_extensions import Literal
|
||||||
|
|
||||||
|
STAKE_REGISTRATION = 0 # type: Literal[0]
|
||||||
|
STAKE_DEREGISTRATION = 1 # type: Literal[1]
|
||||||
|
STAKE_DELEGATION = 2 # type: Literal[2]
|
@ -2,8 +2,10 @@
|
|||||||
# fmt: off
|
# fmt: off
|
||||||
from .. import protobuf as p
|
from .. import protobuf as p
|
||||||
|
|
||||||
|
from .CardanoTxCertificateType import CardanoTxCertificateType
|
||||||
from .CardanoTxInputType import CardanoTxInputType
|
from .CardanoTxInputType import CardanoTxInputType
|
||||||
from .CardanoTxOutputType import CardanoTxOutputType
|
from .CardanoTxOutputType import CardanoTxOutputType
|
||||||
|
from .CardanoTxWithdrawalType import CardanoTxWithdrawalType
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
try:
|
try:
|
||||||
@ -24,6 +26,9 @@ class CardanoSignTx(p.MessageType):
|
|||||||
fee: int = None,
|
fee: int = None,
|
||||||
ttl: int = None,
|
ttl: int = None,
|
||||||
network_id: int = None,
|
network_id: int = None,
|
||||||
|
certificates: List[CardanoTxCertificateType] = None,
|
||||||
|
withdrawals: List[CardanoTxWithdrawalType] = None,
|
||||||
|
metadata_hash: bytes = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.inputs = inputs if inputs is not None else []
|
self.inputs = inputs if inputs is not None else []
|
||||||
self.outputs = outputs if outputs is not None else []
|
self.outputs = outputs if outputs is not None else []
|
||||||
@ -31,6 +36,9 @@ class CardanoSignTx(p.MessageType):
|
|||||||
self.fee = fee
|
self.fee = fee
|
||||||
self.ttl = ttl
|
self.ttl = ttl
|
||||||
self.network_id = network_id
|
self.network_id = network_id
|
||||||
|
self.certificates = certificates if certificates is not None else []
|
||||||
|
self.withdrawals = withdrawals if withdrawals is not None else []
|
||||||
|
self.metadata_hash = metadata_hash
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
@ -41,4 +49,7 @@ class CardanoSignTx(p.MessageType):
|
|||||||
6: ('fee', p.UVarintType, 0),
|
6: ('fee', p.UVarintType, 0),
|
||||||
7: ('ttl', p.UVarintType, 0),
|
7: ('ttl', p.UVarintType, 0),
|
||||||
8: ('network_id', p.UVarintType, 0),
|
8: ('network_id', p.UVarintType, 0),
|
||||||
|
9: ('certificates', CardanoTxCertificateType, p.FLAG_REPEATED),
|
||||||
|
10: ('withdrawals', CardanoTxWithdrawalType, p.FLAG_REPEATED),
|
||||||
|
11: ('metadata_hash', p.BytesType, 0),
|
||||||
}
|
}
|
||||||
|
32
python/src/trezorlib/messages/CardanoTxCertificateType.py
Normal file
32
python/src/trezorlib/messages/CardanoTxCertificateType.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
from .. import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
EnumTypeCardanoCertificateType = Literal[0, 1, 2]
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class CardanoTxCertificateType(p.MessageType):
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
type: EnumTypeCardanoCertificateType = None,
|
||||||
|
path: List[int] = None,
|
||||||
|
pool: bytes = None,
|
||||||
|
) -> None:
|
||||||
|
self.type = type
|
||||||
|
self.path = path if path is not None else []
|
||||||
|
self.pool = pool
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('type', p.EnumType("CardanoCertificateType", (0, 1, 2)), 0),
|
||||||
|
2: ('path', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
3: ('pool', p.BytesType, 0),
|
||||||
|
}
|
28
python/src/trezorlib/messages/CardanoTxWithdrawalType.py
Normal file
28
python/src/trezorlib/messages/CardanoTxWithdrawalType.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
from .. import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class CardanoTxWithdrawalType(p.MessageType):
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
path: List[int] = None,
|
||||||
|
amount: int = None,
|
||||||
|
) -> None:
|
||||||
|
self.path = path if path is not None else []
|
||||||
|
self.amount = amount
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('path', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('amount', p.UVarintType, 0),
|
||||||
|
}
|
@ -28,8 +28,10 @@ from .CardanoGetPublicKey import CardanoGetPublicKey
|
|||||||
from .CardanoPublicKey import CardanoPublicKey
|
from .CardanoPublicKey import CardanoPublicKey
|
||||||
from .CardanoSignTx import CardanoSignTx
|
from .CardanoSignTx import CardanoSignTx
|
||||||
from .CardanoSignedTx import CardanoSignedTx
|
from .CardanoSignedTx import CardanoSignedTx
|
||||||
|
from .CardanoTxCertificateType import CardanoTxCertificateType
|
||||||
from .CardanoTxInputType import CardanoTxInputType
|
from .CardanoTxInputType import CardanoTxInputType
|
||||||
from .CardanoTxOutputType import CardanoTxOutputType
|
from .CardanoTxOutputType import CardanoTxOutputType
|
||||||
|
from .CardanoTxWithdrawalType import CardanoTxWithdrawalType
|
||||||
from .ChangePin import ChangePin
|
from .ChangePin import ChangePin
|
||||||
from .ChangeWipeCode import ChangeWipeCode
|
from .ChangeWipeCode import ChangeWipeCode
|
||||||
from .CipherKeyValue import CipherKeyValue
|
from .CipherKeyValue import CipherKeyValue
|
||||||
@ -280,6 +282,7 @@ from . import BinanceTimeInForce
|
|||||||
from . import ButtonRequestType
|
from . import ButtonRequestType
|
||||||
from . import Capability
|
from . import Capability
|
||||||
from . import CardanoAddressType
|
from . import CardanoAddressType
|
||||||
|
from . import CardanoCertificateType
|
||||||
from . import DebugLinkShowTextStyle
|
from . import DebugLinkShowTextStyle
|
||||||
from . import DebugSwipeDirection
|
from . import DebugSwipeDirection
|
||||||
from . import FailureType
|
from . import FailureType
|
||||||
|
Loading…
Reference in New Issue
Block a user