1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +00:00

chore(cardano): update voting public key bech32 prefix

This commit is contained in:
David Misiak 2022-10-07 14:46:29 +02:00 committed by matejcik
parent c36870defa
commit 3b289a4d2c
2 changed files with 3 additions and 4 deletions

View File

@ -138,7 +138,7 @@ async def _show_governance_registration(
) -> None:
for delegation in parameters.delegations:
encoded_public_key = bech32.encode(
bech32.HRP_JORMUN_PUBLIC_KEY, delegation.voting_public_key
bech32.HRP_GOVERNANCE_PUBLIC_KEY, delegation.voting_public_key
)
await layout.confirm_governance_registration_delegation(
ctx, encoded_public_key, delegation.weight
@ -147,7 +147,7 @@ async def _show_governance_registration(
encoded_public_key: str | None = None
if parameters.voting_public_key:
encoded_public_key = bech32.encode(
bech32.HRP_JORMUN_PUBLIC_KEY, parameters.voting_public_key
bech32.HRP_GOVERNANCE_PUBLIC_KEY, parameters.voting_public_key
)
reward_address = addresses.derive_human_readable(

View File

@ -7,8 +7,7 @@ HRP_ADDRESS = "addr"
HRP_TESTNET_ADDRESS = "addr_test"
HRP_REWARD_ADDRESS = "stake"
HRP_TESTNET_REWARD_ADDRESS = "stake_test"
# Jormungandr public key prefix - https://github.com/input-output-hk/voting-tools-lib/blob/18dae637e80db72444476606ab264b973bcf1a9d/src/Cardano/API/Extended.hs#L226
HRP_JORMUN_PUBLIC_KEY = "ed25519_pk"
HRP_GOVERNANCE_PUBLIC_KEY = "gov_vk"
HRP_SCRIPT_HASH = "script"
HRP_KEY_HASH = "addr_vkh"
HRP_SHARED_KEY_HASH = "addr_shared_vkh"