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

Function install_with_all_defaults

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

Source from the content-addressed store, hash-verified

438
439#[test]
440fn install_with_all_defaults() {
441 let TestEnv {
442 env, controller, ..
443 } = setup_new_env();
444
445 let canister_id = env.create_canister_with_settings(Some(controller), None);
446
447 env.set_controllers(canister_id, Some(controller), vec![canister_id, controller])
448 .expect("failed to set canister controller");
449
450 env.add_cycles(canister_id, 5_000_000_000_000);
451 let station_wasm = get_canister_wasm("station").to_vec();
452 let upgrader_wasm = get_canister_wasm("upgrader").to_vec();
453
454 let users = vec![
455 InitUserInput {
456 identities: vec![UserIdentityInput {
457 identity: WALLET_ADMIN_USER,
458 }],
459 name: "station-admin".to_string(),
460 groups: None,
461 id: None,
462 status: station_api::UserStatusDTO::Active,
463 },
464 InitUserInput {
465 identities: vec![UserIdentityInput {
466 identity: Principal::from_slice(&[2; 29]),
467 }],
468 name: "inactive-operator".to_string(),
469 groups: Some(vec![OPERATOR_GROUP_ID.hyphenated().to_string()]),
470 id: None,
471 status: station_api::UserStatusDTO::Inactive,
472 },
473 InitUserInput {
474 identities: vec![UserIdentityInput {
475 identity: Principal::from_slice(&[3; 29]),
476 }],
477 name: "other-user".to_string(),
478 groups: Some(vec![]),
479 id: None,
480 status: station_api::UserStatusDTO::Active,
481 },
482 ];
483
484 let station_init_args = SystemInstall::Init(Box::new(SystemInit {
485 name: "Station".to_string(),
486 upgrader: station_api::SystemUpgraderInput::Deploy(
487 station_api::DeploySystemUpgraderInput {
488 wasm_module: upgrader_wasm,
489 initial_cycles: Some(1_000_000_000_000),
490 },
491 ),
492 fallback_controller: Some(controller),
493 initial_config: station_api::InitialConfig::WithAllDefaults {
494 users: users.clone(),
495 admin_quorum: 1,
496 operator_quorum: 1,
497 },

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_accountsFunction · 0.85
to_vecMethod · 0.80
install_canisterMethod · 0.80

Tested by

no test coverage detected