Delete dead code
This commit is contained in:
parent
cf15cf587f
commit
76b06b47ba
|
@ -12,23 +12,6 @@ pub enum Witness {
|
||||||
Signature(PublicKey),
|
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)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||||
pub struct Payment {
|
pub struct Payment {
|
||||||
pub tokens: i64,
|
pub tokens: i64,
|
||||||
|
|
Loading…
Reference in New Issue