chore(core): Disable Taproot for altcoins.

pull/1918/head
Andrew Kozlik 3 years ago committed by Andrew Kozlik
parent c0f853dc78
commit 7653efb415

@ -1,4 +1,5 @@
from trezor import wire
from trezor.enums import InputScriptType
from trezor.messages import GetOwnershipId, OwnershipId
from apps.common.paths import validate_path
@ -29,6 +30,9 @@ async def get_ownership_id(
if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit:
raise wire.DataError("Segwit not enabled on this coin")
if msg.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot:
raise wire.DataError("Taproot not enabled on this coin")
node = keychain.derive(msg.address_n)
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
script_pubkey = scripts.output_derive_script(address, coin)

@ -1,4 +1,5 @@
from trezor import ui, wire
from trezor.enums import InputScriptType
from trezor.messages import GetOwnershipProof, OwnershipProof
from trezor.ui.layouts import confirm_action, confirm_blob
@ -42,6 +43,9 @@ async def get_ownership_proof(
if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit:
raise wire.DataError("Segwit not enabled on this coin")
if msg.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot:
raise wire.DataError("Taproot not enabled on this coin")
node = keychain.derive(msg.address_n)
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
script_pubkey = scripts.output_derive_script(address, coin)

@ -412,6 +412,9 @@ def sanitize_tx_input(txi: TxInput, coin: CoinInfo) -> TxInput:
if not coin.segwit:
raise wire.DataError("Segwit not enabled on this coin.")
if txi.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot:
raise wire.DataError("Taproot not enabled on this coin")
if txi.commitment_data and not txi.ownership_proof:
raise wire.DataError("commitment_data field provided but not expected.")
@ -448,6 +451,9 @@ def sanitize_tx_output(txo: TxOutput, coin: CoinInfo) -> TxOutput:
if not coin.segwit:
raise wire.DataError("Segwit not enabled on this coin.")
if txo.script_type == OutputScriptType.PAYTOTAPROOT and not coin.taproot:
raise wire.DataError("Taproot not enabled on this coin")
if txo.script_type == OutputScriptType.PAYTOOPRETURN:
# op_return output
if txo.op_return_data is None:

Loading…
Cancel
Save