solana-with-rpc-optimizations/src/budget_instruction.rs

31 lines
1.1 KiB
Rust
Raw Normal View History

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
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
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 {
/// Declare and instantiate `Budget`.
NewBudget(Budget),
/// Tell a payment plan acknowledge the given `DateTime` has past.
ApplyTimestamp(DateTime<Utc>),
/// Tell the budget that the `NewBudget` with `Signature` has been
/// signed by the containing transaction's `Pubkey`.
2018-09-18 18:45:44 -07:00
ApplySignature,
/// Vote for a PoH that is equal to the lastid of this transaction
NewVote(Vote),
}