// Generates a `BTreeMap` of expected `CanisterStates`, after the given messages
// have been popped from the output queues.
Generates a `BTreeMap` of expected `CanisterStates`, after the given messages
have been popped from the output queues.
Generates a ` BTreeMap ` of expected ` CanisterStates ` after the given messages have been popped from the output queues .
fn generate_expected_canister_states(msgs: Vec<Request>) -> BTreeMap<CanisterId, CanisterState> {
    let mut expected_canister_states = BTreeMap::<CanisterId, CanisterState>::new();
    for msg in msgs {
        let expected_canister_state =
            expected_canister_states
                .entry(msg.sender)
                .or_insert_with(|| {
                    new_canister_state(
                        msg.sender,
                        msg.sender.get(),
                        *INITIAL_CYCLES,
                        NumSeconds::from(100_000),
                    )
                });
        // The output_queue can only be constructed with index = 0, so push and pop
        // each message to bump its next queue index.
        let receiver = msg.receiver;
        expected_canister_state.push_output_request(msg).unwrap();
        expected_canister_state
            .system_state
            .queues_mut()
            .pop_canister_output(&receiver)
            .unwrap();
    }
    expected_canister_states
}
fn generate_expected_canister_states ( msgs : Vec < Request > ) -> BTreeMap < CanisterId , CanisterState > { let mut expected_canister_states = BTreeMap :: < CanisterId , CanisterState > :: new ( ) ; for msg in msgs { let expected_canister_state = expected_canister_states . entry ( msg . sender ) . or_insert_with ( | | { new_canister_state ( msg . sender , msg . sender . get ( ) , * INITIAL_CYCLES , NumSeconds :: from ( 100_000 ) , ) } ) ; // The output_queue can only be constructed with index = 0, so push and pop // each message to bump its next queue index. let receiver = msg . receiver ; expected_canister_state . push_output_request ( msg ) . unwrap ( ) ; expected_canister_state . system_state . queues_mut ( ) . pop_canister_output ( & receiver ) . unwrap ( ) ; } expected_canister_states }
Generates a `BTreeMap` of expected `CanisterStates`, after the given messages
have been popped from the output queues.
Generates a ` BTreeMap ` of expected ` CanisterStates ` after the given messages have been popped from the output queues .
msgs
Vec<Request>