CoinProtocol.Base: new has_usr_fee attribute

This commit is contained in:
The MMGen Project 2025-06-13 10:23:55 +00:00
commit 4ff6752475
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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