• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-spanner: Commit

Python based Bytom wallet tools


Commit MetaInfo

Revision0d46e19a2358deefcd013264ca60486876380061 (tree)
Zeit2018-06-26 18:34:25
AutorPaladz <yzhu101@uott...>
CommiterGitHub

Log Message

Merge pull request #1 from Bytom/dev

Dev

Ändern Zusammenfassung

Diff

--- a/utxomerger/README.md
+++ b/utxomerger/README.md
@@ -1,5 +1,15 @@
11 # UTXO merger
22
3+
4+> **One last disclaimer:**
5+
6+**the code we are about to go over is in no way intended to be used as an example of a robust solution.**
7+
8+**We wouldn't be responsible for the consequences of using this tool.**
9+
10+**please check this python code carefully and use it later.**
11+
12+
313 Requirements: Python 3.x, with requests package
414
515 Dependencies:
--- a/utxomerger/merge_utxo.py
+++ b/utxomerger/merge_utxo.py
@@ -100,13 +100,11 @@ def main():
100100 return
101101
102102 print('To merge {} UTXOs with {:13.8f} BTM totally.\n'.format(len(utxo_total),
103- sum(utxo['amount'] for utxo in utxo_total) / 1e8))
103+ sum(utxo['amount'] for utxo in utxo_total) / 1e8))
104104
105105 merge_size = options.merge_list or input('Merge size of UTXOs (5, 13 or 20): ')
106106 for_loop = options.for_loop or input('for loop size (1, 10 or 50): ')
107107
108-
109-
110108 print(
111109 'One last disclaimer: the code we are about to go over is in no way intended to be used as an example of a robust solution. ')
112110 print('You will transfer BTM to an address, please check this python code and DO IT later.\n')
@@ -116,15 +114,17 @@ def main():
116114 utxo_mergelist = []
117115
118116 # for i in range(merge_size if merge_size <= len(utxolist) else len(utxolist)):
119- # utxo_mergelist.append(utxolist[i])
120- for i in range(loops*merge_size, ((loops+1)*merge_size) if (loops*merge_size) < len(utxolist) else len(utxolist)):
117+ # utxo_mergelist.append(utxolist[i])
118+ for i in range(loops * merge_size,
119+ ((loops + 1) * merge_size) if (loops * merge_size) < len(utxolist) else len(utxolist)):
121120 utxo_mergelist.append(utxolist[i])
122121
123122 # print(loops*merge_size, ", ", ((loops+1)*merge_size) if (loops*merge_size) < len(utxolist) else len(utxolist))
124- print('this is the {} times to merge utxos. -----begin'.format(loops+1))
123+ print('this is the {} times to merge utxos. -----begin'.format(loops + 1))
125124
126125 for i, utxo in enumerate(utxo_mergelist):
127- print('{:4}. {:13.8f} BTM {}{}'.format(loops*merge_size+i, utxo['amount'] / 1e8, utxo['id'], ' (mature)'))
126+ print(
127+ '{:4}. {:13.8f} BTM {}{}'.format(loops * merge_size + i, utxo['amount'] / 1e8, utxo['id'], ' (mature)'))
128128
129129 print("total size of available utxos is {}".format(len(utxo_mergelist)))
130130
@@ -150,11 +150,7 @@ def main():
150150 to_address = input('Transfer address: ')
151151
152152 print('tx_id:', send_tx(Connection(options.url), utxo_mergelist, to_address, options.password))
153- print('this is the {} times to merge utxos. -----end\n'.format(loops+1))
154-
155-
156- time.sleep(2)
157- pass
153+ print('this is the {} times to merge utxos. -----end\n'.format(loops + 1))
158154
159155
160156 if __name__ == '__main__':
Show on old repository browser