// This is a generated test setup file.
// Manual changes are possible, but you still need to make sure they are not lost, if the file is regenerated.
// If possible, it is best to keep any additional manual test preparation steps outside, in `tests.rs`,
// then this file can be regenerated without risk of losing work.
#![allow(dead_code)]

use ic_test::IcpTest;

use crate::bindings::{ {% for c in canisters %}
    {{ c.var_name }}::{self, {{c.service_name}}},{% endfor %}
};

pub(crate) struct Env {
    pub icp_test: IcpTest,{% for c in canisters %}
    pub {{ c.var_name }}: {{c.service_name}},{% endfor %}
}

pub(crate) async fn setup(icp_test: IcpTest) -> Env {
    let icp_user = icp_test.icp.test_user(0);

    // initialize canisters
{% for c in canisters %}

    let {{c.var_name}} = {{c.var_name}}::deploy(
        &icp_user,
        {{ c.init_args_rust }}
    )
    .call()
    .await;
{% endfor %}

    Env {
        icp_test,{% for c in canisters %}
        {{ c.var_name }},{% endfor %}
    }
}
