Browse Source

CoinProtocol.Base: new `has_usr_fee` attribute

The MMGen Project 5 months ago
parent
commit
4ff6752475
3 changed files with 11 additions and 2 deletions
  1. 9 2
      mmgen/help/help_notes.py
  2. 1 0
      mmgen/proto/rune/params.py
  3. 1 0
      mmgen/protocol.py

+ 9 - 2
mmgen/help/help_notes.py

@@ -119,8 +119,11 @@ FMT CODES:
 		return fmt_list(self.cfg._autoset_opts['tx_proxy'].choices, fmt='fancy')
 		return fmt_list(self.cfg._autoset_opts['tx_proxy'].choices, fmt='fancy')
 
 
 	def rel_fee_desc(self):
 	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):
 	def gas_limit(self, target):
 		return """
 		return """
@@ -138,6 +141,10 @@ of a standard transaction). The default is ‘auto’.
 		""" if target == 'swaptx' or self.proto.base_coin == 'ETH' else ''
 		""" if target == 'swaptx' or self.proto.base_coin == 'ETH' else ''
 
 
 	def fee(self, all_coins=False):
 	def fee(self, all_coins=False):
+
+		if not self.proto.has_usr_fee:
+			return ''
+
 		from ..tx import BaseTX
 		from ..tx import BaseTX
 		text = """
 		text = """
                                FEE SPECIFICATION
                                FEE SPECIFICATION

+ 1 - 0
mmgen/proto/rune/params.py

@@ -37,6 +37,7 @@ class mainnet(CoinProtocol.Secp256k1):
 	sign_mode       = 'standalone'
 	sign_mode       = 'standalone'
 	rpc_type        = 'remote'
 	rpc_type        = 'remote'
 	avg_bdi         = 6 # TODO
 	avg_bdi         = 6 # TODO
+	has_usr_fee     = False
 	address_reuse_ok = False
 	address_reuse_ok = False
 
 
 	wif_ver_num = btc_mainnet.wif_ver_num
 	wif_ver_num = btc_mainnet.wif_ver_num

+ 1 - 0
mmgen/protocol.py

@@ -57,6 +57,7 @@ class CoinProtocol(MMGenObject):
 		is_fork_of = None
 		is_fork_of = None
 		chain_names = None
 		chain_names = None
 		is_evm = False
 		is_evm = False
+		has_usr_fee = True
 		rpc_type = 'local'
 		rpc_type = 'local'
 		networks   = ('mainnet', 'testnet', 'regtest')
 		networks   = ('mainnet', 'testnet', 'regtest')
 		decimal_prec = 28
 		decimal_prec = 28