mirror of
https://github.com/mimblewimble/grin.git
synced 2025-05-04 08:11:14 +03:00
Feature/slate version (#2491)
* Add a slate version field * Move current slate version to constant * Change slate version to uint * Add default 0 incase it's missing (pre-versioning)
This commit is contained in:
commit
c41ea4bcf2
1 changed files with 10 additions and 0 deletions
|
@ -31,6 +31,8 @@ use rand::thread_rng;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
const CURRENT_SLATE_VERSION: u64 = 1;
|
||||||
|
|
||||||
/// Public data for each participant in the slate
|
/// Public data for each participant in the slate
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
@ -119,6 +121,13 @@ pub struct Slate {
|
||||||
/// insert their public data here. For now, 0 is sender and 1
|
/// insert their public data here. For now, 0 is sender and 1
|
||||||
/// is receiver, though this will change for multi-party
|
/// is receiver, though this will change for multi-party
|
||||||
pub participant_data: Vec<ParticipantData>,
|
pub participant_data: Vec<ParticipantData>,
|
||||||
|
/// Slate format version
|
||||||
|
#[serde(default = "no_version")]
|
||||||
|
pub version: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn no_version() -> u64 {
|
||||||
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper just to facilitate serialization
|
/// Helper just to facilitate serialization
|
||||||
|
@ -140,6 +149,7 @@ impl Slate {
|
||||||
height: 0,
|
height: 0,
|
||||||
lock_height: 0,
|
lock_height: 0,
|
||||||
participant_data: vec![],
|
participant_data: vec![],
|
||||||
|
version: CURRENT_SLATE_VERSION,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue