2018-09-17 13:36:31 -07:00
|
|
|
use budget::Budget;
|
|
|
|
use chrono::prelude::{DateTime, Utc};
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
|
|
|
pub struct Vote {
|
|
|
|
/// We send some gossip specific membership information through the vote to shortcut
|
|
|
|
/// liveness voting
|
2018-10-08 19:55:54 -07:00
|
|
|
/// The version of the ClusterInfo struct that the last_id of this network voted with
|
2018-09-17 13:36:31 -07:00
|
|
|
pub version: u64,
|
2018-10-08 19:55:54 -07:00
|
|
|
/// The version of the ClusterInfo struct that has the same network configuration as this one
|
2018-09-17 13:36:31 -07:00
|
|
|
pub contact_info_version: u64,
|
|
|
|
// TODO: add signature of the state here as well
|
|
|
|
}
|
|
|
|
|
|
|
|
/// An instruction to progress the smart contract.
|
|
|
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
|
|
|
pub enum Instruction {
|
2018-10-12 22:50:43 -07:00
|
|
|
/// Declare and instantiate `Budget`.
|
|
|
|
NewBudget(i64, Budget),
|
2018-09-17 13:36:31 -07:00
|
|
|
|
|
|
|
/// Tell a payment plan acknowledge the given `DateTime` has past.
|
|
|
|
ApplyTimestamp(DateTime<Utc>),
|
|
|
|
|
2018-10-12 22:50:43 -07:00
|
|
|
/// Tell the budget that the `NewBudget` with `Signature` has been
|
2018-09-17 13:36:31 -07:00
|
|
|
/// signed by the containing transaction's `Pubkey`.
|
2018-09-18 18:45:44 -07:00
|
|
|
ApplySignature,
|
2018-09-17 13:36:31 -07:00
|
|
|
|
|
|
|
/// Vote for a PoH that is equal to the lastid of this transaction
|
|
|
|
NewVote(Vote),
|
|
|
|
}
|