pub fn prepare_add_node_payload() -> (AddNodePayload, NodePublicKeys, NodeId) {
    // As the node canister checks for validity of keys, we need to generate them
    // first
    let temp_dir = temp_dir();
    let (node_pks, node_id) = get_node_keys_or_generate_if_missing(temp_dir.path());

    // create payload message
    let node_signing_pk = encode_or_panic(&node_pks.node_signing_pk.clone().unwrap());
    let committee_signing_pk = encode_or_panic(&node_pks.committee_signing_pk.clone().unwrap());
    let ni_dkg_dealing_encryption_pk =
        encode_or_panic(&node_pks.dkg_dealing_encryption_pk.clone().unwrap());
    let transport_tls_cert = encode_or_panic(&node_pks.tls_certificate.clone().unwrap());

    let payload = AddNodePayload {
        node_signing_pk,
        committee_signing_pk,
        ni_dkg_dealing_encryption_pk,
        transport_tls_cert,
        xnet_endpoint: "128.0.0.1:1234".to_string(),
        http_endpoint: "128.0.0.1:8123".to_string(),
        p2p_flow_endpoints: vec!["123,128.0.0.1:10000".to_string()],
        prometheus_metrics_endpoint: "128.0.0.1:5555".to_string(),
    };

    (payload, node_pks, node_id)
}
/// Prepares all the payloads to add a new node, for tests.
Prepares all the payloads to add a new node, for tests.
Prepares all the payloads to add a new node for tests .
pub fn prepare_add_node_payload() -> (AddNodePayload, NodePublicKeys, NodeId) {
    // As the node canister checks for validity of keys, we need to generate them
    // first
    let temp_dir = temp_dir();
    let (node_pks, node_id) = get_node_keys_or_generate_if_missing(temp_dir.path());
    // create payload message
    let node_signing_pk = encode_or_panic(&node_pks.node_signing_pk.clone().unwrap());
    let committee_signing_pk = encode_or_panic(&node_pks.committee_signing_pk.clone().unwrap());
    let ni_dkg_dealing_encryption_pk =
        encode_or_panic(&node_pks.dkg_dealing_encryption_pk.clone().unwrap());
    let transport_tls_cert = encode_or_panic(&node_pks.tls_certificate.clone().unwrap());
    let payload = AddNodePayload {
        node_signing_pk,
        committee_signing_pk,
        ni_dkg_dealing_encryption_pk,
        transport_tls_cert,
        xnet_endpoint: "128.0.0.1:1234".to_string(),
        http_endpoint: "128.0.0.1:8123".to_string(),
        p2p_flow_endpoints: vec!["123,128.0.0.1:10000".to_string()],
        prometheus_metrics_endpoint: "128.0.0.1:5555".to_string(),
    };
    (payload, node_pks, node_id)
}
pub fn prepare_add_node_payload ( ) -> ( AddNodePayload , NodePublicKeys , NodeId ) { // As the node canister checks for validity of keys, we need to generate them // first let temp_dir = temp_dir ( ) ; let ( node_pks , node_id ) = get_node_keys_or_generate_if_missing ( temp_dir . path ( ) ) ; // create payload message let node_signing_pk = encode_or_panic ( & node_pks . node_signing_pk . clone ( ) . unwrap ( ) ) ; let committee_signing_pk = encode_or_panic ( & node_pks . committee_signing_pk . clone ( ) . unwrap ( ) ) ; let ni_dkg_dealing_encryption_pk = encode_or_panic ( & node_pks . dkg_dealing_encryption_pk . clone ( ) . unwrap ( ) ) ; let transport_tls_cert = encode_or_panic ( & node_pks . tls_certificate . clone ( ) . unwrap ( ) ) ; let payload = AddNodePayload { node_signing_pk , committee_signing_pk , ni_dkg_dealing_encryption_pk , transport_tls_cert , xnet_endpoint : " " . to_string ( ) , http_endpoint : " " . to_string ( ) , p2p_flow_endpoints : vec ! [ " " to_string ( ) ] , prometheus_metrics_endpoint : " " . to_string ( ) , } ; ( payload , node_pks , node_id ) }
Prepares all the payloads to add a new node, for tests.
Prepares all the payloads to add a new node for tests .