1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use ic_cdk::api::management_canister::http_request::{HttpResponse, TransformArgs};

pub mod abi;
pub mod rpc;
pub mod utils;

pub use ethers_core as core;

pub use rpc::call_contract;

#[ic_cdk_macros::query(name = "transform")]
pub fn _transform_eth_rpc(args: TransformArgs) -> HttpResponse {
    HttpResponse {
        status: args.response.status.clone(),
        body: args.response.body,
        // Strip headers as they contain the Date which is not necessarily the same
        // and will prevent consensus on the result.
        headers: Vec::new(),
    }
}