mirror of
https://github.com/fluencelabs/aquavm
synced 2025-07-03 00:21:33 +00:00
Introduce %ttl% (#253)
This commit is contained in:
@ -33,14 +33,18 @@ pub struct RunParameters {
|
||||
/// Unix timestamp from a particle in milliseconds.
|
||||
/// It represents time when this particle was sent from the init peer id.
|
||||
pub timestamp: u64,
|
||||
|
||||
/// TTL set by init peer id in milliseconds.
|
||||
pub ttl: u32,
|
||||
}
|
||||
|
||||
impl RunParameters {
|
||||
pub fn new(init_peer_id: String, current_peer_id: String, timestamp: u64) -> Self {
|
||||
pub fn new(init_peer_id: String, current_peer_id: String, timestamp: u64, ttl: u32) -> Self {
|
||||
Self {
|
||||
init_peer_id,
|
||||
current_peer_id,
|
||||
timestamp,
|
||||
ttl,
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,6 +53,7 @@ impl RunParameters {
|
||||
IValue::String(self.init_peer_id),
|
||||
IValue::String(self.current_peer_id),
|
||||
IValue::U64(self.timestamp),
|
||||
IValue::U32(self.ttl),
|
||||
];
|
||||
// unwrap is safe here because run_parameters is non-empty array
|
||||
let run_parameters = NEVec::new(run_parameters).unwrap();
|
||||
|
Reference in New Issue
Block a user