mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 23:38:09 +00:00
chore(cardano): rename Catalyst to governance
This commit is contained in:
parent
ab02f7a400
commit
c36870defa
@ -66,10 +66,10 @@ enum CardanoPoolRelayType {
|
||||
|
||||
enum CardanoTxAuxiliaryDataSupplementType {
|
||||
NONE = 0;
|
||||
CATALYST_REGISTRATION_SIGNATURE = 1;
|
||||
GOVERNANCE_REGISTRATION_SIGNATURE = 1;
|
||||
}
|
||||
|
||||
enum CardanoCatalystRegistrationFormat {
|
||||
enum CardanoGovernanceRegistrationFormat {
|
||||
CIP15 = 0;
|
||||
CIP36 = 1;
|
||||
}
|
||||
@ -360,7 +360,7 @@ message CardanoTxWithdrawal {
|
||||
/**
|
||||
* @embed
|
||||
*/
|
||||
message CardanoCatalystRegistrationDelegation {
|
||||
message CardanoGovernanceRegistrationDelegation {
|
||||
required bytes voting_public_key = 1;
|
||||
required uint32 weight = 2;
|
||||
}
|
||||
@ -368,13 +368,13 @@ message CardanoCatalystRegistrationDelegation {
|
||||
/**
|
||||
* @embed
|
||||
*/
|
||||
message CardanoCatalystRegistrationParametersType {
|
||||
message CardanoGovernanceRegistrationParametersType {
|
||||
optional bytes voting_public_key = 1;
|
||||
repeated uint32 staking_path = 2;
|
||||
required CardanoAddressParametersType reward_address_parameters = 3;
|
||||
required uint64 nonce = 4;
|
||||
optional CardanoCatalystRegistrationFormat format = 5 [default=CIP15];
|
||||
repeated CardanoCatalystRegistrationDelegation delegations = 6; // mutually exclusive with voting_public_key; max 32 delegations
|
||||
optional CardanoGovernanceRegistrationFormat format = 5 [default=CIP15];
|
||||
repeated CardanoGovernanceRegistrationDelegation delegations = 6; // mutually exclusive with voting_public_key; max 32 delegations
|
||||
optional uint64 voting_purpose = 7;
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ message CardanoCatalystRegistrationParametersType {
|
||||
* @next CardanoTxAuxiliaryDataSupplement
|
||||
*/
|
||||
message CardanoTxAuxiliaryData {
|
||||
optional CardanoCatalystRegistrationParametersType catalyst_registration_parameters = 1;
|
||||
optional CardanoGovernanceRegistrationParametersType governance_registration_parameters = 1;
|
||||
optional bytes hash = 2;
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ message CardanoTxItemAck {
|
||||
message CardanoTxAuxiliaryDataSupplement {
|
||||
required CardanoTxAuxiliaryDataSupplementType type = 1;
|
||||
optional bytes auxiliary_data_hash = 2;
|
||||
optional bytes catalyst_signature = 3;
|
||||
optional bytes governance_signature = 3;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1299,7 +1299,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with catalyst registration containing byron reward address",
|
||||
"description": "transaction with governance registration containing byron reward address",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1309,7 +1309,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"voting_public_key": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"nonce": 22634813,
|
||||
@ -1348,7 +1348,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with both auxiliary data blob and catalyst registration",
|
||||
"description": "transaction with both auxiliary data blob and governance registration",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1359,7 +1359,7 @@
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"hash": "ea4c91860dd5ec5449f8f985d227946ff39086b17f10b5afb93d12ee87050b6a",
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"voting_public_key": "38DA0B509D45BF6C87BD55594B92F97081D3923B8C1334B9B8D0BF13FC1C12D0",
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
@ -1399,7 +1399,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with both voting public key and delegations in catalyst registration",
|
||||
"description": "transaction with both voting public key and delegations in governance registration",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1409,7 +1409,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"voting_public_key": "38DA0B509D45BF6C87BD55594B92F97081D3923B8C1334B9B8D0BF13FC1C12D0",
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
|
22
common/tests/fixtures/cardano/sign_tx.json
vendored
22
common/tests/fixtures/cardano/sign_tx.json
vendored
@ -1002,7 +1002,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with CIP15 catalyst registration",
|
||||
"description": "transaction with CIP15 governance registration",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1012,7 +1012,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"voting_public_key": "1af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc",
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
@ -1060,12 +1060,12 @@
|
||||
"auxiliary_data_supplement": {
|
||||
"type": 1,
|
||||
"auxiliary_data_hash": "a943e9166f1bb6d767b175384d3bd7d23645170df36fc1861fbf344135d8e120",
|
||||
"catalyst_signature": "74f27d877bbb4a5fc4f7c56869905c11f70bad0af3de24b23afaa1d024e750930f434ecc4b73e5d1723c2cb8548e8bf6098ac876487b3a6ed0891cb76994d409"
|
||||
"governance_signature": "74f27d877bbb4a5fc4f7c56869905c11f70bad0af3de24b23afaa1d024e750930f434ecc4b73e5d1723c2cb8548e8bf6098ac876487b3a6ed0891cb76994d409"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with CIP36 catalyst registration and voting purpose not specified",
|
||||
"description": "transaction with CIP36 governance registration and voting purpose not specified",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1075,7 +1075,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
"addressType": 0,
|
||||
@ -1133,12 +1133,12 @@
|
||||
"auxiliary_data_supplement": {
|
||||
"type": 1,
|
||||
"auxiliary_data_hash": "9d4c00f5b5b67760931fd7ed9850ff8e14dcdf957685191ab4bc755c52f0ed56",
|
||||
"catalyst_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
|
||||
"governance_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with CIP36 catalyst registration and OTHER voting purpose",
|
||||
"description": "transaction with CIP36 governance registration and OTHER voting purpose",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -1148,7 +1148,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
"addressType": 0,
|
||||
@ -1203,7 +1203,7 @@
|
||||
"auxiliary_data_supplement": {
|
||||
"type": 1,
|
||||
"auxiliary_data_hash": "28b7ffa6800833bdfe5421739eaa21d4a49cde1d84e762b147001169f7c0a385",
|
||||
"catalyst_signature": "ebc00c615f988c6fc2e132d4419a719f04bbec56fe2569a00746a9e9b0d6e5bdd0809515cb2522c773c991c5ae39834403654d36b37e70b14897c0e98c8c0a0c"
|
||||
"governance_signature": "ebc00c615f988c6fc2e132d4419a719f04bbec56fe2569a00746a9e9b0d6e5bdd0809515cb2522c773c991c5ae39834403654d36b37e70b14897c0e98c8c0a0c"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1734,7 +1734,7 @@
|
||||
}
|
||||
],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
"addressType": 0,
|
||||
@ -1794,7 +1794,7 @@
|
||||
"auxiliary_data_supplement": {
|
||||
"type": 1,
|
||||
"auxiliary_data_hash": "544c9ae849c82e31224865ff936decc6160047409eee4a6b4178b729fe3d286c",
|
||||
"catalyst_signature": "3064949c9f186138f95e228075d0119dd5cb50e1b7e75d24d569fa547e018a597615da7c79a39ca8e394ee1ba8acb83e70be80f37e69aef3b86e7c4a6bd44903"
|
||||
"governance_signature": "3064949c9f186138f95e228075d0119dd5cb50e1b7e75d24d569fa547e018a597615da7c79a39ca8e394ee1ba8acb83e70be80f37e69aef3b86e7c4a6bd44903"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -457,7 +457,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with CIP36 catalyst registration and voting purpose not specified",
|
||||
"description": "transaction with CIP36 governance registration and voting purpose not specified",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
@ -467,7 +467,7 @@
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": {
|
||||
"catalyst_registration_parameters": {
|
||||
"governance_registration_parameters": {
|
||||
"staking_path": "m/1852'/1815'/0'/2/0",
|
||||
"reward_address_parameters": {
|
||||
"addressType": 0,
|
||||
@ -525,7 +525,7 @@
|
||||
"auxiliary_data_supplement": {
|
||||
"type": 1,
|
||||
"auxiliary_data_hash": "9d4c00f5b5b67760931fd7ed9850ff8e14dcdf957685191ab4bc755c52f0ed56",
|
||||
"catalyst_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
|
||||
"governance_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,12 +419,12 @@ if not utils.BITCOIN_ONLY:
|
||||
import trezor.enums.BinanceTimeInForce
|
||||
trezor.enums.CardanoAddressType
|
||||
import trezor.enums.CardanoAddressType
|
||||
trezor.enums.CardanoCatalystRegistrationFormat
|
||||
import trezor.enums.CardanoCatalystRegistrationFormat
|
||||
trezor.enums.CardanoCertificateType
|
||||
import trezor.enums.CardanoCertificateType
|
||||
trezor.enums.CardanoDerivationType
|
||||
import trezor.enums.CardanoDerivationType
|
||||
trezor.enums.CardanoGovernanceRegistrationFormat
|
||||
import trezor.enums.CardanoGovernanceRegistrationFormat
|
||||
trezor.enums.CardanoNativeScriptHashDisplayFormat
|
||||
import trezor.enums.CardanoNativeScriptHashDisplayFormat
|
||||
trezor.enums.CardanoNativeScriptType
|
||||
|
@ -291,9 +291,9 @@ Each transaction may contain auxiliary data. Auxiliary data format can be found
|
||||
|
||||
Auxiliary data can be sent to Trezor as a hash or as an object with parameters. The hash will be included in the transaction body as is and will be shown to the user.
|
||||
|
||||
The only object currently supported is Catalyst voting key registration. To be in compliance with the CDDL and other Cardano tools, Catalyst voting key registration object is being wrapped in a tuple and an empty tuple follows it. The empty tuple represents `auxiliary_scripts` which are not yet supported on Trezor and are thus always empty. Byron addresses are not supported as Catalyst reward addresses. The Catalyst registration signature is returned in the form of `CardanoTxAuxiliaryDataSupplement` which also contains the auxiliary data hash calculated by Trezor.
|
||||
The only object currently supported is governance voting key registration (currently, this is used only by Catalyst, but there may be other governance use cases in the future). To be in compliance with the CDDL and other Cardano tools, governance voting key registration object is being wrapped in a tuple and an empty tuple follows it. The empty tuple represents `auxiliary_scripts` which are not yet supported on Trezor and are thus always empty. Byron addresses are not supported as governance reward addresses. The governance registration signature is returned in the form of `CardanoTxAuxiliaryDataSupplement` which also contains the auxiliary data hash calculated by Trezor.
|
||||
|
||||
[Catalyst Registration Transaction Metadata Format](https://github.com/cardano-foundation/CIPs/blob/749f22eccd78e05fcdc4552c49639bb3bbd0a458/CIP-0015/CIP-0015.md)
|
||||
[Governance Registration Transaction Metadata Format](https://cips.cardano.org/cips/cip36/)
|
||||
|
||||
### Native scripts
|
||||
|
||||
|
@ -5,7 +5,7 @@ from trezor.crypto import hashlib
|
||||
from trezor.crypto.curve import ed25519
|
||||
from trezor.enums import (
|
||||
CardanoAddressType,
|
||||
CardanoCatalystRegistrationFormat,
|
||||
CardanoGovernanceRegistrationFormat,
|
||||
CardanoTxAuxiliaryDataSupplementType,
|
||||
)
|
||||
|
||||
@ -18,21 +18,21 @@ from .helpers.utils import derive_public_key
|
||||
|
||||
if TYPE_CHECKING:
|
||||
Delegations = list[tuple[bytes, int]]
|
||||
CatalystRegistrationPayload = dict[int, Delegations | bytes | int]
|
||||
SignedCatalystRegistrationPayload = tuple[CatalystRegistrationPayload, bytes]
|
||||
CatalystRegistrationSignature = dict[int, bytes]
|
||||
CatalystRegistration = dict[
|
||||
int, CatalystRegistrationPayload | CatalystRegistrationSignature
|
||||
GovernanceRegistrationPayload = dict[int, Delegations | bytes | int]
|
||||
SignedGovernanceRegistrationPayload = tuple[GovernanceRegistrationPayload, bytes]
|
||||
GovernanceRegistrationSignature = dict[int, bytes]
|
||||
GovernanceRegistration = dict[
|
||||
int, GovernanceRegistrationPayload | GovernanceRegistrationSignature
|
||||
]
|
||||
|
||||
from . import seed
|
||||
|
||||
AUXILIARY_DATA_HASH_SIZE = 32
|
||||
CATALYST_VOTING_PUBLIC_KEY_LENGTH = 32
|
||||
CATALYST_REGISTRATION_HASH_SIZE = 32
|
||||
GOVERNANCE_VOTING_PUBLIC_KEY_LENGTH = 32
|
||||
GOVERNANCE_REGISTRATION_HASH_SIZE = 32
|
||||
|
||||
METADATA_KEY_CATALYST_REGISTRATION = 61284
|
||||
METADATA_KEY_CATALYST_REGISTRATION_SIGNATURE = 61285
|
||||
METADATA_KEY_GOVERNANCE_REGISTRATION = 61284
|
||||
METADATA_KEY_GOVERNANCE_REGISTRATION_SIGNATURE = 61285
|
||||
|
||||
MAX_DELEGATION_COUNT = 32
|
||||
DEFAULT_VOTING_PURPOSE = 0
|
||||
@ -48,10 +48,10 @@ def validate(auxiliary_data: messages.CardanoTxAuxiliaryData) -> None:
|
||||
if auxiliary_data.hash:
|
||||
fields_provided += 1
|
||||
_validate_hash(auxiliary_data.hash)
|
||||
if auxiliary_data.catalyst_registration_parameters:
|
||||
if auxiliary_data.governance_registration_parameters:
|
||||
fields_provided += 1
|
||||
_validate_catalyst_registration_parameters(
|
||||
auxiliary_data.catalyst_registration_parameters
|
||||
_validate_governance_registration_parameters(
|
||||
auxiliary_data.governance_registration_parameters
|
||||
)
|
||||
assert_cond(fields_provided == 1)
|
||||
|
||||
@ -60,8 +60,8 @@ def _validate_hash(auxiliary_data_hash: bytes) -> None:
|
||||
assert_cond(len(auxiliary_data_hash) == AUXILIARY_DATA_HASH_SIZE)
|
||||
|
||||
|
||||
def _validate_catalyst_registration_parameters(
|
||||
parameters: messages.CardanoCatalystRegistrationParametersType,
|
||||
def _validate_governance_registration_parameters(
|
||||
parameters: messages.CardanoGovernanceRegistrationParametersType,
|
||||
) -> None:
|
||||
voting_key_fields_provided = 0
|
||||
if parameters.voting_public_key is not None:
|
||||
@ -69,7 +69,7 @@ def _validate_catalyst_registration_parameters(
|
||||
_validate_voting_public_key(parameters.voting_public_key)
|
||||
if parameters.delegations:
|
||||
voting_key_fields_provided += 1
|
||||
assert_cond(parameters.format == CardanoCatalystRegistrationFormat.CIP36)
|
||||
assert_cond(parameters.format == CardanoGovernanceRegistrationFormat.CIP36)
|
||||
_validate_delegations(parameters.delegations)
|
||||
assert_cond(voting_key_fields_provided == 1)
|
||||
|
||||
@ -80,15 +80,15 @@ def _validate_catalyst_registration_parameters(
|
||||
addresses.validate_address_parameters(address_parameters)
|
||||
|
||||
if parameters.voting_purpose is not None:
|
||||
assert_cond(parameters.format == CardanoCatalystRegistrationFormat.CIP36)
|
||||
assert_cond(parameters.format == CardanoGovernanceRegistrationFormat.CIP36)
|
||||
|
||||
|
||||
def _validate_voting_public_key(key: bytes) -> None:
|
||||
assert_cond(len(key) == CATALYST_VOTING_PUBLIC_KEY_LENGTH)
|
||||
assert_cond(len(key) == GOVERNANCE_VOTING_PUBLIC_KEY_LENGTH)
|
||||
|
||||
|
||||
def _validate_delegations(
|
||||
delegations: list[messages.CardanoCatalystDelegation],
|
||||
delegations: list[messages.CardanoGovernanceDelegation],
|
||||
) -> None:
|
||||
assert_cond(len(delegations) <= MAX_DELEGATION_COUNT)
|
||||
for delegation in delegations:
|
||||
@ -96,9 +96,9 @@ def _validate_delegations(
|
||||
|
||||
|
||||
def _get_voting_purpose_to_serialize(
|
||||
parameters: messages.CardanoCatalystRegistrationParametersType,
|
||||
parameters: messages.CardanoGovernanceRegistrationParametersType,
|
||||
) -> int | None:
|
||||
if parameters.format == CardanoCatalystRegistrationFormat.CIP15:
|
||||
if parameters.format == CardanoGovernanceRegistrationFormat.CIP15:
|
||||
return None
|
||||
if parameters.voting_purpose is None:
|
||||
return DEFAULT_VOTING_PURPOSE
|
||||
@ -109,13 +109,13 @@ async def show(
|
||||
ctx: wire.Context,
|
||||
keychain: seed.Keychain,
|
||||
auxiliary_data_hash: bytes,
|
||||
parameters: messages.CardanoCatalystRegistrationParametersType | None,
|
||||
parameters: messages.CardanoGovernanceRegistrationParametersType | None,
|
||||
protocol_magic: int,
|
||||
network_id: int,
|
||||
should_show_details: bool,
|
||||
) -> None:
|
||||
if parameters:
|
||||
await _show_catalyst_registration(
|
||||
await _show_governance_registration(
|
||||
ctx,
|
||||
keychain,
|
||||
parameters,
|
||||
@ -128,10 +128,10 @@ async def show(
|
||||
await layout.show_auxiliary_data_hash(ctx, auxiliary_data_hash)
|
||||
|
||||
|
||||
async def _show_catalyst_registration(
|
||||
async def _show_governance_registration(
|
||||
ctx: wire.Context,
|
||||
keychain: seed.Keychain,
|
||||
parameters: messages.CardanoCatalystRegistrationParametersType,
|
||||
parameters: messages.CardanoGovernanceRegistrationParametersType,
|
||||
protocol_magic: int,
|
||||
network_id: int,
|
||||
should_show_details: bool,
|
||||
@ -140,7 +140,7 @@ async def _show_catalyst_registration(
|
||||
encoded_public_key = bech32.encode(
|
||||
bech32.HRP_JORMUN_PUBLIC_KEY, delegation.voting_public_key
|
||||
)
|
||||
await layout.confirm_catalyst_registration_delegation(
|
||||
await layout.confirm_governance_registration_delegation(
|
||||
ctx, encoded_public_key, delegation.weight
|
||||
)
|
||||
|
||||
@ -161,7 +161,7 @@ async def _show_catalyst_registration(
|
||||
_get_voting_purpose_to_serialize(parameters) if should_show_details else None
|
||||
)
|
||||
|
||||
await layout.confirm_catalyst_registration(
|
||||
await layout.confirm_governance_registration(
|
||||
ctx,
|
||||
encoded_public_key,
|
||||
parameters.staking_path,
|
||||
@ -177,20 +177,20 @@ def get_hash_and_supplement(
|
||||
protocol_magic: int,
|
||||
network_id: int,
|
||||
) -> tuple[bytes, messages.CardanoTxAuxiliaryDataSupplement]:
|
||||
if parameters := auxiliary_data.catalyst_registration_parameters:
|
||||
if parameters := auxiliary_data.governance_registration_parameters:
|
||||
(
|
||||
catalyst_registration_payload,
|
||||
catalyst_signature,
|
||||
) = _get_signed_catalyst_registration_payload(
|
||||
governance_registration_payload,
|
||||
governance_signature,
|
||||
) = _get_signed_governance_registration_payload(
|
||||
keychain, parameters, protocol_magic, network_id
|
||||
)
|
||||
auxiliary_data_hash = _get_catalyst_registration_hash(
|
||||
catalyst_registration_payload, catalyst_signature
|
||||
auxiliary_data_hash = _get_governance_registration_hash(
|
||||
governance_registration_payload, governance_signature
|
||||
)
|
||||
auxiliary_data_supplement = messages.CardanoTxAuxiliaryDataSupplement(
|
||||
type=CardanoTxAuxiliaryDataSupplementType.CATALYST_REGISTRATION_SIGNATURE,
|
||||
type=CardanoTxAuxiliaryDataSupplementType.GOVERNANCE_REGISTRATION_SIGNATURE,
|
||||
auxiliary_data_hash=auxiliary_data_hash,
|
||||
catalyst_signature=catalyst_signature,
|
||||
governance_signature=governance_signature,
|
||||
)
|
||||
return auxiliary_data_hash, auxiliary_data_supplement
|
||||
else:
|
||||
@ -200,35 +200,35 @@ def get_hash_and_supplement(
|
||||
)
|
||||
|
||||
|
||||
def _get_catalyst_registration_hash(
|
||||
catalyst_registration_payload: CatalystRegistrationPayload,
|
||||
catalyst_registration_payload_signature: bytes,
|
||||
def _get_governance_registration_hash(
|
||||
governance_registration_payload: GovernanceRegistrationPayload,
|
||||
governance_registration_payload_signature: bytes,
|
||||
) -> bytes:
|
||||
cborized_catalyst_registration = _cborize_catalyst_registration(
|
||||
catalyst_registration_payload,
|
||||
catalyst_registration_payload_signature,
|
||||
cborized_governance_registration = _cborize_governance_registration(
|
||||
governance_registration_payload,
|
||||
governance_registration_payload_signature,
|
||||
)
|
||||
return _get_hash(cbor.encode(_wrap_metadata(cborized_catalyst_registration)))
|
||||
return _get_hash(cbor.encode(_wrap_metadata(cborized_governance_registration)))
|
||||
|
||||
|
||||
def _cborize_catalyst_registration(
|
||||
catalyst_registration_payload: CatalystRegistrationPayload,
|
||||
catalyst_registration_payload_signature: bytes,
|
||||
) -> CatalystRegistration:
|
||||
catalyst_registration_signature = {1: catalyst_registration_payload_signature}
|
||||
def _cborize_governance_registration(
|
||||
governance_registration_payload: GovernanceRegistrationPayload,
|
||||
governance_registration_payload_signature: bytes,
|
||||
) -> GovernanceRegistration:
|
||||
governance_registration_signature = {1: governance_registration_payload_signature}
|
||||
|
||||
return {
|
||||
METADATA_KEY_CATALYST_REGISTRATION: catalyst_registration_payload,
|
||||
METADATA_KEY_CATALYST_REGISTRATION_SIGNATURE: catalyst_registration_signature,
|
||||
METADATA_KEY_GOVERNANCE_REGISTRATION: governance_registration_payload,
|
||||
METADATA_KEY_GOVERNANCE_REGISTRATION_SIGNATURE: governance_registration_signature,
|
||||
}
|
||||
|
||||
|
||||
def _get_signed_catalyst_registration_payload(
|
||||
def _get_signed_governance_registration_payload(
|
||||
keychain: seed.Keychain,
|
||||
parameters: messages.CardanoCatalystRegistrationParametersType,
|
||||
parameters: messages.CardanoGovernanceRegistrationParametersType,
|
||||
protocol_magic: int,
|
||||
network_id: int,
|
||||
) -> SignedCatalystRegistrationPayload:
|
||||
) -> SignedGovernanceRegistrationPayload:
|
||||
delegations_or_key: Delegations | bytes
|
||||
if len(parameters.delegations) > 0:
|
||||
delegations_or_key = [
|
||||
@ -251,7 +251,7 @@ def _get_signed_catalyst_registration_payload(
|
||||
|
||||
voting_purpose = _get_voting_purpose_to_serialize(parameters)
|
||||
|
||||
payload: CatalystRegistrationPayload = {
|
||||
payload: GovernanceRegistrationPayload = {
|
||||
1: delegations_or_key,
|
||||
2: staking_key,
|
||||
3: reward_address,
|
||||
@ -260,7 +260,7 @@ def _get_signed_catalyst_registration_payload(
|
||||
if voting_purpose is not None:
|
||||
payload[5] = voting_purpose
|
||||
|
||||
signature = _create_catalyst_registration_payload_signature(
|
||||
signature = _create_governance_registration_payload_signature(
|
||||
keychain,
|
||||
payload,
|
||||
parameters.staking_path,
|
||||
@ -269,24 +269,24 @@ def _get_signed_catalyst_registration_payload(
|
||||
return payload, signature
|
||||
|
||||
|
||||
def _create_catalyst_registration_payload_signature(
|
||||
def _create_governance_registration_payload_signature(
|
||||
keychain: seed.Keychain,
|
||||
catalyst_registration_payload: CatalystRegistrationPayload,
|
||||
governance_registration_payload: GovernanceRegistrationPayload,
|
||||
path: list[int],
|
||||
) -> bytes:
|
||||
node = keychain.derive(path)
|
||||
|
||||
encoded_catalyst_registration = cbor.encode(
|
||||
{METADATA_KEY_CATALYST_REGISTRATION: catalyst_registration_payload}
|
||||
encoded_governance_registration = cbor.encode(
|
||||
{METADATA_KEY_GOVERNANCE_REGISTRATION: governance_registration_payload}
|
||||
)
|
||||
|
||||
catalyst_registration_hash = hashlib.blake2b(
|
||||
data=encoded_catalyst_registration,
|
||||
outlen=CATALYST_REGISTRATION_HASH_SIZE,
|
||||
governance_registration_hash = hashlib.blake2b(
|
||||
data=encoded_governance_registration,
|
||||
outlen=GOVERNANCE_REGISTRATION_HASH_SIZE,
|
||||
).digest()
|
||||
|
||||
return ed25519.sign_ext(
|
||||
node.private_key(), node.private_key_ext(), catalyst_registration_hash
|
||||
node.private_key(), node.private_key_ext(), governance_registration_hash
|
||||
)
|
||||
|
||||
|
||||
|
@ -750,13 +750,13 @@ def _format_stake_credential(
|
||||
raise ValueError
|
||||
|
||||
|
||||
async def confirm_catalyst_registration_delegation(
|
||||
async def confirm_governance_registration_delegation(
|
||||
ctx: wire.Context,
|
||||
public_key: str,
|
||||
weight: int,
|
||||
) -> None:
|
||||
props: list[PropertyType] = [
|
||||
("Catalyst voting key registration", None),
|
||||
("Governance voting key registration", None),
|
||||
("Delegating to:", public_key),
|
||||
]
|
||||
if weight is not None:
|
||||
@ -764,14 +764,14 @@ async def confirm_catalyst_registration_delegation(
|
||||
|
||||
await confirm_properties(
|
||||
ctx,
|
||||
"confirm_catalyst_registration_delegation",
|
||||
"confirm_governance_registration_delegation",
|
||||
title="Confirm transaction",
|
||||
props=props,
|
||||
br_code=ButtonRequestType.Other,
|
||||
)
|
||||
|
||||
|
||||
async def confirm_catalyst_registration(
|
||||
async def confirm_governance_registration(
|
||||
ctx: wire.Context,
|
||||
public_key: str | None,
|
||||
staking_path: list[int],
|
||||
@ -779,7 +779,7 @@ async def confirm_catalyst_registration(
|
||||
nonce: int,
|
||||
voting_purpose: int | None,
|
||||
) -> None:
|
||||
props: list[PropertyType] = [("Catalyst voting key registration", None)]
|
||||
props: list[PropertyType] = [("Governance voting key registration", None)]
|
||||
if public_key is not None:
|
||||
props.append(("Voting public key:", public_key))
|
||||
props.extend(
|
||||
@ -802,7 +802,7 @@ async def confirm_catalyst_registration(
|
||||
|
||||
await confirm_properties(
|
||||
ctx,
|
||||
"confirm_catalyst_registration",
|
||||
"confirm_governance_registration",
|
||||
title="Confirm transaction",
|
||||
props=props,
|
||||
br_code=ButtonRequestType.Other,
|
||||
|
@ -839,7 +839,7 @@ class Signer:
|
||||
self.ctx,
|
||||
self.keychain,
|
||||
auxiliary_data_hash,
|
||||
data.catalyst_registration_parameters,
|
||||
data.governance_registration_parameters,
|
||||
self.msg.protocol_magic,
|
||||
self.msg.network_id,
|
||||
self.should_show_details,
|
||||
|
@ -3,4 +3,4 @@
|
||||
# isort:skip_file
|
||||
|
||||
NONE = 0
|
||||
CATALYST_REGISTRATION_SIGNATURE = 1
|
||||
GOVERNANCE_REGISTRATION_SIGNATURE = 1
|
||||
|
@ -381,9 +381,9 @@ if TYPE_CHECKING:
|
||||
|
||||
class CardanoTxAuxiliaryDataSupplementType(IntEnum):
|
||||
NONE = 0
|
||||
CATALYST_REGISTRATION_SIGNATURE = 1
|
||||
GOVERNANCE_REGISTRATION_SIGNATURE = 1
|
||||
|
||||
class CardanoCatalystRegistrationFormat(IntEnum):
|
||||
class CardanoGovernanceRegistrationFormat(IntEnum):
|
||||
CIP15 = 0
|
||||
CIP36 = 1
|
||||
|
||||
|
@ -24,9 +24,9 @@ if TYPE_CHECKING:
|
||||
from trezor.enums import ButtonRequestType # noqa: F401
|
||||
from trezor.enums import Capability # noqa: F401
|
||||
from trezor.enums import CardanoAddressType # noqa: F401
|
||||
from trezor.enums import CardanoCatalystRegistrationFormat # noqa: F401
|
||||
from trezor.enums import CardanoCertificateType # noqa: F401
|
||||
from trezor.enums import CardanoDerivationType # noqa: F401
|
||||
from trezor.enums import CardanoGovernanceRegistrationFormat # noqa: F401
|
||||
from trezor.enums import CardanoNativeScriptHashDisplayFormat # noqa: F401
|
||||
from trezor.enums import CardanoNativeScriptType # noqa: F401
|
||||
from trezor.enums import CardanoPoolRelayType # noqa: F401
|
||||
@ -1637,7 +1637,7 @@ if TYPE_CHECKING:
|
||||
def is_type_of(cls, msg: Any) -> TypeGuard["CardanoTxWithdrawal"]:
|
||||
return isinstance(msg, cls)
|
||||
|
||||
class CardanoCatalystRegistrationDelegation(protobuf.MessageType):
|
||||
class CardanoGovernanceRegistrationDelegation(protobuf.MessageType):
|
||||
voting_public_key: "bytes"
|
||||
weight: "int"
|
||||
|
||||
@ -1650,16 +1650,16 @@ if TYPE_CHECKING:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def is_type_of(cls, msg: Any) -> TypeGuard["CardanoCatalystRegistrationDelegation"]:
|
||||
def is_type_of(cls, msg: Any) -> TypeGuard["CardanoGovernanceRegistrationDelegation"]:
|
||||
return isinstance(msg, cls)
|
||||
|
||||
class CardanoCatalystRegistrationParametersType(protobuf.MessageType):
|
||||
class CardanoGovernanceRegistrationParametersType(protobuf.MessageType):
|
||||
voting_public_key: "bytes | None"
|
||||
staking_path: "list[int]"
|
||||
reward_address_parameters: "CardanoAddressParametersType"
|
||||
nonce: "int"
|
||||
format: "CardanoCatalystRegistrationFormat"
|
||||
delegations: "list[CardanoCatalystRegistrationDelegation]"
|
||||
format: "CardanoGovernanceRegistrationFormat"
|
||||
delegations: "list[CardanoGovernanceRegistrationDelegation]"
|
||||
voting_purpose: "int | None"
|
||||
|
||||
def __init__(
|
||||
@ -1668,25 +1668,25 @@ if TYPE_CHECKING:
|
||||
reward_address_parameters: "CardanoAddressParametersType",
|
||||
nonce: "int",
|
||||
staking_path: "list[int] | None" = None,
|
||||
delegations: "list[CardanoCatalystRegistrationDelegation] | None" = None,
|
||||
delegations: "list[CardanoGovernanceRegistrationDelegation] | None" = None,
|
||||
voting_public_key: "bytes | None" = None,
|
||||
format: "CardanoCatalystRegistrationFormat | None" = None,
|
||||
format: "CardanoGovernanceRegistrationFormat | None" = None,
|
||||
voting_purpose: "int | None" = None,
|
||||
) -> None:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def is_type_of(cls, msg: Any) -> TypeGuard["CardanoCatalystRegistrationParametersType"]:
|
||||
def is_type_of(cls, msg: Any) -> TypeGuard["CardanoGovernanceRegistrationParametersType"]:
|
||||
return isinstance(msg, cls)
|
||||
|
||||
class CardanoTxAuxiliaryData(protobuf.MessageType):
|
||||
catalyst_registration_parameters: "CardanoCatalystRegistrationParametersType | None"
|
||||
governance_registration_parameters: "CardanoGovernanceRegistrationParametersType | None"
|
||||
hash: "bytes | None"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
catalyst_registration_parameters: "CardanoCatalystRegistrationParametersType | None" = None,
|
||||
governance_registration_parameters: "CardanoGovernanceRegistrationParametersType | None" = None,
|
||||
hash: "bytes | None" = None,
|
||||
) -> None:
|
||||
pass
|
||||
@ -1766,14 +1766,14 @@ if TYPE_CHECKING:
|
||||
class CardanoTxAuxiliaryDataSupplement(protobuf.MessageType):
|
||||
type: "CardanoTxAuxiliaryDataSupplementType"
|
||||
auxiliary_data_hash: "bytes | None"
|
||||
catalyst_signature: "bytes | None"
|
||||
governance_signature: "bytes | None"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
type: "CardanoTxAuxiliaryDataSupplementType",
|
||||
auxiliary_data_hash: "bytes | None" = None,
|
||||
catalyst_signature: "bytes | None" = None,
|
||||
governance_signature: "bytes | None" = None,
|
||||
) -> None:
|
||||
pass
|
||||
|
||||
|
@ -56,12 +56,12 @@ REQUIRED_FIELDS_POOL_PARAMETERS = (
|
||||
"owners",
|
||||
)
|
||||
REQUIRED_FIELDS_TOKEN_GROUP = ("policy_id", "tokens")
|
||||
REQUIRED_FIELDS_CATALYST_REGISTRATION = (
|
||||
REQUIRED_FIELDS_GOVERNANCE_REGISTRATION = (
|
||||
"staking_path",
|
||||
"nonce",
|
||||
"reward_address_parameters",
|
||||
)
|
||||
REQUIRED_FIELDS_CATALYST_DELEGATION = ("voting_public_key", "weight")
|
||||
REQUIRED_FIELDS_GOVERNANCE_DELEGATION = ("voting_public_key", "weight")
|
||||
|
||||
INCOMPLETE_OUTPUT_ERROR_MESSAGE = "The output is missing some fields"
|
||||
|
||||
@ -558,40 +558,41 @@ def parse_auxiliary_data(
|
||||
# include all provided fields so we can test validation in FW
|
||||
hash = parse_optional_bytes(auxiliary_data.get("hash"))
|
||||
|
||||
catalyst_registration_parameters = None
|
||||
if "catalyst_registration_parameters" in auxiliary_data:
|
||||
catalyst_registration = auxiliary_data["catalyst_registration_parameters"]
|
||||
governance_registration_parameters = None
|
||||
if "governance_registration_parameters" in auxiliary_data:
|
||||
governance_registration = auxiliary_data["governance_registration_parameters"]
|
||||
if not all(
|
||||
k in catalyst_registration for k in REQUIRED_FIELDS_CATALYST_REGISTRATION
|
||||
k in governance_registration
|
||||
for k in REQUIRED_FIELDS_GOVERNANCE_REGISTRATION
|
||||
):
|
||||
raise AUXILIARY_DATA_MISSING_FIELDS_ERROR
|
||||
|
||||
serialization_format = catalyst_registration.get("format")
|
||||
serialization_format = governance_registration.get("format")
|
||||
|
||||
delegations = []
|
||||
for delegation in catalyst_registration.get("delegations", []):
|
||||
if not all(k in delegation for k in REQUIRED_FIELDS_CATALYST_DELEGATION):
|
||||
for delegation in governance_registration.get("delegations", []):
|
||||
if not all(k in delegation for k in REQUIRED_FIELDS_GOVERNANCE_DELEGATION):
|
||||
raise AUXILIARY_DATA_MISSING_FIELDS_ERROR
|
||||
delegations.append(
|
||||
messages.CardanoCatalystRegistrationDelegation(
|
||||
messages.CardanoGovernanceRegistrationDelegation(
|
||||
voting_public_key=bytes.fromhex(delegation["voting_public_key"]),
|
||||
weight=int(delegation["weight"]),
|
||||
)
|
||||
)
|
||||
|
||||
voting_purpose = None
|
||||
if serialization_format == messages.CardanoCatalystRegistrationFormat.CIP36:
|
||||
voting_purpose = catalyst_registration.get("voting_purpose")
|
||||
if serialization_format == messages.CardanoGovernanceRegistrationFormat.CIP36:
|
||||
voting_purpose = governance_registration.get("voting_purpose")
|
||||
|
||||
catalyst_registration_parameters = (
|
||||
messages.CardanoCatalystRegistrationParametersType(
|
||||
governance_registration_parameters = (
|
||||
messages.CardanoGovernanceRegistrationParametersType(
|
||||
voting_public_key=parse_optional_bytes(
|
||||
catalyst_registration.get("voting_public_key")
|
||||
governance_registration.get("voting_public_key")
|
||||
),
|
||||
staking_path=tools.parse_path(catalyst_registration["staking_path"]),
|
||||
nonce=catalyst_registration["nonce"],
|
||||
staking_path=tools.parse_path(governance_registration["staking_path"]),
|
||||
nonce=governance_registration["nonce"],
|
||||
reward_address_parameters=_parse_address_parameters(
|
||||
catalyst_registration["reward_address_parameters"],
|
||||
governance_registration["reward_address_parameters"],
|
||||
str(AUXILIARY_DATA_MISSING_FIELDS_ERROR),
|
||||
),
|
||||
format=serialization_format,
|
||||
@ -600,12 +601,12 @@ def parse_auxiliary_data(
|
||||
)
|
||||
)
|
||||
|
||||
if hash is None and catalyst_registration_parameters is None:
|
||||
if hash is None and governance_registration_parameters is None:
|
||||
raise AUXILIARY_DATA_MISSING_FIELDS_ERROR
|
||||
|
||||
return messages.CardanoTxAuxiliaryData(
|
||||
hash=hash,
|
||||
catalyst_registration_parameters=catalyst_registration_parameters,
|
||||
governance_registration_parameters=governance_registration_parameters,
|
||||
)
|
||||
|
||||
|
||||
|
@ -156,9 +156,11 @@ def sign_tx(
|
||||
auxiliary_data_supplement["auxiliary_data_hash"] = auxiliary_data_supplement[
|
||||
"auxiliary_data_hash"
|
||||
].hex()
|
||||
catalyst_signature = auxiliary_data_supplement.get("catalyst_signature")
|
||||
if catalyst_signature:
|
||||
auxiliary_data_supplement["catalyst_signature"] = catalyst_signature.hex()
|
||||
governance_signature = auxiliary_data_supplement.get("governance_signature")
|
||||
if governance_signature:
|
||||
auxiliary_data_supplement[
|
||||
"governance_signature"
|
||||
] = governance_signature.hex()
|
||||
sign_tx_response["auxiliary_data_supplement"] = auxiliary_data_supplement
|
||||
return sign_tx_response
|
||||
|
||||
|
@ -405,10 +405,10 @@ class CardanoPoolRelayType(IntEnum):
|
||||
|
||||
class CardanoTxAuxiliaryDataSupplementType(IntEnum):
|
||||
NONE = 0
|
||||
CATALYST_REGISTRATION_SIGNATURE = 1
|
||||
GOVERNANCE_REGISTRATION_SIGNATURE = 1
|
||||
|
||||
|
||||
class CardanoCatalystRegistrationFormat(IntEnum):
|
||||
class CardanoGovernanceRegistrationFormat(IntEnum):
|
||||
CIP15 = 0
|
||||
CIP36 = 1
|
||||
|
||||
@ -2631,7 +2631,7 @@ class CardanoTxWithdrawal(protobuf.MessageType):
|
||||
self.key_hash = key_hash
|
||||
|
||||
|
||||
class CardanoCatalystRegistrationDelegation(protobuf.MessageType):
|
||||
class CardanoGovernanceRegistrationDelegation(protobuf.MessageType):
|
||||
MESSAGE_WIRE_TYPE = None
|
||||
FIELDS = {
|
||||
1: protobuf.Field("voting_public_key", "bytes", repeated=False, required=True),
|
||||
@ -2648,15 +2648,15 @@ class CardanoCatalystRegistrationDelegation(protobuf.MessageType):
|
||||
self.weight = weight
|
||||
|
||||
|
||||
class CardanoCatalystRegistrationParametersType(protobuf.MessageType):
|
||||
class CardanoGovernanceRegistrationParametersType(protobuf.MessageType):
|
||||
MESSAGE_WIRE_TYPE = None
|
||||
FIELDS = {
|
||||
1: protobuf.Field("voting_public_key", "bytes", repeated=False, required=False),
|
||||
2: protobuf.Field("staking_path", "uint32", repeated=True, required=False),
|
||||
3: protobuf.Field("reward_address_parameters", "CardanoAddressParametersType", repeated=False, required=True),
|
||||
4: protobuf.Field("nonce", "uint64", repeated=False, required=True),
|
||||
5: protobuf.Field("format", "CardanoCatalystRegistrationFormat", repeated=False, required=False),
|
||||
6: protobuf.Field("delegations", "CardanoCatalystRegistrationDelegation", repeated=True, required=False),
|
||||
5: protobuf.Field("format", "CardanoGovernanceRegistrationFormat", repeated=False, required=False),
|
||||
6: protobuf.Field("delegations", "CardanoGovernanceRegistrationDelegation", repeated=True, required=False),
|
||||
7: protobuf.Field("voting_purpose", "uint64", repeated=False, required=False),
|
||||
}
|
||||
|
||||
@ -2666,13 +2666,13 @@ class CardanoCatalystRegistrationParametersType(protobuf.MessageType):
|
||||
reward_address_parameters: "CardanoAddressParametersType",
|
||||
nonce: "int",
|
||||
staking_path: Optional[Sequence["int"]] = None,
|
||||
delegations: Optional[Sequence["CardanoCatalystRegistrationDelegation"]] = None,
|
||||
delegations: Optional[Sequence["CardanoGovernanceRegistrationDelegation"]] = None,
|
||||
voting_public_key: Optional["bytes"] = None,
|
||||
format: Optional["CardanoCatalystRegistrationFormat"] = CardanoCatalystRegistrationFormat.CIP15,
|
||||
format: Optional["CardanoGovernanceRegistrationFormat"] = CardanoGovernanceRegistrationFormat.CIP15,
|
||||
voting_purpose: Optional["int"] = None,
|
||||
) -> None:
|
||||
self.staking_path: Sequence["int"] = staking_path if staking_path is not None else []
|
||||
self.delegations: Sequence["CardanoCatalystRegistrationDelegation"] = delegations if delegations is not None else []
|
||||
self.delegations: Sequence["CardanoGovernanceRegistrationDelegation"] = delegations if delegations is not None else []
|
||||
self.reward_address_parameters = reward_address_parameters
|
||||
self.nonce = nonce
|
||||
self.voting_public_key = voting_public_key
|
||||
@ -2683,17 +2683,17 @@ class CardanoCatalystRegistrationParametersType(protobuf.MessageType):
|
||||
class CardanoTxAuxiliaryData(protobuf.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 327
|
||||
FIELDS = {
|
||||
1: protobuf.Field("catalyst_registration_parameters", "CardanoCatalystRegistrationParametersType", repeated=False, required=False),
|
||||
1: protobuf.Field("governance_registration_parameters", "CardanoGovernanceRegistrationParametersType", repeated=False, required=False),
|
||||
2: protobuf.Field("hash", "bytes", repeated=False, required=False),
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
catalyst_registration_parameters: Optional["CardanoCatalystRegistrationParametersType"] = None,
|
||||
governance_registration_parameters: Optional["CardanoGovernanceRegistrationParametersType"] = None,
|
||||
hash: Optional["bytes"] = None,
|
||||
) -> None:
|
||||
self.catalyst_registration_parameters = catalyst_registration_parameters
|
||||
self.governance_registration_parameters = governance_registration_parameters
|
||||
self.hash = hash
|
||||
|
||||
|
||||
@ -2771,7 +2771,7 @@ class CardanoTxAuxiliaryDataSupplement(protobuf.MessageType):
|
||||
FIELDS = {
|
||||
1: protobuf.Field("type", "CardanoTxAuxiliaryDataSupplementType", repeated=False, required=True),
|
||||
2: protobuf.Field("auxiliary_data_hash", "bytes", repeated=False, required=False),
|
||||
3: protobuf.Field("catalyst_signature", "bytes", repeated=False, required=False),
|
||||
3: protobuf.Field("governance_signature", "bytes", repeated=False, required=False),
|
||||
}
|
||||
|
||||
def __init__(
|
||||
@ -2779,11 +2779,11 @@ class CardanoTxAuxiliaryDataSupplement(protobuf.MessageType):
|
||||
*,
|
||||
type: "CardanoTxAuxiliaryDataSupplementType",
|
||||
auxiliary_data_hash: Optional["bytes"] = None,
|
||||
catalyst_signature: Optional["bytes"] = None,
|
||||
governance_signature: Optional["bytes"] = None,
|
||||
) -> None:
|
||||
self.type = type
|
||||
self.auxiliary_data_hash = auxiliary_data_hash
|
||||
self.catalyst_signature = catalyst_signature
|
||||
self.governance_signature = governance_signature
|
||||
|
||||
|
||||
class CardanoTxWitnessRequest(protobuf.MessageType):
|
||||
|
@ -159,8 +159,8 @@ def _transform_expected_result(result):
|
||||
"type": supplement["type"],
|
||||
"auxiliary_data_hash": bytes.fromhex(supplement["auxiliary_data_hash"]),
|
||||
}
|
||||
if catalyst_signature := supplement.get("catalyst_signature"):
|
||||
if governance_signature := supplement.get("governance_signature"):
|
||||
transformed_result["auxiliary_data_supplement"][
|
||||
"catalyst_signature"
|
||||
] = bytes.fromhex(catalyst_signature)
|
||||
"governance_signature"
|
||||
] = bytes.fromhex(governance_signature)
|
||||
return transformed_result
|
||||
|
@ -1171,7 +1171,7 @@
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_auxiliary_data_hash]": "53b24d40fc3ed95b8f102e8c5f2b885836eb5c56dd8aa0fdf3116bfb7187813c",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_base_address_change_output_p-3c7243e1": "54266c3f100fae1303bb579bb3b731a24908eee78c634b1ba92af0dfbcf19d82",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_base_address_change_output_s-20438873": "b616c4005ee1a2728953ceb3a154e578d8ce53a908b6f11e8598290a3842f08a",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_catalyst_registration]": "3abfe7b0f3de4adacf9d07653eb0d3c80eb4c8876dc456f8c88b2e68ba14850c",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_governance_registration]": "3abfe7b0f3de4adacf9d07653eb0d3c80eb4c8876dc456f8c88b2e68ba14850c",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_everything_set_except_pool_r-1e1ef130": "9130bf5c2da6543833a3c841b18e649768f5c27108695a6227b0cb747a34be3d",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_stake_deregistration]": "fea08104b2228ba952c9f0ccb64a88fee1c1fc91aa1fca951e812d1a50f7c771",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx[transaction_with_stake_deregistration_and_withdrawal]": "fea08104b2228ba952c9f0ccb64a88fee1c1fc91aa1fca951e812d1a50f7c771",
|
||||
@ -1284,7 +1284,7 @@
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[testnet_transaction_with_mainnet_output]": "5a608b731c43231bcae0a856e74497612ccfeff809e5022dfb27798863e1bfb1",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[total_collateral_is_present]": "9e1f554bb74f847e8f09201dda808fd1e0cdb68737515f34d6ad435957671c77",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_both_auxiliary_data_b-64274ac4": "2b85ec100a491345e0084c4efc226f60645fb47c56fb84ff133b2cb850cdd1f2",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_catalyst_registration-11533421": "2b85ec100a491345e0084c4efc226f60645fb47c56fb84ff133b2cb850cdd1f2",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_governance_registration-11533421": "2b85ec100a491345e0084c4efc226f60645fb47c56fb84ff133b2cb850cdd1f2",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[two_owners_with_path]": "7b2acc6b455cc40edcacdd0806c04040241f3c21205cfd25a3420c5ef65f33c4",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[unsupported_address_type]": "5a608b731c43231bcae0a856e74497612ccfeff809e5022dfb27798863e1bfb1",
|
||||
"TT_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[with_multisig_transaction_signing_mode]": "d2ee9af7349df63db617a497532ed03a9fa4c26dac455348cc9e65ca7bc04de7",
|
||||
@ -2345,7 +2345,7 @@
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[testnet_transaction_with_mainnet_output]": "cbfd7d957541a2ab43c47ccdcf2fa61893d817f888c2ce65af0af14b61c11425",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[total_collateral_is_present]": "6f59841dc5e3597d0940a7b4be0813b25555652180043634c9018272c5a22a3a",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_both_auxiliary_data_b-64274ac4": "f71fe6d2af5c42cd6c75af8249deb3f14494ffa33e523469037b49cb13311991",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_catalyst_registration-11533421": "f71fe6d2af5c42cd6c75af8249deb3f14494ffa33e523469037b49cb13311991",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[transaction_with_governance_registration-11533421": "f71fe6d2af5c42cd6c75af8249deb3f14494ffa33e523469037b49cb13311991",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[two_owners_with_path]": "4ce6a2c9ffd6e26da53fa0a303b5a60c5d1bc4b0ec390fe70f08250fd0635ec2",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[unsupported_address_type]": "cbfd7d957541a2ab43c47ccdcf2fa61893d817f888c2ce65af0af14b61c11425",
|
||||
"TTui2_cardano-test_sign_tx.py::test_cardano_sign_tx_failed[with_multisig_transaction_signing_mode]": "1046e4587492a3ca32656c7f772db75462abd816d36f60e33022a783a8f155ea",
|
||||
|
Loading…
Reference in New Issue
Block a user