Browse Source

use json format

283
thomasv 12 years ago
parent
commit
ea96b79997
  1. 9
      electrum
  2. 2
      lib/bitcoin.py

9
electrum

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import re import re
import sys, os, time, ast import sys, os, time, json
import optparse import optparse
import platform import platform
@ -364,13 +364,14 @@ if __name__ == '__main__':
args = [ cmd, address, signature, message] args = [ cmd, address, signature, message]
elif cmd == 'signrawtransaction': elif cmd == 'signrawtransaction':
args = [ cmd, args[1], ast.literal_eval(args[2]) if len(args)>2 else [], ast.literal_eval(args[3]) if len(args)>3 else []] import json
args = [ cmd, args[1], json.loads(args[2]) if len(args)>2 else [], json.loads(args[3]) if len(args)>3 else []]
elif cmd == 'createmultisig': elif cmd == 'createmultisig':
args = [ cmd, int(args[1]), ast.literal_eval(args[2])] args = [ cmd, int(args[1]), json.loads(args[2])]
elif cmd == 'createrawtransaction': elif cmd == 'createrawtransaction':
args = [ cmd, ast.literal_eval(args[1]), ast.literal_eval(args[2])] args = [ cmd, json.loads(args[1]), json.loads(args[2])]
elif cmd=='addresses': elif cmd=='addresses':
args = [cmd, options.show_all] args = [cmd, options.show_all]

2
lib/bitcoin.py

@ -735,7 +735,7 @@ class Transaction:
"complete":self.is_complete "complete":self.is_complete
} }
if not self.is_complete and self.input_info: if not self.is_complete and self.input_info:
out['input_info'] = repr(self.input_info).replace(' ','') out['input_info'] = json.dumps(self.input_info).replace(' ','')
return out return out

Loading…
Cancel
Save