use candid::{
Principal,
utils::{ArgumentDecoder, ArgumentEncoder},
};
use ic_cdk::api::call::CallResult;
#[derive(Clone)]
pub struct DefaultTransport;
impl DefaultTransport {
pub fn new() -> Self {
DefaultTransport {}
}
pub async fn call<T: ArgumentEncoder + Send + Sync, R: for<'a> ArgumentDecoder<'a>>(
&self,
canister: &Principal,
method: &str,
params: T,
) -> CallResult<R> {
ic_cdk::api::call::call(*canister, method, params).await
}
}