eth autosign support
This commit is contained in:
parent
8b21259ef8
commit
6ab7a4d06c
3 changed files with 8 additions and 6 deletions
|
|
@ -29,8 +29,6 @@ part_label = u'MMGEN_TX'
|
|||
wallet_dir = u'/dev/shm/autosign'
|
||||
key_fn = u'autosign.key'
|
||||
|
||||
no_daemon_coins = ('ETH',)
|
||||
|
||||
from mmgen.common import *
|
||||
prog_name = os.path.basename(sys.argv[0])
|
||||
opts_data = lambda: {
|
||||
|
|
@ -121,15 +119,16 @@ def check_daemons_running():
|
|||
coins = ['BTC']
|
||||
|
||||
for coin in coins:
|
||||
if coin in no_daemon_coins: continue
|
||||
g.proto = CoinProtocol(coin,g.testnet)
|
||||
if g.proto.sign_mode != 'daemon': continue
|
||||
vmsg('Checking {} daemon'.format(coin))
|
||||
try:
|
||||
rpc_init(reinit=True)
|
||||
g.rpch.getbalance()
|
||||
except SystemExit as e:
|
||||
if e[0] != 0:
|
||||
ydie(1,'{} daemon not running or not listening on port {}'.format(coin,g.proto.rpc_port))
|
||||
fs = '{} daemon not running or not listening on port {}'
|
||||
ydie(1,fs.format(coin,g.proto.rpc_port))
|
||||
|
||||
def get_wallet_files():
|
||||
wfs = filter(lambda x: x[-6:] == '.mmdat',os.listdir(wallet_dir))
|
||||
|
|
@ -159,7 +158,7 @@ def sign_tx_file(txfile):
|
|||
init_coin(mmgen.tx.MMGenTX(txfile,coin_sym_only=True).coin)
|
||||
reload(sys.modules['mmgen.tx'])
|
||||
tx = mmgen.tx.MMGenTX(txfile)
|
||||
if tx.coin not in no_daemon_coins:
|
||||
if g.proto.sign_mode == 'daemon':
|
||||
rpc_init(reinit=True)
|
||||
txsign(tx,wfs,None,None)
|
||||
tx.write_to_file(ask_write=False)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ infiles = opts.init(opts_data,add_opts=['b16'])
|
|||
if not infiles: opts.usage()
|
||||
for i in infiles: check_infile(i)
|
||||
|
||||
rpc_init()
|
||||
if g.proto.sign_mode == 'daemon':
|
||||
rpc_init()
|
||||
|
||||
if not opt.info and not opt.terse_info:
|
||||
do_license_msg(immed=True)
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ class BitcoinProtocol(MMGenObject):
|
|||
witness_vernum_hex = '00'
|
||||
witness_vernum = int(witness_vernum_hex,16)
|
||||
bech32_hrp = 'bc'
|
||||
sign_mode = 'daemon'
|
||||
|
||||
@classmethod
|
||||
def is_testnet(cls):
|
||||
|
|
@ -305,6 +306,7 @@ class EthereumProtocol(DummyWIF,BitcoinProtocolAddrgen):
|
|||
coin_amt = ETHAmt
|
||||
max_tx_fee = ETHAmt('0.005')
|
||||
chain_name = 'foundation'
|
||||
sign_mode = 'standalone'
|
||||
|
||||
@classmethod
|
||||
def verify_addr(cls,addr,hex_width,return_dict=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue