-
Notifications
You must be signed in to change notification settings - Fork 631
[CDEC-500] Add golden tests for Address #3405
Conversation
The `Bi` & `Json` modules had a number of datatypes which were shared and could be factored out. This commit pulls them out into the `ExampleHelpers` module.
a85c456
to
e5faa88
Compare
Since we are modifying this for CO-354, and it's quite important to preserve backwards compatibility of Addresses, I've added 5 golden tests to ensure the various configurations of Addresses will have proper test coverage. 4 example Address datatypes are added to the 1 existing datatype, and all 5 are used for golden tests in both the `Json` and `Bi` modules.
e5faa88
to
f251526
Compare
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.
Looks good, just a question WRT JSON encoding.
@@ -0,0 +1 @@ | |||
"2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E" |
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.
Was this JSON encoded? Same question for the other golden address files.
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.
Yeah good question - that should've raised eyebrows for me but I was too focused on finishing the job to notice.
It seems, though, like that's just the JSON format of Address
for us: toJSON calls toObjectKey which uses addressF to call build.
Let me know what you think, since you've worked in the Json parts of the codebase more.
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.
Yep this is the right encoding, just double checked in GHCi. Definitely looks different to the usual key/value map style encoding.
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.
Cool, thanks for confirming.
Description
[CDEC-500] Add golden tests for
Address
Since we are modifying this for CO-354, and it's quite important to
preserve backwards compatibility of Addresses, I've added 5 golden
tests to ensure the various configurations of Addresses will have
proper test coverage.
Linked issue
https://iohk.myjetbrains.com/youtrack/issue/CDEC-500
Type of change
Developer checklist
^ we're adding test coverage, which is not very noteworthy, and can be mentioned in a CHANGELOG entry for the parent YT ticket.
Testing checklist