mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-13 17:00:59 +00:00
all: drop Capricoin support [NO BACKPORT]
This commit is contained in:
parent
adea7d6b35
commit
ffdb299c61
@ -1,51 +0,0 @@
|
||||
{
|
||||
"coin_name": "Capricoin",
|
||||
"coin_shortcut": "CPC",
|
||||
"coin_label": "Capricoin",
|
||||
"website": "https://capricoin.org",
|
||||
"github": "https://github.com/Capricoinofficial/Capricoin",
|
||||
"maintainer": "Jozef Knaperek <jknaperek@gmail.com>",
|
||||
"curve_name": "secp256k1",
|
||||
"decimals": 8,
|
||||
"address_type": 28,
|
||||
"address_type_p2sh": 35,
|
||||
"maxfee_kb": 2000000,
|
||||
"minfee_kb": 1000,
|
||||
"signed_message_header": "Capricoin Signed Message:\n",
|
||||
"hash_genesis_block": "00000d23fa0fc52c90893adb1181c9ddffb6c797a3e41864b9a23aa2f2981fe3",
|
||||
"xprv_magic": 76066276,
|
||||
"xpub_magic": 76067358,
|
||||
"xpub_magic_segwit_p2sh": null,
|
||||
"xpub_magic_segwit_native": null,
|
||||
"bech32_prefix": null,
|
||||
"cashaddr_prefix": null,
|
||||
"slip44": 289,
|
||||
"segwit": false,
|
||||
"decred": false,
|
||||
"fork_id": null,
|
||||
"force_bip143": false,
|
||||
"default_fee_b": {
|
||||
"Low": 1,
|
||||
"Economy": 7,
|
||||
"Normal": 14,
|
||||
"High": 20
|
||||
},
|
||||
"dust_limit": 546,
|
||||
"blocktime_seconds": 60,
|
||||
"uri_prefix": "capricoin",
|
||||
"min_address_length": 27,
|
||||
"max_address_length": 34,
|
||||
"bitcore": [],
|
||||
"blockbook": [
|
||||
"https://blockbook.capricoin.org",
|
||||
"https://blockbook2.capricoin.org",
|
||||
"https://blockbook3.capricoin.org",
|
||||
"https://blockbook4.capricoin.org"
|
||||
],
|
||||
"negative_fee": false,
|
||||
"cooldown": 100,
|
||||
"consensus_branch_id": null,
|
||||
"extra_data": false,
|
||||
"timestamp": true,
|
||||
"confidential_assets": null
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,6 @@
|
||||
"bitcoin:BTCP": true,
|
||||
"bitcoin:BTG": true,
|
||||
"bitcoin:BTX": true,
|
||||
"bitcoin:CPC": true,
|
||||
"bitcoin:DASH": true,
|
||||
"bitcoin:DGB": true,
|
||||
"bitcoin:DOGE": true,
|
||||
@ -1691,7 +1690,6 @@
|
||||
"nem:XEM": "1.6.2"
|
||||
},
|
||||
"unsupported": {
|
||||
"bitcoin:CPC": "not implemented",
|
||||
"bitcoin:TRC": "address_type collides with Bitcoin",
|
||||
"bitcoin:ZEN": "not implemented",
|
||||
"erc20:etc:PLAY": "(AUTO) duplicate key",
|
||||
@ -1735,7 +1733,6 @@
|
||||
"erc20:eth:COIN:eb54": "(AUTO) duplicate key",
|
||||
"erc20:eth:COSS:6529": "(AUTO) duplicate key",
|
||||
"erc20:eth:COSS:9e96": "(AUTO) duplicate key",
|
||||
"erc20:eth:CPC": "duplicate key with bitcoin:CPC",
|
||||
"erc20:eth:CPT:88d5": "(AUTO) duplicate key",
|
||||
"erc20:eth:CPT:9b62": "(AUTO) duplicate key",
|
||||
"erc20:eth:CTT:1a47": "(AUTO) duplicate key",
|
||||
@ -1924,7 +1921,6 @@
|
||||
"bitcoin:BTCP": "2.0.7",
|
||||
"bitcoin:BTG": "2.0.7",
|
||||
"bitcoin:BTX": "2.0.8",
|
||||
"bitcoin:CPC": "2.0.10",
|
||||
"bitcoin:CPU": "2.1.4",
|
||||
"bitcoin:CRW": "2.1.7",
|
||||
"bitcoin:DASH": "2.0.5",
|
||||
@ -3564,7 +3560,6 @@
|
||||
"erc20:eth:COIN:eb54": "(AUTO) duplicate key",
|
||||
"erc20:eth:COSS:6529": "(AUTO) duplicate key",
|
||||
"erc20:eth:COSS:9e96": "(AUTO) duplicate key",
|
||||
"erc20:eth:CPC": "duplicate key with bitcoin:CPC",
|
||||
"erc20:eth:CPT:88d5": "(AUTO) duplicate key",
|
||||
"erc20:eth:CPT:9b62": "(AUTO) duplicate key",
|
||||
"erc20:eth:CTT:1a47": "(AUTO) duplicate key",
|
||||
|
@ -28,9 +28,6 @@
|
||||
"Electrum-BTX": "https://github.com/LIMXTEC/electrum-btx",
|
||||
"Magnum": "https://magnumwallet.co"
|
||||
},
|
||||
"bitcoin:CPC": {
|
||||
"Capricoin Mobile Wallet": "https://wallet.capricoin.org"
|
||||
},
|
||||
"bitcoin:CPU": {
|
||||
"Electrum-CPU": "https://cpuchain.org/download-page.html"
|
||||
},
|
||||
|
@ -132,7 +132,7 @@ message SignTx {
|
||||
optional uint32 expiry = 6; // only for Decred and Zcash
|
||||
// optional bool overwintered = 7; // deprecated - only for Zcash
|
||||
optional uint32 version_group_id = 8; // only for Zcash, nVersionGroupId
|
||||
optional uint32 timestamp = 9; // only for Peercoin, Capricoin
|
||||
optional uint32 timestamp = 9; // only for Peercoin
|
||||
optional uint32 branch_id = 10; // only for Zcash, BRANCH_ID
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ message TxAck {
|
||||
optional uint32 expiry = 10; // only for Decred and Zcash
|
||||
// optional bool overwintered = 11; // deprecated - only for Zcash
|
||||
optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId
|
||||
optional uint32 timestamp = 13; // only for Peercoin, Capricoin
|
||||
optional uint32 timestamp = 13; // only for Peercoin
|
||||
optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID
|
||||
/**
|
||||
* Structure representing transaction input
|
||||
|
@ -477,32 +477,6 @@ def by_name(name: str) -> CoinInfo:
|
||||
overwintered=False,
|
||||
confidential_assets=None,
|
||||
)
|
||||
elif name == "Capricoin":
|
||||
return CoinInfo(
|
||||
coin_name=name,
|
||||
coin_shortcut="CPC",
|
||||
decimals=8,
|
||||
address_type=28,
|
||||
address_type_p2sh=35,
|
||||
maxfee_kb=2000000,
|
||||
signed_message_header="Capricoin Signed Message:\n",
|
||||
xpub_magic=0x0488b21e,
|
||||
xpub_magic_segwit_p2sh=None,
|
||||
xpub_magic_segwit_native=None,
|
||||
bech32_prefix=None,
|
||||
cashaddr_prefix=None,
|
||||
slip44=289,
|
||||
segwit=False,
|
||||
fork_id=None,
|
||||
force_bip143=False,
|
||||
decred=False,
|
||||
negative_fee=False,
|
||||
curve_name='secp256k1',
|
||||
extra_data=False,
|
||||
timestamp=True,
|
||||
overwintered=False,
|
||||
confidential_assets=None,
|
||||
)
|
||||
elif name == "Crown":
|
||||
return CoinInfo(
|
||||
coin_name=name,
|
||||
|
@ -542,6 +542,8 @@ def token_by_chain_address(chain_id, address):
|
||||
return (chain_id, address, "CPAL", 8) # eth / CreatorPAL
|
||||
elif address == b"\x0e\xbb\x61\x42\x04\xe4\x7c\x09\xb6\xc3\xfe\xb9\xaa\xec\xad\x8e\xe0\x60\xe2\x3e":
|
||||
return (chain_id, address, "CPAY", 0) # eth / Cryptopay
|
||||
elif address == b"\xfa\xe4\xee\x59\xcd\xd8\x6e\x3b\xe9\xe8\xb9\x0b\x53\xaa\x86\x63\x27\xd7\xc0\x90":
|
||||
return (chain_id, address, "CPC", 18) # eth / CPChain
|
||||
elif address == b"\xb7\x87\xd4\xea\xc8\x89\x97\x30\xbb\x8c\x57\xfc\x3c\x99\x8c\x49\xc5\x24\x4e\xc0":
|
||||
return (chain_id, address, "CPEX", 8) # eth / CoinPulseToken
|
||||
elif address == b"\x70\x64\xaa\xb3\x9a\x0f\xcf\x72\x21\xc3\x39\x67\x19\xd0\x91\x7a\x65\xe3\x55\x15":
|
||||
|
@ -126,7 +126,7 @@ message SignTx {
|
||||
optional uint32 expiry = 6; // only for Decred and Zcash
|
||||
optional bool overwintered = 7; // only for Zcash
|
||||
optional uint32 version_group_id = 8; // only for Zcash, nVersionGroupId when overwintered is set
|
||||
optional uint32 timestamp = 9; // only for Capricoin, transaction timestamp
|
||||
optional uint32 timestamp = 9; // only for Peercoin, transaction timestamp
|
||||
optional uint32 branch_id = 10; // only for Zcash, BRANCH_ID when overwintered is set
|
||||
}
|
||||
```
|
||||
@ -160,7 +160,7 @@ message TransactionType {
|
||||
optional uint32 expiry = 10; // only for Decred and Zcash
|
||||
optional bool overwintered = 11; // only for Zcash
|
||||
optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId when overwintered is set
|
||||
optional uint32 timestamp = 13; // only for Capricoin, transaction timestamp
|
||||
optional uint32 timestamp = 13; // only for Peercoin, transaction timestamp
|
||||
optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID when overwintered is set
|
||||
}
|
||||
```
|
||||
|
File diff suppressed because one or more lines are too long
@ -30,10 +30,6 @@ def is_zcash(coin):
|
||||
return lcn.startswith("zcash") or lcn.startswith("komodo")
|
||||
|
||||
|
||||
def is_capricoin(coin):
|
||||
return coin["coin_name"].lower().startswith("capricoin")
|
||||
|
||||
|
||||
def is_peercoin(coin):
|
||||
return coin["coin_name"].lower().startswith("peercoin")
|
||||
|
||||
@ -90,7 +86,7 @@ def json_to_tx(coin, data):
|
||||
t.version = data["version"]
|
||||
t.lock_time = data.get("locktime")
|
||||
|
||||
if is_capricoin(coin) or is_peercoin(coin):
|
||||
if is_peercoin(coin):
|
||||
t.timestamp = data["time"]
|
||||
|
||||
if coin["decred"]:
|
||||
|
@ -172,7 +172,7 @@ def sign_interactive():
|
||||
signtx = messages.SignTx()
|
||||
signtx.version = prompt("Transaction version", type=int, default=2)
|
||||
signtx.lock_time = prompt("Transaction locktime", type=int, default=0)
|
||||
if coin == "Capricoin":
|
||||
if coin == "Peercoin":
|
||||
signtx.timestamp = prompt("Transaction timestamp", type=int)
|
||||
|
||||
result = {
|
||||
|
@ -1,7 +1,6 @@
|
||||
altcoin
|
||||
slow
|
||||
binance
|
||||
capricoin
|
||||
cardano
|
||||
decred
|
||||
eos
|
||||
|
@ -1,149 +0,0 @@
|
||||
# This file is part of the Trezor project.
|
||||
#
|
||||
# Copyright (C) 2012-2019 SatoshiLabs and contributors
|
||||
#
|
||||
# This library is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License version 3
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the License along with this library.
|
||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||
|
||||
import pytest
|
||||
|
||||
from trezorlib import btc, messages
|
||||
from trezorlib.exceptions import TrezorFailure
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
from ..tx_cache import tx_cache
|
||||
|
||||
TXHASH_3bf506 = bytes.fromhex(
|
||||
"3bf506c81ce84eda891679ddc797d162c17c60b15d6c0ac23be5e31369e7235f"
|
||||
)
|
||||
|
||||
TXHASH_f3a6e6 = bytes.fromhex(
|
||||
"f3a6e6411f1b2dffd76d2729bae8e056f8f9ecf8996d3f428e75a6f23f2c5e8c"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.altcoin
|
||||
@pytest.mark.capricoin
|
||||
@pytest.mark.skip_t1 # T1 support is not planned
|
||||
def test_timestamp_included(client):
|
||||
# tx: 3bf506c81ce84eda891679ddc797d162c17c60b15d6c0ac23be5e31369e7235f
|
||||
# input 0: 0.01 CPC
|
||||
# tx: f3a6e6411f1b2dffd76d2729bae8e056f8f9ecf8996d3f428e75a6f23f2c5e8c
|
||||
# input 0: 0.02 CPC
|
||||
|
||||
inp1 = messages.TxInputType(
|
||||
address_n=parse_path("m/44'/289'/0'/0/0"), prev_hash=TXHASH_3bf506, prev_index=0
|
||||
)
|
||||
|
||||
inp2 = messages.TxInputType(
|
||||
address_n=parse_path("m/44'/289'/0'/0/0"), prev_hash=TXHASH_f3a6e6, prev_index=1
|
||||
)
|
||||
|
||||
out1 = messages.TxOutputType(
|
||||
address="CUGi8RGPWxbHM6FxF4eMEfqmQ6Bs5VjCdr",
|
||||
amount=3000000 - 20000,
|
||||
script_type=messages.OutputScriptType.PAYTOADDRESS,
|
||||
)
|
||||
|
||||
details = messages.SignTx(version=1, timestamp=0x5BCF5C66)
|
||||
_, timestamp_tx = btc.sign_tx(
|
||||
client,
|
||||
"Capricoin",
|
||||
[inp1, inp2],
|
||||
[out1],
|
||||
details=details,
|
||||
prev_txes=tx_cache("Capricoin"),
|
||||
)
|
||||
|
||||
# Accepted by network https://insight.capricoin.org/tx/1bf227e6e24fe1f8ac98849fe06a2c5b77762e906fcf7e82787675f7f3a10bb8
|
||||
accepted_txhex = "01000000665ccf5b025f23e76913e3e53bc20a6c5db1607cc162d197c7dd791689da4ee81cc806f53b000000006b483045022100fce7ccbeb9524f36d118ebcfebcb133a05c236c4478e2051cfd5c9632920aee602206921b7be1a81f30cce3d8e7dba4597fc16a2761c42321c49d65eeacdfe3781250121021fcf98aee04939ec7df5762f426dc2d1db8026e3a73c3bbe44749dacfbb61230ffffffff8c5e2c3ff2a6758e423f6d99f8ecf9f856e0e8ba29276dd7ff2d1b1f41e6a6f3010000006a473044022015d967166fe9f89fbed8747328b1c4658aa1d7163e731c5fd5908feafe08e9a6022028af30801098418bd298cc60b143c52c48466f5791256721304b6eba4fdf0b3c0121021fcf98aee04939ec7df5762f426dc2d1db8026e3a73c3bbe44749dacfbb61230ffffffff01a0782d00000000001976a914818437acfd15780debd31f3fd21d4ca678bb36d188ac00000000"
|
||||
assert timestamp_tx.hex() == accepted_txhex
|
||||
|
||||
|
||||
@pytest.mark.altcoin
|
||||
@pytest.mark.capricoin
|
||||
@pytest.mark.skip_ui
|
||||
@pytest.mark.skip_t1 # T1 support is not planned
|
||||
def test_timestamp_missing(client):
|
||||
inp1 = messages.TxInputType(
|
||||
address_n=parse_path("m/44'/289'/0'/0/0"), prev_hash=TXHASH_3bf506, prev_index=0
|
||||
)
|
||||
out1 = messages.TxOutputType(
|
||||
address="CUGi8RGPWxbHM6FxF4eMEfqmQ6Bs5VjCdr",
|
||||
amount=3000000 - 20000,
|
||||
script_type=messages.OutputScriptType.PAYTOADDRESS,
|
||||
)
|
||||
details = messages.SignTx(version=1, timestamp=None)
|
||||
with pytest.raises(TrezorFailure) as e:
|
||||
btc.sign_tx(
|
||||
client,
|
||||
"Capricoin",
|
||||
[inp1],
|
||||
[out1],
|
||||
details=details,
|
||||
prev_txes=tx_cache("Capricoin"),
|
||||
)
|
||||
assert e.value.failure.message.endswith("Timestamp must be set.")
|
||||
|
||||
details = messages.SignTx(version=1, timestamp=0)
|
||||
with pytest.raises(TrezorFailure) as e:
|
||||
btc.sign_tx(
|
||||
client,
|
||||
"Capricoin",
|
||||
[inp1],
|
||||
[out1],
|
||||
details=details,
|
||||
prev_txes=tx_cache("Capricoin"),
|
||||
)
|
||||
assert e.value.failure.message.endswith("Timestamp must be set.")
|
||||
|
||||
|
||||
@pytest.mark.altcoin
|
||||
@pytest.mark.capricoin
|
||||
@pytest.mark.skip_ui
|
||||
@pytest.mark.skip_t1 # T1 support is not planned
|
||||
def test_timestamp_missing_prevtx(client):
|
||||
inp1 = messages.TxInputType(
|
||||
address_n=parse_path("m/44'/289'/0'/0/0"), prev_hash=TXHASH_3bf506, prev_index=0
|
||||
)
|
||||
out1 = messages.TxOutputType(
|
||||
address="CUGi8RGPWxbHM6FxF4eMEfqmQ6Bs5VjCdr",
|
||||
amount=3000000 - 20000,
|
||||
script_type=messages.OutputScriptType.PAYTOADDRESS,
|
||||
)
|
||||
details = messages.SignTx(version=1, timestamp=0x5BCF5C66)
|
||||
|
||||
prevtx = tx_cache("Capricoin")[TXHASH_3bf506]
|
||||
prevtx.timestamp = 0
|
||||
|
||||
with pytest.raises(TrezorFailure) as e:
|
||||
btc.sign_tx(
|
||||
client,
|
||||
"Capricoin",
|
||||
[inp1],
|
||||
[out1],
|
||||
details=details,
|
||||
prev_txes={TXHASH_3bf506: prevtx},
|
||||
)
|
||||
assert e.value.failure.message.endswith("Timestamp must be set.")
|
||||
|
||||
prevtx.timestamp = None
|
||||
with pytest.raises(TrezorFailure) as e:
|
||||
btc.sign_tx(
|
||||
client,
|
||||
"Capricoin",
|
||||
[inp1],
|
||||
[out1],
|
||||
details=details,
|
||||
prev_txes={TXHASH_3bf506: prevtx},
|
||||
)
|
||||
assert e.value.failure.message.endswith("Timestamp must be set.")
|
@ -284,7 +284,6 @@
|
||||
"test_msg_signtx_bgold.py-test_send_multisig_1": "d049b3b25042c732ce26a253e7de49581adc83003713860924b8d951cb46de0c",
|
||||
"test_msg_signtx_bgold.py-test_send_p2sh": "ddd48151ce1d74ade0b9858cbcdba316581991ec92c2ef54b5893e3aae75f995",
|
||||
"test_msg_signtx_bgold.py-test_send_p2sh_witness_change": "02e44d4c1072eb774486210f885b1bee53acfb3b7fd787207b9f955853fef055",
|
||||
"test_msg_signtx_capricoin.py::test_timestamp_included": "15052cadcea92d3405ba0f603c1a5c54bc4fe60eb0b89c79b062620023c3444b",
|
||||
"test_msg_signtx_dash.py-test_send_dash": "291f1a3ace22877641494a1a470a1a4a8dab6e363fc4402dadaeb52c1288c72b",
|
||||
"test_msg_signtx_dash.py-test_send_dash_dip2_input": "cf7fc7e6fe3a9e4063e743da6fc44c27dac013917bc00cfc63d13a183c091d91",
|
||||
"test_msg_signtx_decred.py-test_decred_multisig_change": "9a7e9e1adcb0ba6770e3965df8324f2b7bc46d6bcd866db9289e8e1d62ef486e",
|
||||
|
Loading…
Reference in New Issue
Block a user