Skip to content

test(common): add GuardedPrice usability matrix and PRICE_SCALE tests (#104) - #1125

Closed
jeffrey-graham wants to merge 1 commit into
DevTobis:mainfrom
jeffrey-graham:test/issue-104-guarded-price-predicates
Closed

jeffrey-graham wants to merge 1 commit into
DevTobis:mainfrom
jeffrey-graham:test/issue-104-guarded-price-predicates

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Closes #104

Summary

  • Adds #[cfg(test)] mod test to contracts/common/src/price.rs.
  • Verifies the 3 x 2 matrix of PriceStatus::{Ok, Degraded, Halted} (with non-zero value = PRICE_SCALE) against GuardedPrice::is_usable_for_new_risk() and GuardedPrice::is_usable_for_liquidation().
  • Asserts PRICE_SCALE == 10_000_000 (7 decimal places matching Stellar stroops).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test GuardedPrice usability predicates and PriceStatus semantics

1 participant