88
99from . import seed
1010from .addresses import assert_params_cond
11- from .helpers .paths import SCHEMA_STAKING_ANY_ACCOUNT
1211
1312if TYPE_CHECKING :
1413 from trezor .wire import Context
@@ -22,7 +21,8 @@ async def sign_message(
2221 from trezor .messages import CardanoMessageSignature , CardanoAddressParametersType
2322 from trezor .enums import CardanoAddressType
2423 from apps .common import paths
25- from .helpers .paths import SCHEMA_MINT , SCHEMA_PAYMENT
24+ from .helpers .paths import SCHEMA_PAYMENT , SCHEMA_STAKING_ANY_ACCOUNT
25+
2626 from trezor .crypto .curve import ed25519
2727 from trezor import wire
2828 from .helpers import network_ids , protocol_magics
@@ -38,10 +38,10 @@ async def sign_message(
3838 msg .address_n ,
3939 True ,
4040 # path must match the PUBKEY schema
41- ( SCHEMA_PAYMENT .match (msg .address_n ) or SCHEMA_MINT . match ( msg . address_n ) ),
41+ SCHEMA_PAYMENT .match (msg .address_n ),
4242 )
43- if msg .network_id != network_ids .MAINNET :
44- raise wire .ProcessError ("Invalid Networ ID " )
43+ if msg .protocol_magic is None and ( msg . network_id != network_ids .MAINNET ) :
44+ raise wire .ProcessError ("Invalid Network id, need protocol magic provide " )
4545
4646 address_type = msg .address_type if msg .address_type else CardanoAddressType .BASE
4747 address_n = msg .address_n
@@ -70,7 +70,7 @@ async def sign_message(
7070 script_payment_hash = None ,
7171 script_staking_hash = None ,
7272 ),
73- protocol_magics .MAINNET ,
73+ protocol_magics .MAINNET if msg . protocol_magic is None else msg . protocol_magic ,
7474 msg .network_id ,
7575 )
7676 address = addresses .encode_human_readable (address_bytes )
0 commit comments