Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,17 @@ impl Drive {
Some(vec!["destroyedAmount", "note"])
}
TokenTransition::Claim(_) => Some(vec!["amount"]),
TokenTransition::DirectPurchase(_) => {
let purchase_cost: Credits =
document.properties().get_integer("purchaseCost")?;
let agreed_to_purchase_cost: Credits = expected_document
.properties()
.get_integer("purchaseCost")?;
if purchase_cost > agreed_to_purchase_cost {
return Err(Error::Proof(ProofError::UnexpectedResultProof(format!("proof of state transition execution showed a purchase price of {}, whereas we only agreed to {}, state transition is [{}]", purchase_cost, agreed_to_purchase_cost, token_transition))));
}
Some(vec!["purchaseCost"])
}
TokenTransition::Burn(_)
| TokenTransition::Mint(_)
| TokenTransition::Freeze(_)
Expand Down
Loading