a2322d6cdf
* revamped NymTopology * wip * working e2e client * updated nym-api * updated nym-node * updated rest of non-test code * updated the rest of the codebase * additional tweaks * linux clippy fixes + adding additional dummy ipr types for better linting on non-linux targets
33 lines
912 B
Rust
33 lines
912 B
Rust
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
use nym_node_tester_utils::error::NetworkTestingError;
|
|
use nym_node_tester_utils::TestMessage;
|
|
use nym_topology::node::RoutingNode;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub(crate) type NodeTestMessage = TestMessage<NymApiTestMessageExt>;
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Copy, Hash)]
|
|
pub(crate) struct NymApiTestMessageExt {
|
|
pub(crate) route_id: u64,
|
|
pub(crate) test_nonce: u64,
|
|
}
|
|
|
|
impl NymApiTestMessageExt {
|
|
pub fn new(route_id: u64, test_nonce: u64) -> Self {
|
|
NymApiTestMessageExt {
|
|
route_id,
|
|
test_nonce,
|
|
}
|
|
}
|
|
|
|
pub fn mix_plaintexts(
|
|
&self,
|
|
node: &RoutingNode,
|
|
test_packets: u32,
|
|
) -> Result<Vec<Vec<u8>>, NetworkTestingError> {
|
|
NodeTestMessage::mix_plaintexts(node, test_packets, *self)
|
|
}
|
|
}
|