Browse Source

don't use underscore in commands.

283
thomasv 12 years ago
parent
commit
c263a92351
  1. 17
      lib/commands.py

17
lib/commands.py

@ -41,7 +41,10 @@ options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address
'listaddresses': 'listaddresses':
"""Shows your list of addresses. """Shows your list of addresses.
options: options:
-a: show all addresses, including change addresses""", -a: show all addresses, including change addresses
-b: include balance in results
-l: include labels in results
""",
'history':"Shows the transaction history", 'history':"Shows the transaction history",
'setlabel':'Assign a label to an item\nSyntax: label <tx_hash> <label>', 'setlabel':'Assign a label to an item\nSyntax: label <tx_hash> <label>',
@ -50,7 +53,7 @@ options:
Syntax: mktx <recipient> <amount> [label] Syntax: mktx <recipient> <amount> [label]
options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
""", """,
'get_seed': 'getseed':
"Print the generation seed of your wallet.", "Print the generation seed of your wallet.",
'importprivkey': 'importprivkey':
'Import a private key\nSyntax: importprivkey <privatekey>', 'Import a private key\nSyntax: importprivkey <privatekey>',
@ -88,7 +91,7 @@ offline_commands = [ 'password', 'mktx',
'help', 'validateaddress', 'help', 'validateaddress',
'signmessage', 'verifymessage', 'signmessage', 'verifymessage',
'eval', 'set', 'get', 'create', 'listaddresses', 'eval', 'set', 'get', 'create', 'listaddresses',
'importprivkey', 'get_seed', 'importprivkey', 'getseed',
'deseed', 'deseed',
'freeze','unfreeze', 'freeze','unfreeze',
'prioritize','unprioritize', 'prioritize','unprioritize',
@ -96,7 +99,7 @@ offline_commands = [ 'password', 'mktx',
'createmultisig', 'createrawtransaction', 'decoderawtransaction', 'signrawtransaction' 'createmultisig', 'createrawtransaction', 'decoderawtransaction', 'signrawtransaction'
] ]
protected_commands = ['payto', 'password', 'mktx', 'get_seed', 'importprivkey','signmessage', 'signrawtransaction', 'dumpprivkey', 'dumpprivkeys' ] protected_commands = ['payto', 'password', 'mktx', 'getseed', 'importprivkey','signmessage', 'signrawtransaction', 'dumpprivkey', 'dumpprivkeys' ]
class Commands: class Commands:
@ -201,7 +204,7 @@ class Commands:
return out return out
def get_seed(self): def getseed(self):
import mnemonic import mnemonic
seed = self.wallet.decode_seed(self.password) seed = self.wallet.decode_seed(self.password)
return { "hex":seed, "mnemonic": ' '.join(mnemonic.mn_encode(seed)) } return { "hex":seed, "mnemonic": ' '.join(mnemonic.mn_encode(seed)) }
@ -216,11 +219,11 @@ class Commands:
return out return out
def sign_message(self, address, message): def signmessage(self, address, message):
return self.wallet.sign_message(address, message, self.password) return self.wallet.sign_message(address, message, self.password)
def verify_message(self, address, signature, message): def verifymessage(self, address, signature, message):
try: try:
EC_KEY.verify_message(address, signature, message) EC_KEY.verify_message(address, signature, message)
return True return True

Loading…
Cancel
Save