MCPcopy Create free account
hub / github.com/dfinity/orbit / install_with_default_policies

Function install_with_default_policies

tests/integration/src/install_tests.rs:28–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26
27#[test]
28fn install_with_default_policies() {
29 let TestEnv {
30 env, controller, ..
31 } = setup_new_env();
32
33 let canister_id = env.create_canister_with_settings(Some(controller), None);
34
35 env.set_controllers(canister_id, Some(controller), vec![canister_id, controller])
36 .expect("failed to set canister controller");
37
38 env.add_cycles(canister_id, 5_000_000_000_000);
39 let station_wasm = get_canister_wasm("station").to_vec();
40 let upgrader_wasm = get_canister_wasm("upgrader").to_vec();
41
42 let asset_1_id = Uuid::new_v4().hyphenated().to_string();
43 let asset_2_id = Uuid::new_v4().hyphenated().to_string();
44
45 let account_1_id = Uuid::new_v4().hyphenated().to_string();
46
47 let users = vec![
48 InitUserInput {
49 identities: vec![UserIdentityInput {
50 identity: WALLET_ADMIN_USER,
51 }],
52 name: "station-admin".to_string(),
53 groups: None,
54 id: None,
55 status: station_api::UserStatusDTO::Active,
56 },
57 InitUserInput {
58 identities: vec![UserIdentityInput {
59 identity: Principal::from_slice(&[2; 29]),
60 }],
61 name: "inactive-station-admin".to_string(),
62 groups: Some(vec![ADMIN_GROUP_ID.hyphenated().to_string()]),
63 id: None,
64 status: station_api::UserStatusDTO::Inactive,
65 },
66 InitUserInput {
67 identities: vec![UserIdentityInput {
68 identity: Principal::from_slice(&[3; 29]),
69 }],
70 name: "other-user".to_string(),
71 groups: Some(vec![]),
72 id: None,
73 status: station_api::UserStatusDTO::Active,
74 },
75 ];
76
77 let accounts = vec![station_api::InitAccountInput {
78 name: "test-account".to_string(),
79 id: Some(account_1_id.clone()),
80 metadata: vec![MetadataDTO {
81 key: "test-key".to_string(),
82 value: "test-value".to_string(),
83 }],
84 assets: vec![asset_1_id.clone(), asset_2_id.clone()],
85 seed: Uuid::new_v4().to_bytes_le(),

Callers

nothing calls this directly

Calls 10

setup_new_envFunction · 0.85
get_canister_wasmFunction · 0.85
await_station_healthyFunction · 0.85
assert_initial_usersFunction · 0.85
assert_initial_assetsFunction · 0.85
assert_initial_accountsFunction · 0.85
to_vecMethod · 0.80
install_canisterMethod · 0.80

Tested by

no test coverage detected