Inline payment_plan
This module predates Accounts. That was a separate module because it used to be part of Bank and those types could be sent to any smart contract. Now each instruction processor defines for itself what instructions it accepts.
This commit is contained in:
@@ -3,12 +3,31 @@
|
||||
//! which it uses to reduce the payment plan. When the budget is reduced to a
|
||||
//! `Payment`, the payment is executed.
|
||||
|
||||
use crate::payment_plan::{Payment, Witness};
|
||||
use chrono::prelude::*;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use std::mem;
|
||||
|
||||
/// The types of events a payment plan can process.
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Witness {
|
||||
/// The current time.
|
||||
Timestamp(DateTime<Utc>),
|
||||
|
||||
/// A signature from Pubkey.
|
||||
Signature,
|
||||
}
|
||||
|
||||
/// Some amount of lamports that should be sent to the `to` `Pubkey`.
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||
pub struct Payment {
|
||||
/// Amount to be paid.
|
||||
pub lamports: u64,
|
||||
|
||||
/// The `Pubkey` that `lamports` should be paid to.
|
||||
pub to: Pubkey,
|
||||
}
|
||||
|
||||
/// A data type representing a `Witness` that the payment plan is waiting on.
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Condition {
|
||||
|
Reference in New Issue
Block a user