wallet: fix wallet.make_unsigned_transaction method signature
- "fee_policy" arg is actually mandatory
- and fix test/stdio guis following fee_policy/config split
follow-up 840243e029
This commit is contained in:
@@ -13,6 +13,7 @@ from electrum.util import format_satoshis, EventListener, event_listener
|
|||||||
from electrum.bitcoin import is_address, COIN
|
from electrum.bitcoin import is_address, COIN
|
||||||
from electrum.transaction import PartialTxOutput
|
from electrum.transaction import PartialTxOutput
|
||||||
from electrum.network import TxBroadcastError, BestEffortRequestFailed
|
from electrum.network import TxBroadcastError, BestEffortRequestFailed
|
||||||
|
from electrum.fee_policy import FixedFeePolicy
|
||||||
|
|
||||||
_ = lambda x:x # i18n
|
_ = lambda x:x # i18n
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
|||||||
password = getpass.getpass('Password:', stream=None)
|
password = getpass.getpass('Password:', stream=None)
|
||||||
storage.decrypt(password)
|
storage.decrypt(password)
|
||||||
|
|
||||||
db = WalletDB(storage.read(), storage=storage, manual_upgrades=False)
|
db = WalletDB(storage.read(), storage=storage, upgrade=True)
|
||||||
|
|
||||||
self.done = 0
|
self.done = 0
|
||||||
self.last_balance = ""
|
self.last_balance = ""
|
||||||
@@ -214,7 +215,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
|||||||
tx = self.wallet.create_transaction(
|
tx = self.wallet.create_transaction(
|
||||||
outputs=[PartialTxOutput.from_address_and_value(self.str_recipient, amount)],
|
outputs=[PartialTxOutput.from_address_and_value(self.str_recipient, amount)],
|
||||||
password=password,
|
password=password,
|
||||||
fee=fee,
|
fee_policy=FixedFeePolicy(fee),
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(repr(e))
|
print(repr(e))
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ from electrum.storage import WalletStorage
|
|||||||
from electrum.network import NetworkParameters, TxBroadcastError, BestEffortRequestFailed, ProxySettings
|
from electrum.network import NetworkParameters, TxBroadcastError, BestEffortRequestFailed, ProxySettings
|
||||||
from electrum.interface import ServerAddr
|
from electrum.interface import ServerAddr
|
||||||
from electrum.invoices import Invoice
|
from electrum.invoices import Invoice
|
||||||
|
from electrum.fee_policy import FeePolicy
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from electrum.daemon import Daemon
|
from electrum.daemon import Daemon
|
||||||
@@ -688,11 +689,12 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
password = None
|
password = None
|
||||||
|
fee_policy = FeePolicy(self.config.FEE_POLICY)
|
||||||
try:
|
try:
|
||||||
tx = self.wallet.create_transaction(
|
tx = self.wallet.create_transaction(
|
||||||
outputs=invoice.outputs,
|
outputs=invoice.outputs,
|
||||||
password=password,
|
password=password,
|
||||||
fee=None,
|
fee_policy=fee_policy,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.show_message(repr(e))
|
self.show_message(repr(e))
|
||||||
|
|||||||
@@ -1821,12 +1821,12 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
coins: Sequence[PartialTxInput],
|
coins: Sequence[PartialTxInput],
|
||||||
outputs: List[PartialTxOutput],
|
outputs: List[PartialTxOutput],
|
||||||
inputs: Optional[List[PartialTxInput]] = None,
|
inputs: Optional[List[PartialTxInput]] = None,
|
||||||
fee_policy: FeePolicy = None,
|
fee_policy: FeePolicy,
|
||||||
change_addr: str = None,
|
change_addr: str = None,
|
||||||
is_sweep: bool = False, # used by Wallet_2fa subclass
|
is_sweep: bool = False, # used by Wallet_2fa subclass
|
||||||
rbf: bool = True,
|
rbf: bool = True,
|
||||||
BIP69_sort: Optional[bool] = True,
|
BIP69_sort: Optional[bool] = True,
|
||||||
base_tx: Optional[PartialTransaction] = None,
|
base_tx: Optional[Transaction] = None,
|
||||||
send_change_to_lightning: bool = False,
|
send_change_to_lightning: bool = False,
|
||||||
merge_duplicate_outputs: bool = False,
|
merge_duplicate_outputs: bool = False,
|
||||||
) -> PartialTransaction:
|
) -> PartialTransaction:
|
||||||
@@ -3069,7 +3069,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
self,
|
self,
|
||||||
outputs,
|
outputs,
|
||||||
*,
|
*,
|
||||||
fee_policy: FeePolicy=None,
|
fee_policy: FeePolicy,
|
||||||
change_addr=None,
|
change_addr=None,
|
||||||
domain_addr=None,
|
domain_addr=None,
|
||||||
domain_coins=None,
|
domain_coins=None,
|
||||||
|
|||||||
Reference in New Issue
Block a user