mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
receipts. 'list' command to list variables.
This commit is contained in:
parent
3112385dd1
commit
90cd03e093
3 changed files with 15 additions and 2 deletions
|
@ -30,7 +30,7 @@ urldecode = lambda x: _ud.sub(lambda m: chr(int(m.group(1), 16)), x)
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
known_commands = ['help', 'validateaddress', 'balance', 'contacts', 'create', 'payto', 'sendtx', 'password', 'newaddress', 'addresses', 'history', 'label', 'gui', 'mktx','seed','import','signmessage','verifymessage']
|
||||
known_commands = ['help', 'validateaddress', 'balance', 'contacts', 'create', 'payto', 'sendtx', 'password', 'newaddress', 'addresses', 'history', 'label', 'gui', 'mktx','seed','import','signmessage','verifymessage','list']
|
||||
|
||||
usage = "usage: %prog [options] command args\nCommands: "+ (', '.join(known_commands))
|
||||
|
||||
|
@ -147,7 +147,7 @@ if __name__ == '__main__':
|
|||
cmd = 'help'
|
||||
|
||||
# open session
|
||||
if cmd not in ['password', 'mktx', 'history', 'label', 'contacts', 'help', 'validateaddress', 'signmessage', 'verifymessage']:
|
||||
if cmd not in ['password', 'mktx', 'history', 'label', 'contacts', 'help', 'validateaddress', 'signmessage', 'verifymessage', 'list']:
|
||||
wallet.interface.new_session(wallet.all_addresses(), wallet.electrum_version)
|
||||
wallet.update()
|
||||
wallet.save()
|
||||
|
@ -237,6 +237,11 @@ if __name__ == '__main__':
|
|||
for addr in wallet.addressbook:
|
||||
print addr, " ", wallet.labels.get(addr)
|
||||
|
||||
elif cmd == 'list':
|
||||
objname = args[1]
|
||||
obj = eval("wallet."+objname)
|
||||
print obj
|
||||
|
||||
elif cmd in [ 'addresses']:
|
||||
for addr in wallet.all_addresses():
|
||||
if options.show_all or not wallet.is_change(addr):
|
||||
|
|
|
@ -786,6 +786,7 @@ class BitcoinGUI:
|
|||
return
|
||||
try:
|
||||
self.wallet.verify_message(signing_address, signature, cmd )
|
||||
self.wallet.receipt = (signing_address, signature, cmd)
|
||||
except:
|
||||
self.show_message('Warning: the URI contains a bad signature.\nThe identity of the recipient cannot be verified.')
|
||||
payto = amount = label = identity = ''
|
||||
|
|
|
@ -238,6 +238,8 @@ class Wallet:
|
|||
self.history = {}
|
||||
self.labels = {} # labels for addresses and transactions
|
||||
self.aliases = {} # aliases for addresses
|
||||
self.receipts = {} # signed URIs
|
||||
self.receipt = None # next receipt
|
||||
self.addressbook = [] # outgoing addresses, for payments
|
||||
|
||||
# not saved
|
||||
|
@ -477,6 +479,7 @@ class Wallet:
|
|||
'contacts':self.addressbook,
|
||||
'imported_keys':self.imported_keys,
|
||||
'aliases':self.aliases,
|
||||
'receipts':self.receipts,
|
||||
}
|
||||
f = open(self.path,"w")
|
||||
f.write( repr(s) )
|
||||
|
@ -508,6 +511,7 @@ class Wallet:
|
|||
self.addressbook = d.get('contacts')
|
||||
self.imported_keys = d.get('imported_keys',{})
|
||||
self.aliases = d.get('aliases',{})
|
||||
self.receipts = d.get('receipts',{})
|
||||
except:
|
||||
raise BaseException(upgrade_msg)
|
||||
|
||||
|
@ -705,6 +709,9 @@ class Wallet:
|
|||
out = self.interface.send_tx(tx)
|
||||
if out != tx_hash:
|
||||
return False, "error: " + out
|
||||
if self.receipt:
|
||||
self.receipts[tx_hash] = self.receipt
|
||||
self.receipt = None
|
||||
return True, out
|
||||
|
||||
def get_alias(self, x):
|
||||
|
|
Loading…
Add table
Reference in a new issue