mirror of
https://github.com/mimblewimble/grin.git
synced 2025-04-21 01:41: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 uuid::Uuid;
|
||||
|
||||
const CURRENT_SLATE_VERSION: u64 = 1;
|
||||
|
||||
/// Public data for each participant in the slate
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
|
@ -119,6 +121,13 @@ pub struct Slate {
|
|||
/// insert their public data here. For now, 0 is sender and 1
|
||||
/// is receiver, though this will change for multi-party
|
||||
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
|
||||
|
@ -140,6 +149,7 @@ impl Slate {
|
|||
height: 0,
|
||||
lock_height: 0,
|
||||
participant_data: vec![],
|
||||
version: CURRENT_SLATE_VERSION,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue