-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Money protobuf validation to use string value #44
Conversation
Test Results 12 files ±0 12 suites ±0 3m 13s ⏱️ +29s Results for commit 933173d. ± Comparison against base commit bf16778. This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Codecov Report
@@ Coverage Diff @@
## main #44 +/- ##
==========================================
+ Coverage 73.38% 73.70% +0.31%
==========================================
Files 16 16
Lines 496 502 +6
Branches 119 120 +1
==========================================
+ Hits 364 370 +6
Misses 81 81
Partials 51 51
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
b907382
to
c292e3b
Compare
c292e3b
to
933173d
Compare
internal fun ContractEnforcementContext.moneyValidation(parentDescription: String = "Input's money", money: FigureTechMoney?) { | ||
money.takeIf { it.isSet() }?.let { setMoney -> | ||
requireThat( | ||
setMoney.value.matches(Regex("^[-]?([0-9]+(?:[\\\\.][0-9]+)?|\\\\.[0-9]+)\$")) orError "$parentDescription must have a valid value", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious: are values less than $1 supposed to come in as 0.15
or .15
? In the latter case, the decimal wouldn't be picked up by this expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former, with a leading 0. It just seems to be the choice made 🤷🏽
Context
Updating the contracts to the latest version of metadata-asset-model per the changes made in provenance-io/metadata-asset-model#15
Changes
Patch
metadata-asset-model
from0.1.11
to0.1.12
tech.figure.util.v1beta1.Money
validation to validate the new string field over the deprecated double fieldNotes
ServicingData
record. However, the loan scope and its contracts are still in beta and being influenced by initial use cases, soServicingData.originalNoteAmount
does not undergo any validation as of this version.