From b4fee677a58b3946e802879288b09c27d1ec057b Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Wed, 6 Jun 2018 17:16:12 -0600 Subject: [PATCH] Better docs for payment_plan --- src/payment_plan.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/payment_plan.rs b/src/payment_plan.rs index fe809ca6f4..059c63df60 100644 --- a/src/payment_plan.rs +++ b/src/payment_plan.rs @@ -6,18 +6,27 @@ use chrono::prelude::*; use signature::PublicKey; +/// The types of events a payment plan can process. #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] pub enum Witness { + /// The current time. Timestamp(DateTime), + + /// A siganture from PublicKey. Signature(PublicKey), } +/// Some amount of tokens that should be sent to the `to` `PublicKey`. #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] pub struct Payment { + /// Amount to be paid. pub tokens: i64, + + /// The `PublicKey` that `tokens` should be paid to. pub to: PublicKey, } +/// Interface to smart contracts. pub trait PaymentPlan { /// Return Payment if the payment plan requires no additional Witnesses. fn final_payment(&self) -> Option;