Most of the Tezos API calls take the same set of info that does not change across instantiations. We should consolidate these elements into a struct that can be passed to the API calls, like
/// Information that describes a Tezos client that can post a operation on chain.
pub struct TezosClient {
/// Link to the Tezos network.
pub uri: Option<http::Uri>,
/// ID of the contract for which the client will post an operation.
pub contract_id: ContractId,
/// Key material for the client.
pub client_key_pair: TezosKeyMaterial,
/// Block depth for which the client will wait for their operation to reach.
pub confirmation_depth: u64,
}
Then, each party can have a single function that generates this struct from the config file, database, and channel id, and pass it to the API as appropriate. This will probably also reduce the amount of parameters floating around in the main function calls for each party.
Most of the Tezos API calls take the same set of info that does not change across instantiations. We should consolidate these elements into a struct that can be passed to the API calls, like
Then, each party can have a single function that generates this struct from the config file, database, and channel id, and pass it to the API as appropriate. This will probably also reduce the amount of parameters floating around in the main function calls for each party.