<s> from ethereum import tester <EOL> import hydrachain . native_contracts as nc <EOL> from fungible_contract import IOU <EOL> import ethereum . slogging as slogging <EOL> log = slogging . get_logger ( '<STR_LIT>' ) <EOL> def test_iou_template ( ) : <EOL> """<STR_LIT>""" <EOL> nc . registry . register ( IOU ) <EOL> state = tester . state ( ) <EOL> logs = [ ] <EOL> issuer_address = tester . a0 <EOL> issuer_key = tester . k0 <EOL> for evt_class in IOU . events : <EOL> nc . listen_logs ( state , evt_class , callback = lambda e : logs . append ( e ) ) <EOL> iou_address = nc . tester_create_native_contract_instance ( state , issuer_key , IOU ) <EOL> iou_as_issuer = nc . tester_nac ( state , issuer_key , iou_address ) <EOL> iou_as_issuer . init ( ) <EOL> assert iou_as_issuer . balanceOf ( issuer_address ) == <NUM_LIT:0> <EOL> amount_issued = <NUM_LIT> <EOL> iou_as_issuer . issue_funds ( amount_issued , '<STR_LIT>' ) <EOL> assert iou_as_issuer . balanceOf ( issuer_address ) == amount_issued <EOL> iou_as_issuer . issue_funds ( amount_issued , '<STR_LIT>' ) <EOL> assert iou_as_issuer . balanceOf ( issuer_address ) == <NUM_LIT:2> * amount_issued <EOL> assert iou_as_issuer . get_issued_amount ( issuer_address ) == <NUM_LIT:2> * amount_issued <EOL> print logs <EOL> while logs and logs . pop ( ) : <EOL> pass <EOL> nc . registry . unregister ( IOU ) </s>
