Skip to content

Commit

Permalink
Merge #3247
Browse files Browse the repository at this point in the history
3247: Fix JSON encoding warnings in golden tests. r=jonathanknowles a=jonathanknowles

## Summary

This PR fixes warnings of the following type when running `cardano-wallet-core:test:unit`:
```
WARNING: Encoding new random samples do not match
lib/core/test/data/Cardano/Wallet/Api/ApiTypeName.json
```

## Details

These warnings emanate from round-trip JSON encoding tests, and are caused by changes to underlying types (or generators) that are not accompanied by updates of the golden files.

This commit fixes this issue by regenerating the golden JSON files for types where warnings could be seen in the test log.

As a result, we can see that some data types have coverage that is more complete than before.

## Examples

### `ApiAccountKey`

We now cover shared account keys:

```diff
     "samples": [
-        "acct_xvk17d45ydqpaxgfn6cleg0wjyn4jwa3mpulqyqt0edcxqu9xl0xgzlqwv2gpvzgnautqq6vs96kh7xy3mhq6ulmgffnd92q2pzxk56h3ugwt055r",
-        "acct_xvk1t5hucj78c8a6tp7mg6yawpqsfv3jj3jwnua7lqd8hw985x3aavwndnjpcrn7xufmt983pj59h53uyw3hz5mtlcn2m8htya4ltnnzvwskxu4lg",
-        "acct_vk1zgfxrkh9hh5k3jtfx4them83sqtlkaeh6r746pp4q525z272hzequz0mzv",
-        "acct_xvk1h7ntzpvq56dsesexxhc2juejnsmd35sg9jkkeggxpfd9ypagywelxk03q6hv5xrs4h7r7gj8h3wamcrk9peyzd4334x8hdlehrnw77gnse8sk",
-        "acct_vk18t3c5gcw5c6ptg2hdzd47agr8gnz5ek5zmnd2qqge2vjz0h97u9sygp253",
-        "acct_vk157pl9lvysxulcwmee39afc2n83tp0edk03etgm4m09gyed0qfyssgncfe6",
-        "acct_vk1fwnwyhphwpclv59r4dr9ucsh3dmj243jl45772e2z2mpd4c0j3psdxjv6s",
-        "acct_xvk1efxvcetajem8yehnmmxd59y00e92n2ngpd32x86djsv9pq36w8hspagl6590kh0hgy4anv8m0sedn77fa6e9yypzf2ge62ftxdqxnrgn8tzy5",
-        "acct_xvk1l5e7juy5lw46uhslfdvmfrmzuf26azhj5suyj44r6xf9zeh4a874xdklkl676hvjxkurqwxqsdxpr5fye6v55xst894a5m8v3duepzsztqs57",
-        "acct_xvk14nf4re2c8kpme3xyw84ys3z48yrdxjqapxlw6vhggksu9nfcsdyhkr8dlmq3v2j3773zzqv5yzrt993ru0jr40qrfpd2qxwtn4ppwtgncwnzq"
+        "acct_shared_xvk1jsnrx395hzfx3nq4sxvrsdda8amz6zyq5kx37p0pmyxpnh4ya9yj7hec9vk7qrngs0a5pkykeu805829ftvj00mxhqrk8p2nrdhrrfcxnhv4r",
+        "acct_shared_vk1qkruhy3hxaqtkjyy3cgefra236lk0cdanmr3zfnxksxpujmjpnwqwc50ck",
+        "acct_shared_vk1lhgasafemhezu7fl25dkfkj8hzsnl4j6aeuzssffh6dmf86avsns6nulzr",
+        "acct_shared_xvk100cavmcspq45pw2cw49gzzldzctecn5a6w3cfyrmzustdp9vynv87mwvx3tps6a77uqf4xkh2txlt7prfrsw0lrateqqd7hlvsapppch5n6cu",
+        "acct_shared_vk1ltrzyjjvy2n6rq4c9vydcs9rnmchh00c67cxj9wntewq0pdfgjascwz53z",
+        "acct_shared_vk1599xlyyww6my9qpext89vszlk46jdnynwf69ffl6ewnf6j0ujcfqvd45ly",
+        "acct_shared_vk109nfu9vhrupctgays2vn894sageukjw9epezaxzpxa7m6usn5vtqdlut44",
+        "acct_shared_vk1tl63wah9ejqp60ex5524eerhz6mu6c3pvcqacmjalcq2j5frtz0sjm24q3",
+        "acct_vk1yhvt695w7e0t0ej7tqhzmcpepssydk9khzntp49j6y4yzcwkj7tqjv9un7",
+        "acct_xvk1dpvn4rvt2vrvr2wjsc9k5vsag9wqcecs47khtlgwj40j5gjc7vn7wg82fx8tw6etqjq42fph0d6ndngf3ef662ut3v7650h8jrkfl6qhsk83c"
```

## `ApiEra`

We now cover more eras:

```diff
     "samples": [
         "allegra",
         "byron",
         "mary",
         "shelley",
+        "alonzo",
     ]
 }
```

Co-authored-by: Jonathan Knowles <[email protected]>
  • Loading branch information
iohk-bors[bot] and jonathanknowles authored Apr 22, 2022
2 parents 34c5adc + a34b404 commit f7bc922
Show file tree
Hide file tree
Showing 45 changed files with 1,701 additions and 1,917 deletions.
22 changes: 11 additions & 11 deletions lib/core/test/data/Cardano/Wallet/Api/AnyAddress.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions lib/core/test/data/Cardano/Wallet/Api/ApiAccountKey.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions lib/core/test/data/Cardano/Wallet/Api/ApiByronWalletBalance.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f7bc922

Please sign in to comment.