git://git.novaco.in
/
electrum-nvc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
return python objects from commands, and display them as json
[electrum-nvc.git]
/
lib
/
bitcoin.py
diff --git
a/lib/bitcoin.py
b/lib/bitcoin.py
index
003eff1
..
4617c04
100644
(file)
--- a/
lib/bitcoin.py
+++ b/
lib/bitcoin.py
@@
-727,6
+727,15
@@
class Transaction:
return is_send, v, fee
+ def as_dict(self):
+ import json
+ out = {
+ "hex":self.raw,
+ "complete":self.is_complete
+ }
+ if not self.is_complete:
+ out['input_info'] = repr(self.input_info).replace(' ','')
+ return out
def test_bip32():