define constants for tx output types
This commit is contained in:
@@ -5,7 +5,7 @@ from sys import stderr
|
||||
from time import sleep
|
||||
|
||||
import electrum
|
||||
from electrum.bitcoin import EncodeBase58Check, DecodeBase58Check, public_key_to_bc_address, bc_address_to_hash_160
|
||||
from electrum.bitcoin import EncodeBase58Check, DecodeBase58Check, public_key_to_bc_address, bc_address_to_hash_160, TYPE_ADDRESS
|
||||
from electrum.i18n import _
|
||||
from electrum.plugins import BasePlugin, hook
|
||||
from electrum.transaction import deserialize
|
||||
@@ -203,7 +203,7 @@ class BTChipWallet(BIP44_Wallet):
|
||||
if len(tx.outputs) > 2: # should never happen
|
||||
self.give_error("Transaction with more than 2 outputs not supported")
|
||||
for type, address, amount in tx.outputs:
|
||||
assert type == 'address'
|
||||
assert type == TYPE_ADDRESS
|
||||
if self.is_change(address):
|
||||
changePath = self.address_id(address)
|
||||
changeAmount = amount
|
||||
|
||||
@@ -7,7 +7,8 @@ from struct import pack
|
||||
|
||||
from electrum.account import BIP32_Account
|
||||
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
|
||||
public_key_to_bc_address, EncodeBase58Check)
|
||||
public_key_to_bc_address, EncodeBase58Check,
|
||||
TYPE_ADDRESS)
|
||||
from electrum.i18n import _
|
||||
from electrum.plugins import BasePlugin, hook
|
||||
from electrum.transaction import (deserialize, is_extended_pubkey,
|
||||
@@ -427,7 +428,7 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob):
|
||||
outputs = []
|
||||
|
||||
for type, address, amount in tx.outputs:
|
||||
assert type == 'address'
|
||||
assert type == TYPE_ADDRESS
|
||||
txoutputtype = self.types.TxOutputType()
|
||||
if wallet.is_change(address):
|
||||
address_path = wallet.address_id(address)
|
||||
|
||||
@@ -234,7 +234,7 @@ class Wallet_2fa(Multisig_Wallet):
|
||||
fee = self.extra_fee()
|
||||
if fee:
|
||||
address = self.billing_info['billing_address']
|
||||
outputs = outputs + [('address', address, fee)]
|
||||
outputs = outputs + [(TYPE_ADDRESS, address, fee)]
|
||||
try:
|
||||
return BIP32_Wallet.make_unsigned_transaction(
|
||||
self, coins, outputs, config, fixed_fee, change_addr)
|
||||
|
||||
Reference in New Issue
Block a user