{-
  This test contract serves two main purposes:
  1. It allows testing of non-getter functions in FunC without requiring specific opcodes for each function.
  2. It provides access to internal functions through wrapper getter functions.

  This approach is common in FunC development, where a separate test contract is used for unit testing.
  It enables more comprehensive testing of the contract's functionality, including internal operations
  that are not directly accessible through standard getter methods.
-}

#include "../imports/stdlib.fc";
#include "../Wormhole.fc";
#include "../common/op.fc";

() recv_internal(int balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
    if (in_msg_body.slice_empty?()) {
        return ();
    }

    int op = in_msg_body~load_uint(32);
    cell data = in_msg_body~load_ref();
    slice data_slice = data.begin_parse();
    if (op == OP_UPDATE_GUARDIAN_SET) {
        update_guardian_set(data_slice);
    } else {
        throw(0xffff); ;; Throw exception for unknown op
    }
}

(int, int, int, cell, int) test_parse_encoded_upgrade(int current_guardian_set_index, slice payload) method_id {
    return parse_encoded_upgrade(current_guardian_set_index, payload);
}

(int, int, int, int, int, int, int, int, slice, int) test_parse_and_verify_wormhole_vm(slice in_msg_body) method_id {
    return parse_and_verify_wormhole_vm(in_msg_body);
}

(int) test_get_current_guardian_set_index() method_id {
    return get_current_guardian_set_index();
}

(int, cell, int) test_get_guardian_set(int index) method_id {
    return get_guardian_set(index);
}

(int) test_get_chain_id() method_id {
    return get_chain_id();
}

(int) test_get_governance_chain_id() method_id {
    return get_governance_chain_id();
}

(int) test_get_governance_contract() method_id {
    return get_governance_contract();
}

(int) test_governance_action_is_consumed(int hash) method_id {
    return governance_action_is_consumed(hash);
}
