Skip to content
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

Derive serde traits in no_std too #131

Merged
merged 7 commits into from
Oct 18, 2023
Merged

Derive serde traits in no_std too #131

merged 7 commits into from
Oct 18, 2023

Conversation

JoshOrndorff
Copy link
Contributor

Previously, we only derived Serialize and Deserialize when building to std. This used to be common practice in Substrate, but it has changed now, as suggested in #130 (comment).

This PR updates the Tuxedo code to derive these traits in both targets. In doing so, it updates serde and enables the serde feature in a few Substrate core crates.

@github-actions
Copy link

Coverage after merging joshy-serde-no-std into main will be

63.59%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tuxedo-core/aggregator/src
   lib.rs99.24%100%100%99.21%117, 21
tuxedo-core/no_bound/src
   clone_no_bound.rs36.63%100%30%37.36%24, 32–39, 56, 59–72, 74–87, 89, 91–95, 98–99
   debug_no_bound.rs32.73%100%30%33%101–105, 108–109, 24, 32–42, 58, 60–78, 80–95, 97–99
   default_no_bound.rs19.11%100%16.67%19.31%100–122, 124–131, 133, 136–147, 151–157, 32–39, 51, 54–80, 83–88, 91–99
   lib.rs100%100%100%100%
tuxedo-core/src
   constraint_checker.rs50%100%47.37%50.75%110, 71–91, 93–95
   dynamic_typing.rs84.03%100%72.73%88.37%57
   executive.rs91.52%100%92.68%91.38%116, 142, 175, 207, 220–228, 236, 247, 298, 325, 376–381, 383, 393–394, 399–400, 403, 405–406, 409–410, 412, 416–437, 439, 443–444, 446–447, 449, 452–469, 54
   inherents.rs0%100%0%0%151–152, 157–171, 173–199, 203–208, 210–219, 221, 56–58, 63–68, 70–78, 81, 83
   types.rs64.09%100%51.11%68.38%13, 143, 36, 51–58, 86, 88–91, 93–99
   utxo_set.rs90.91%100%100%88.89%39–40
   verifier.rs85.71%100%68.35%90.10%105, 139, 28, 46–47, 60
tuxedo-template-runtime/src
   lib.rs29.22%100%19.74%30.82%100–105, 107, 195, 198, 203–205, 209–211, 221–222, 224, 226, 228, 230, 232, 234, 236, 238, 241, 243, 248–249, 257–278, 281–308, 311–422, 64–69
wallet/src
   amoeba.rs0%100%0%0%100–106, 109–110, 112–118, 120–127, 19–48, 51–52, 54–99
   cli.rs0%100%0%0%110, 117, 14, 17, 19, 32, 39, 50, 61, 83, 94, 99
   keystore.rs0%100%0%0%32–34, 39–46, 48–49, 52, 54–60, 66–74, 77–79, 81–83, 86–92, 94–95
   main.rs0%100%0%0%100, 102–103, 106–118, 121, 123–127, 130–134, 136–145, 147–148, 152–162, 165–166, 168, 171–172, 179–185, 187–190, 192–193, 196–203, 206–209, 211–213, 216–218, 220, 222, 225–238, 241–244, 246–257, 259, 34–43, 46, 49, 53, 56–62, 65, 67–69, 74–77, 79, 81, 83–84, 87–88, 90, 92–94, 99
   money.rs0%100%0%0%100–101, 105, 109–112, 114, 119–125, 127–131, 134–135, 139–144, 146–147, 22–28, 31–49, 53–59, 65–72, 74, 78–83, 87, 90, 92, 95–98
   output_filter.rs100%100%100%100%
   rpc.rs0%100%0%0%10–15, 18–20, 22–38
   sync.rs0%100%0%0%100–101, 107–111, 115, 118–119, 122, 124–138, 143–147, 149–150, 155–160, 164–167, 174–175, 177, 180–183, 188–190, 193–194, 197–202, 204–206, 209, 211–212, 217–220, 223–224, 231–235, 237–243, 246–248, 250–251, 254–255, 260–263, 266, 268–269, 274–277, 280, 282–283, 286–292, 294–295, 298–299, 302–303, 306–307, 311–317, 320–324, 327–329, 332–340, 342, 346, 348–349, 352–353, 356–363, 365–366, 369–370, 372, 374–375, 379–381, 383–384, 386–387, 389–390, 393–395, 397–398, 400–401, 403–404, 408, 410–411, 415, 417–422, 425–426, 429–431, 434, 437–440, 442, 445–448, 451, 454–455, 458–459, 46, 464–469, 47, 471, 473, 478–479, 48, 480–481, 484–485, 488–489, 49, 490–493, 495, 498–499, 50, 503–504, 506, 508–509, 51, 510, 512–515, 518–519, 52–56, 58–66, 68, 70–76, 78, 80, 82, 84–86, 91–94, 96
wardrobe/amoeba/src
   lib.rs58.17%100%26.83%69.64%121, 139–140, 178–179, 81–82
   tests.rs100%100%100%100%
wardrobe/kitties/src
   lib.rs52.33%100%29.66%62.31%100–101, 105–109, 115–117, 121–122, 125–127, 131–134, 138–140, 142–143, 147–151, 174–175, 178–185, 188, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 354, 38, 386, 389, 39–40, 42–44, 449, 45–51, 54–56, 58–60, 64–68, 75–77, 79–81, 85–89, 96–98
   tests.rs99.61%100%98.25%99.78%
wardrobe/money/src
   lib.rs39.33%100%14.58%50.98%100, 103, 105, 107, 111, 114, 117, 175, 21–23, 32–34, 36–46, 50, 59–61, 63–65, 68–71, 75–77, 86–87, 90–97
   tests.rs100%100%100%100%
wardrobe/poe/src
   lib.rs0%100%0%0%100, 108–117, 121–122, 128–129, 134–143, 147–151, 153–154, 167–168, 173–179, 39, 52, 55, 57, 59, 61, 65, 84–86, 91–99
wardrobe/runtime_upgrade/src
   lib.rs0%100%0%0%100–102, 104–110, 114–118, 31, 33, 41,

@JoshOrndorff JoshOrndorff merged commit 3a1f2a7 into main Oct 18, 2023
6 checks passed
@JoshOrndorff JoshOrndorff deleted the joshy-serde-no-std branch October 18, 2023 02:53
@JoshOrndorff JoshOrndorff mentioned this pull request Nov 20, 2023
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.

1 participant