Skip to content

Commit

Permalink
Delete dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
garious committed May 30, 2018
1 parent cf15cf5 commit 76b06b4
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/payment_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@ pub enum Witness {
Signature(PublicKey),
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
pub enum Condition {
Timestamp(DateTime<Utc>),
Signature(PublicKey),
}

impl Condition {
/// Return true if the given Witness satisfies this Condition.
pub fn is_satisfied(&self, witness: &Witness) -> bool {
match (self, witness) {
(&Condition::Signature(ref pubkey), &Witness::Signature(ref from)) => pubkey == from,
(&Condition::Timestamp(ref dt), &Witness::Timestamp(ref last_time)) => dt <= last_time,
_ => false,
}
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
pub struct Payment {
pub tokens: i64,
Expand Down

0 comments on commit 76b06b4

Please sign in to comment.