mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 10:56:47 +00:00
mucking with formatters still
This commit is contained in:
parent
b104544ee2
commit
89d7566a30
@ -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):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user