stage16-conditional-payment.py
TEXT FILE741 B · Public source code for developers, search crawlers and AI agents
1def eligible(order, evidence):
2 return (evidence['network'] == order['network']
3 and evidence['script'] == order['script']
4 and type(evidence['sat']) is int
5 and evidence['sat'] == order['sat']
6 and type(evidence['confirmations']) is int
7 and evidence['confirmations'] >= order['min_confirmations']
8 and evidence['canonical'] is True)
9
10order = dict(network='test', script='synthetic-script', sat=5000, min_confirmations=2)
11evidence = dict(network='test', script='synthetic-script', sat=5000, confirmations=2, canonical=True)
12assert eligible(order,evidence)
13assert not eligible(order,dict(evidence,canonical=False))
14assert not eligible(order,dict(evidence,network='main'))Read-only source · Select a line number to link directly · Raw download above
