[][src]Module safe_app::utils::test_utils

Common utility functions for writing test cases.

Functions

calculate_new_balance

Helper function to calculate the total cost of expenditure by adding number of mutations and amount of transferred coins if any.

gen_app_id

Generates a random app full ID.

gen_bls_keypair

Generates a random BLS secret and public keypair.

gen_client_id

Generates a random client full ID.

init_log

Initialises env_logger with custom settings.

random_client

Create random registered client. Use this to create a CoreClient automatically and randomly.

setup_client

Helper to create a client Useful when we need to supply credentials explicitly or when Client is to be constructed as unregistered or as a result of successful login. Use this to create Client manually.

setup_client_with_net_obs

Helper to create a client and setup network event listener. Useful when we need to supply credentials explicitly or when Client is to be constructed as unregistered or as a result of successful login. Use this to create Client manually.