mirror of
https://github.com/fluencelabs/aquavm
synced 2025-06-28 22:21:34 +00:00
feat!(avm-server): Per-call current_peer_id (#381)
The current peer ID is passed as a new field of `TestRunParameters` named `current_peer_id: String`, instead of creating an AVM with peer ID. This is a breaking API change of `avm-interface` and `avm-server`.
This commit is contained in:
@ -20,25 +20,28 @@ use std::borrow::Cow;
|
||||
|
||||
/// Represents parameters obtained from a particle.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ParticleParameters<'init_peer_id, 'particle_id> {
|
||||
pub init_peer_id: Cow<'init_peer_id, str>,
|
||||
pub particle_id: Cow<'particle_id, str>,
|
||||
pub struct ParticleParameters<'ctx> {
|
||||
pub init_peer_id: Cow<'ctx, str>,
|
||||
pub particle_id: Cow<'ctx, str>,
|
||||
pub timestamp: u64,
|
||||
pub ttl: u32,
|
||||
pub current_peer_id: Cow<'ctx, str>,
|
||||
}
|
||||
|
||||
impl<'init_peer_id, 'particle_id> ParticleParameters<'init_peer_id, 'particle_id> {
|
||||
impl<'ctx> ParticleParameters<'ctx> {
|
||||
pub fn new(
|
||||
init_peer_id: Cow<'init_peer_id, str>,
|
||||
particle_id: Cow<'particle_id, str>,
|
||||
init_peer_id: Cow<'ctx, str>,
|
||||
particle_id: Cow<'ctx, str>,
|
||||
timestamp: u64,
|
||||
ttl: u32,
|
||||
current_peer_id: Cow<'ctx, str>,
|
||||
) -> Self {
|
||||
Self {
|
||||
init_peer_id,
|
||||
particle_id,
|
||||
timestamp,
|
||||
ttl,
|
||||
current_peer_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user