From 4ff675247530b2d376ca7aefc2ae527f64fcebd0 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 13 Jun 2025 10:23:55 +0000 Subject: [PATCH] CoinProtocol.Base: new `has_usr_fee` attribute --- mmgen/help/help_notes.py | 11 +++++++++-- mmgen/proto/rune/params.py | 1 + mmgen/protocol.py | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mmgen/help/help_notes.py b/mmgen/help/help_notes.py index c2da1489..889204f4 100755 --- a/mmgen/help/help_notes.py +++ b/mmgen/help/help_notes.py @@ -119,8 +119,11 @@ FMT CODES: return fmt_list(self.cfg._autoset_opts['tx_proxy'].choices, fmt='fancy') def rel_fee_desc(self): - from ..tx import BaseTX - return BaseTX(cfg=self.cfg, proto=self.proto).rel_fee_desc + if self.proto.has_usr_fee: + from ..tx import BaseTX + return BaseTX(cfg=self.cfg, proto=self.proto).rel_fee_desc + else: + return '' def gas_limit(self, target): return """ @@ -138,6 +141,10 @@ of a standard transaction). The default is ‘auto’. """ if target == 'swaptx' or self.proto.base_coin == 'ETH' else '' def fee(self, all_coins=False): + + if not self.proto.has_usr_fee: + return '' + from ..tx import BaseTX text = """ FEE SPECIFICATION diff --git a/mmgen/proto/rune/params.py b/mmgen/proto/rune/params.py index 88447ed4..b368ab7c 100755 --- a/mmgen/proto/rune/params.py +++ b/mmgen/proto/rune/params.py @@ -37,6 +37,7 @@ class mainnet(CoinProtocol.Secp256k1): sign_mode = 'standalone' rpc_type = 'remote' avg_bdi = 6 # TODO + has_usr_fee = False address_reuse_ok = False wif_ver_num = btc_mainnet.wif_ver_num diff --git a/mmgen/protocol.py b/mmgen/protocol.py index 23756bde..fb81660f 100755 --- a/mmgen/protocol.py +++ b/mmgen/protocol.py @@ -57,6 +57,7 @@ class CoinProtocol(MMGenObject): is_fork_of = None chain_names = None is_evm = False + has_usr_fee = True rpc_type = 'local' networks = ('mainnet', 'testnet', 'regtest') decimal_prec = 28