mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
chore(core): Disable Taproot for altcoins.
This commit is contained in:
parent
c0f853dc78
commit
7653efb415
@ -1,4 +1,5 @@
|
|||||||
from trezor import wire
|
from trezor import wire
|
||||||
|
from trezor.enums import InputScriptType
|
||||||
from trezor.messages import GetOwnershipId, OwnershipId
|
from trezor.messages import GetOwnershipId, OwnershipId
|
||||||
|
|
||||||
from apps.common.paths import validate_path
|
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:
|
if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit:
|
||||||
raise wire.DataError("Segwit not enabled on this coin")
|
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)
|
node = keychain.derive(msg.address_n)
|
||||||
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
|
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
|
||||||
script_pubkey = scripts.output_derive_script(address, coin)
|
script_pubkey = scripts.output_derive_script(address, coin)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from trezor import ui, wire
|
from trezor import ui, wire
|
||||||
|
from trezor.enums import InputScriptType
|
||||||
from trezor.messages import GetOwnershipProof, OwnershipProof
|
from trezor.messages import GetOwnershipProof, OwnershipProof
|
||||||
from trezor.ui.layouts import confirm_action, confirm_blob
|
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:
|
if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit:
|
||||||
raise wire.DataError("Segwit not enabled on this coin")
|
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)
|
node = keychain.derive(msg.address_n)
|
||||||
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
|
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
|
||||||
script_pubkey = scripts.output_derive_script(address, coin)
|
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:
|
if not coin.segwit:
|
||||||
raise wire.DataError("Segwit not enabled on this coin.")
|
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:
|
if txi.commitment_data and not txi.ownership_proof:
|
||||||
raise wire.DataError("commitment_data field provided but not expected.")
|
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:
|
if not coin.segwit:
|
||||||
raise wire.DataError("Segwit not enabled on this coin.")
|
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:
|
if txo.script_type == OutputScriptType.PAYTOOPRETURN:
|
||||||
# op_return output
|
# op_return output
|
||||||
if txo.op_return_data is None:
|
if txo.op_return_data is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user