eth cfg file vars: max_tx_fee,mainnet_chain_name,testnet_chain_name

This commit is contained in:
The MMGen Project 2018-07-23 17:09:48 +00:00
commit 8b21259ef8
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 17 additions and 7 deletions

View file

@ -55,6 +55,9 @@
# Set the maximum transaction fee for LTC:
# ltc_max_tx_fee 0.3
# Set the maximum transaction fee for ETH:
# eth_max_tx_fee 0.005
# Set the transaction fee adjustment factor. Auto-calculated fees are
# multiplied by this value:
# tx_fee_adj 1.0
@ -62,6 +65,12 @@
# Set the maximum transaction file size:
# max_tx_file_size 100000
# Set the Ethereum mainnet name
# eth_mainnet_chain_name foundation
# Set the Ethereum testnet name
# eth_testnet_chain_name kovan
#####################################################################
# The following options are probably of interest only to developers #
#####################################################################

View file

@ -47,7 +47,7 @@ class g(object):
author = 'The MMGen Project'
email = '<mmgen@tuta.io>'
Cdates = '2013-2018'
keywords = 'Bitcoin, BTC, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, Linux, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous, Electrum, seed, mnemonic, brainwallet, Scrypt, utility, script, scriptable, blockchain, raw, transaction, permissionless, console, terminal, curses, ansi, color, tmux, remote, client, daemon, RPC, json, entropy, xterm, rxvt, PowerShell, MSYS, MinGW, mswin, Armbian, Raspbian, Raspberry Pi, Orange Pi, BCash, BCH, Litecoin, LTC, altcoin, ZEC, Zcash, DASH, Dashpay, ETH, Ethereum, Classic, SHA256Compress, XMR, Monero, EMC, Emercoin'
keywords = 'Bitcoin, BTC, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, Linux, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous, Electrum, seed, mnemonic, brainwallet, Scrypt, utility, script, scriptable, blockchain, raw, transaction, permissionless, console, terminal, curses, ansi, color, tmux, remote, client, daemon, RPC, json, entropy, xterm, rxvt, PowerShell, MSYS, MinGW, mswin, Armbian, Raspbian, Raspberry Pi, Orange Pi, BCash, BCH, Litecoin, LTC, altcoin, ZEC, Zcash, DASH, Dashpay, ETH, Ethereum, Classic, SHA256Compress, XMR, Monero, monerod, EMC, Emercoin, ERC20, token, deploy, contract, gas, fee, smart contract, solidity, Parity, testnet, devmode, Kovan'
max_int = 0xffffffff
stdin_tty = bool(sys.stdin.isatty() or os.getenv('MMGEN_TEST_SUITE'))
http_timeout = 60
@ -135,7 +135,8 @@ class g(object):
'color','debug','hash_preset','http_timeout','no_license','rpc_host','rpc_port',
'quiet','tx_fee_adj','usr_randchars','testnet','rpc_user','rpc_password',
'daemon_data_dir','force_256_color','regtest',
'btc_max_tx_fee','ltc_max_tx_fee','bch_max_tx_fee',
'btc_max_tx_fee','ltc_max_tx_fee','bch_max_tx_fee','eth_max_tx_fee',
'eth_mainnet_chain_name','eth_testnet_chain_name',
'max_tx_file_size'
)
env_opts = (

View file

@ -90,7 +90,6 @@ class BitcoinProtocol(MMGenObject):
witness_vernum_hex = '00'
witness_vernum = int(witness_vernum_hex,16)
bech32_hrp = 'bc'
chain_aliases = {}
@classmethod
def is_testnet(cls):
@ -304,8 +303,8 @@ class EthereumProtocol(DummyWIF,BitcoinProtocolAddrgen):
rpc_port = 8545
mmcaps = ('key','addr','rpc')
coin_amt = ETHAmt
chain_aliases = {'mainnet':['foundation'],'testnet':['kovan']}
max_tx_fee = ETHAmt('0.005')
chain_name = 'foundation'
@classmethod
def verify_addr(cls,addr,hex_width,return_dict=False):
@ -324,6 +323,7 @@ class EthereumProtocol(DummyWIF,BitcoinProtocolAddrgen):
class EthereumTestnetProtocol(EthereumProtocol):
data_subdir = 'testnet'
rpc_port = 8547 # start Parity with --ports-shift=2
chain_name = 'kovan'
class EthereumClassicProtocol(EthereumProtocol):
name = 'ethereum_classic'

View file

@ -306,8 +306,8 @@ Selected non-{pnm} inputs: {{}}""".strip().format(pnm=g.proj_name,pnl=g.proj_nam
assert on_fail in ('return','die'),"'{}': invalid value for 'on_fail'".format(on_fail)
m = 'Transaction is for {}, but current chain is {}!'.format(self.chain,g.chain)
bad = self.chain and g.chain and self.chain != g.chain
if bad and g.chain in g.proto.chain_aliases:
bad = self.chain not in g.proto.chain_aliases[g.chain]
if bad and hasattr(g.proto,'chain_name'):
bad = self.chain != g.proto.chain_name
if bad:
msg(m) if on_fail == 'return' else die(2,m)
return not bad