(txids, channel_id, actual, exp)
| 339 | |
| 340 | |
| 341 | def inspect_check_actual(txids, channel_id, actual, exp): |
| 342 | if len(actual['outputs']) != len(exp): |
| 343 | raise ValueError(f"actual outputs != exp. exp: {exp}. actual: {actual['outputs']}") |
| 344 | |
| 345 | for e in exp: |
| 346 | # find the event in actual that matches |
| 347 | found = False |
| 348 | for a in actual['outputs']: |
| 349 | if e[0].startswith('cid'): |
| 350 | if a['account'] != channel_id: |
| 351 | continue |
| 352 | elif a['account'] != e[0]: |
| 353 | continue |
| 354 | |
| 355 | if e[1][0] != a['output_tag']: |
| 356 | continue |
| 357 | if e[2]: |
| 358 | if e[2][0] != a['spend_tag']: |
| 359 | raise ValueError(f'spend_tag mismatch. expected: {e}, actual {a}') |
| 360 | txids.append((e[3], a['spending_txid'])) |
| 361 | elif 'spend_tag' in a: |
| 362 | raise ValueError(f'{a} contains "spend_tag", expecting {e}') |
| 363 | |
| 364 | found = True |
| 365 | break |
| 366 | if not found: |
| 367 | raise ValueError(f'Unable to find actual tx {a} in expected {exp}') |
| 368 | |
| 369 | return txids |
| 370 | |
| 371 | |
| 372 | def check_inspect_channel(n, channel_id, expected_txs): |
no outgoing calls
no test coverage detected