def middleware(method, params): if method in method_handlers: exc_type, handler = method_handlers[method] return excepts( exc_type, make_request, handler, )(method, params) else: return make_request(method, params)
def null_if_excepts(exc_type, fn): return excepts( exc_type, fn, static_return(None), )
), call_eth_tester('get_transaction_receipt'), )), 'getUncleByBlockHashAndIndex': not_implemented, 'getUncleByBlockNumberAndIndex': not_implemented, 'getCompilers': not_implemented, 'compileLLL': not_implemented, 'compileSolidity': not_implemented, 'compileSerpent': not_implemented, 'newFilter': create_log_filter, 'newBlockFilter': call_eth_tester('create_block_filter'), 'newPendingTransactionFilter': call_eth_tester('create_pending_transaction_filter'), 'uninstallFilter': excepts( FilterNotFound, compose( is_null, call_eth_tester('delete_filter'), ), static_return(False), ), 'getFilterChanges': null_if_filter_not_found(call_eth_tester('get_only_filter_changes')), 'getFilterLogs': null_if_filter_not_found(call_eth_tester('get_all_filter_logs')), 'getLogs': get_logs, 'getWork': not_implemented, 'submitWork': not_implemented, 'submitHashrate': not_implemented, }, 'db': { 'putString': not_implemented, 'getString': not_implemented, 'putHex': not_implemented, 'getHex': not_implemented,