-
Notifications
You must be signed in to change notification settings - Fork 205
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
Prohibit contract IDs in contract keys and add key maintainers to exercises #4048
Changes from 1 commit
1d1f228
f05f20f
baac6bc
62e33ee
3b78600
8fa86b2
2e037a6
b4024ad
042f27d
7347c49
d90360c
342c158
5180d55
dc2b942
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,6 +301,11 @@ class TransactionCoderSpec | |
case _ => gn | ||
} | ||
|
||
def withoutMaintainersInExercise[Nid, Cid, Val](gn: GenNode[Nid, Cid, Val]): GenNode[Nid, Cid, Val] = | ||
gn match { | ||
case ne: NodeExercises[Nid, Cid, Val] => ne copy (key = ne.key.map(_.copy(maintainers = Set.empty))) | ||
case _ => gn | ||
} | ||
def transactionWithout[Nid: Ordering, Cid, Val]( | ||
t: GenTransaction[Nid, Cid, Val], | ||
f: GenNode[Nid, Cid, Val] => GenNode[Nid, Cid, Val]): GenTransaction[Nid, Cid, Val] = | ||
|
@@ -315,6 +320,8 @@ class TransactionCoderSpec | |
(x: GenNode[Nid, Cid, Val]) => withoutExerciseResult(withoutContractKeyInExercise(x))) | ||
else if (txvMin precedes minContractKeyInExercise) | ||
transactionWithout(tx, (x: GenNode[Nid, Cid, Val]) => withoutContractKeyInExercise(x)) | ||
else if (txvMin precedes minMaintainersInExercise) | ||
transactionWithout(tx, (x: GenNode[Nid, Cid, Val]) => withoutMaintainersInExercise(x)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added and reorganized. Less efficient when no changes need to be done, but this is test code. |
||
else tx | ||
|
||
} |
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.
[Cosmetic]
I found this pattern matching with booleans a bit confusing.
I woul prefer something like
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.
I also messed up the logic here. I also changed the style now but I'm ambivalent to that.