mucking with formatters still

This commit is contained in:
Piper Merriam 2016-09-02 16:33:58 -06:00
parent b104544ee2
commit 89d7566a30

View File

@ -39,6 +39,10 @@ from web3.utils.functional import (
def apply_if_passes_test(test_fn):
"""
Constructs a decorator that will cause the underlying function to only be
applied to the given value if the `test_fn` returns true for that value.
"""
def outer_fn(fn):
@functools.wraps(fn)
def inner(value):
@ -148,6 +152,11 @@ apply_if_array_of_dicts = apply_if_passes_test(compose(
))
filter_output_formatter = apply_if_not_null(apply_if_array_of_dicts(
log_array_formatter
))
@coerce_args_to_text
@coerce_return_to_text
def output_transaction_receipt_formatter(receipt):
@ -195,9 +204,6 @@ def output_block_formatter(block):
}
filter_output_formatter = apply_if_array_of_dicts(log_array_formatter)
@coerce_return_to_text
def inputPostFormatter(post):
"""