1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

Add sign_tx support for Dogecoin

This commit is contained in:
Anton Kolesnyk 2017-12-25 15:15:15 -08:00 committed by Pavol Rusnak
parent 4962207703
commit 956d5e7149
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from .tx_api import TxApiBitcoin, TxApiTestnet, TxApiLitecoin, TxApiZcash, TxApiDash, TxApiBcash, TxApiDecredTestnet
from .tx_api import TxApiBitcoin, TxApiTestnet, TxApiLitecoin, TxApiZcash, TxApiDash, TxApiBcash, TxApiDecredTestnet, TxApiDogecoin
coins_slip44 = {
'Bitcoin': 0,
@ -23,4 +23,5 @@ coins_txapi = {
'Zcash': TxApiZcash,
'Bcash': TxApiBcash,
'Decred Testnet': TxApiDecredTestnet,
'Dogecoin': TxApiDogecoin,
}

View File

@ -158,7 +158,7 @@ class TxApiBlockCypher(TxApi):
t.lock_time = data['lock_time']
for vin in data['inputs']:
i = t.inputs.add()
i = t._add_inputs()
if 'prev_hash' not in vin:
i.prev_hash = b"\0" * 32
i.prev_index = 0xffffffff # signed int -1
@ -171,7 +171,7 @@ class TxApiBlockCypher(TxApi):
i.sequence = vin['sequence']
for vout in data['outputs']:
o = t.bin_outputs.add()
o = t._add_bin_outputs()
o.amount = int(str(vout['value']), 10)
o.script_pubkey = binascii.unhexlify(vout['script'])
@ -186,4 +186,6 @@ TxApiZcash = TxApiInsight(network='insight_zcash', url='https://zec-bitcore1.tre
TxApiBcash = TxApiInsight(network='insight_zcash', 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/')