Esempio n. 1
0
def test_get_tx_info():
    df = ethplorer_model.get_tx_info(
        tx_hash=
        "0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6", )

    assert isinstance(df, pd.DataFrame)
    assert not df.empty
Esempio n. 2
0
def display_tx_info(
    tx_hash: str,
    export: str = "",
) -> None:
    """Display info about transaction. [Source: Ethplorer]

    Parameters
    ----------
    tx_hash: str
        Transaction hash e.g. 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6
    export : str
        Export dataframe data to csv,json,xlsx file
    """

    df = ethplorer_model.get_tx_info(tx_hash)
    df_data = df.copy()
    print_rich_table(
        df,
        headers=list(df.columns),
        show_index=False,
        title="Information About Transactions",
    )
    console.print("")

    export_data(
        export,
        os.path.dirname(os.path.abspath(__file__)),
        "tx",
        df_data,
    )