1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00
This commit is contained in:
Pavol Rusnak 2017-12-27 01:44:26 +01:00
parent 956d5e7149
commit 6b31ac9753
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 8 additions and 12 deletions

View File

@ -17,19 +17,17 @@
from .common import *
from trezorlib import messages as proto
from trezorlib.tx_api import TxApiInsight
from trezorlib.tx_api import TxApiBcash
from trezorlib.ckd_public import deserialize
from trezorlib.client import CallException
TxApiBitcoinCash = TxApiInsight(network='insight_bch', url='https://bch-bitcore2.trezor.io/api/')
@pytest.mark.skip_t2
class TestMsgSigntxBch(TrezorTest):
def test_send_bch_change(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
inp1 = proto.TxInputType(
address_n=self.client.expand_path("44'/145'/0'/0/0"),
# 1MH9KKcvdCTY44xVDC2k3fjBbX5Cz29N1q
@ -66,7 +64,7 @@ class TestMsgSigntxBch(TrezorTest):
def test_send_bch_nochange(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
inp1 = proto.TxInputType(
address_n=self.client.expand_path("44'/145'/0'/1/0"),
# 1HADRPJpgqBzThepERpVXNi6qRgiLQRNoE
@ -106,7 +104,7 @@ class TestMsgSigntxBch(TrezorTest):
def test_attack_amount(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
inp1 = proto.TxInputType(
address_n=self.client.expand_path("44'/145'/0'/1/0"),
# 1HADRPJpgqBzThepERpVXNi6qRgiLQRNoE
@ -167,7 +165,7 @@ class TestMsgSigntxBch(TrezorTest):
def test_attack_change_input(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
inp1 = proto.TxInputType(
address_n=self.client.expand_path("44'/145'/1000'/0/0"),
# 1MH9KKcvdCTY44xVDC2k3fjBbX5Cz29N1q
@ -222,7 +220,7 @@ class TestMsgSigntxBch(TrezorTest):
def test_send_bch_multisig_wrongchange(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
xpubs = []
for n in map(lambda index: self.client.get_public_node(self.client.expand_path("44'/145'/" + str(index) + "'")), range(1, 4)):
xpubs.append(n.xpub)
@ -275,7 +273,7 @@ class TestMsgSigntxBch(TrezorTest):
def test_send_bch_multisig_change(self):
self.setup_mnemonic_allallall()
self.client.set_tx_api(TxApiBitcoinCash)
self.client.set_tx_api(TxApiBcash)
xpubs = []
for n in map(lambda index: self.client.get_public_node(self.client.expand_path("44'/145'/" + str(index) + "'")), range(1, 4)):
xpubs.append(n.xpub)

View File

@ -183,9 +183,7 @@ TxApiTestnet = TxApiInsight(network='insight_testnet', url='https://testnet-bitc
TxApiLitecoin = TxApiInsight(network='insight_litecoin', url='https://ltc-bitcore1.trezor.io/api/')
TxApiDash = TxApiInsight(network='insight_dash', url='https://dash-bitcore1.trezor.io/api/')
TxApiZcash = TxApiInsight(network='insight_zcash', url='https://zec-bitcore1.trezor.io/api/', zcash=True)
TxApiBcash = TxApiInsight(network='insight_zcash', url='https://bch-bitcore2.trezor.io/api/')
TxApiBcash = TxApiInsight(network='insight_bcash', url='https://bch-bitcore2.trezor.io/api/')
TxApiDecredTestnet = TxApiInsight(network='insight_decred_testnet', url='https://testnet.decred.org/api/')
TxApiDogecoin = TxApiBlockCypher(network='blockcypher_dogecoin', url='http://api.blockcypher.com/v1/doge/main/')
TxApiSegnet = TxApiSmartbit(network='smartbit_segnet', url='https://segnet-api.smartbit.com.au/v1/blockchain/')