Beispiel #1
0
def abi_string_to_text(type_str, data):
    if type_str == 'string':
        return type_str, text_if_str(to_text, data)
Beispiel #2
0
def test_text_if_str_on_text(val):
    to_type = Mock(return_value='zoot')
    assert text_if_str(to_type, val) == 'zoot'
    assert to_type.call_args == ((None, ), {'text': val})
Beispiel #3
0
def abi_string_to_text(type_str: TypeStr,
                       data: Any) -> Optional[Tuple[TypeStr, str]]:
    if type_str == 'string':
        return type_str, text_if_str(to_text, data)
    return None
Beispiel #4
0
def test_text_if_str_passthrough(val):
    to_type = Mock(return_value='zoot')
    assert text_if_str(to_type, val) == 'zoot'
    assert to_type.call_args == ((val, ), {'text': None})
Beispiel #5
0
def abi_string_to_text(abi_type, data):
    if abi_type == 'string':
        return abi_type, text_if_str(to_text, data)