(moves)
| 185 | |
| 186 | |
| 187 | def extract_utxos(moves): |
| 188 | utxos = {} |
| 189 | for m in moves: |
| 190 | if 'utxo_txid' not in m: |
| 191 | continue |
| 192 | txid = m['utxo_txid'] |
| 193 | if txid not in utxos: |
| 194 | utxos[txid] = [] |
| 195 | |
| 196 | if 'txid' not in m: |
| 197 | utxos[txid].append([m, None]) |
| 198 | else: |
| 199 | evs = utxos[txid] |
| 200 | # it's a withdrawal, find the deposit and add to the pair |
| 201 | for ev in evs: |
| 202 | if ev[0]['vout'] == m['vout']: |
| 203 | ev[1] = m |
| 204 | assert ev[0]['output_msat'] == m['output_msat'] |
| 205 | break |
| 206 | return utxos |
| 207 | |
| 208 | |
| 209 | def print_utxos(utxos): |
no outgoing calls
no test coverage detected