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

Better map UtxoErrors to Substrate's InvalidTransaction type #214

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

JoshOrndorff
Copy link
Contributor

substrate requires this InvalidTransaction enum. But it is pretty closely tied to FRAME.

Before this PR Tuxedo just mapped all UtxoErrors to InvalidTransaction::Custom(0). While there is no really great option, this PR at least maps the few variants that are covered, and provides a unique custom number when for the ones that are not.

@JoshOrndorff JoshOrndorff changed the title Better map UtxoErrors to Substrate's `InvalidTransaction type Better map UtxoErrors to Substrate's InvalidTransaction type Apr 22, 2024
Copy link

Coverage after merging better-error-handling into main will be

60.83%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
tuxedo-core/aggregator/src
   lib.rs99.14%100%100%99.10%201, 22, 84
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.rs36.56%100%26.67%38.46%117–125, 127–129, 131–136, 138–147, 149, 151–153, 167, 196–200, 203–208, 211–212
   dynamic_typing.rs92.11%100%75%95.31%56
   executive.rs91.45%100%91.49%91.45%100, 129, 155, 195, 227, 252, 270, 285, 324, 355, 390–395, 397, 407–408, 410–411, 413, 416–417, 420, 422–423, 426–427, 429, 433–454, 456, 460–461, 463–467, 469, 472–489, 57
   inherents.rs0%100%0%0%121–123, 134, 139–146, 150–157, 164–178, 180–182, 184–202, 204–234, 236–241, 56–58, 68–70, 76–80, 83, 85
   types.rs51.81%100%26.67%57.35%100–103, 105–108, 110–116, 159, 173, 175, 177, 208–209, 211–212, 224, 231–236, 240–245, 29, 52, 68–75, 99
   utxo_set.rs90.91%100%100%88.89%39–40
   verifier.rs51.52%100%35.29%57.14%106–108, 43–44, 46, 48–49, 54, 71, 78–80, 82–84, 92
tuxedo-core/src/genesis
   block_builder.rs0%100%0%0%30–43, 54, 56–59, 61–64, 66–68, 71–75, 77–79, 81–93
   config_builder.rs0%100%0%0%24–32, 34, 36–45, 47–49, 52–59, 62–63
tuxedo-core/src/verifier
   htlc.rs88.93%100%56.25%93%107, 109, 115, 40, 55, 74–78, 91
   multi_signature.rs89.64%100%75%91.41%100–105, 21, 32–37, 45, 71
   simple_signature.rs74.77%100%50%79.57%32, 39–43, 53–55, 65, 78–82
tuxedo-parachain-core/parachainify/src
   lib.rs61.16%100%100%60.17%100–110, 14, 16, 39–42, 56, 66, 72–99
tuxedo-parachain-core/src
   collation_api.rs0%100%0%0%18–39
   lib.rs34.48%100%33.33%35%141, 86–91, 95–97
   relay_state_snapshot.rs0%100%0%0%128–140, 147–155, 157, 173–188, 193–202, 204–211, 223, 225, 227–233, 235–240, 242, 245–250, 252–257, 259–271, 274–286, 292–298, 303–310, 316–323, 330–337, 346–354, 362–370, 378–383, 389–394, 41, 54
   tests.rs100%100%100%100%
tuxedo-parachain-runtime/src
   genesis.rs0%100%0%0%20–46, 48–50
   lib.rs0%100%0%0%100–101, 104–210, 53–58, 64, 71, 80–99
tuxedo-template-runtime/src
   genesis.rs0%100%0%0%25–41, 43–45
   lib.rs0%100%0%0%111–112, 114–116, 120–122, 126–128, 138–139, 141, 143, 145, 147, 149, 151, 153, 155, 158, 160, 165, 174–195, 198–225, 228–352, 58–63, 94–99
wallet/src
   amoeba.rs0%100%0%0%100–117, 120–121, 123–129, 131–138, 20–22, 24, 26, 28–59, 62–63, 65–99
   cli.rs0%100%0%0%104, 123, 129, 137, 148, 154, 20, 22, 31, 36, 41, 45, 69, 81
   keystore.rs0%100%0%0%30–33, 38–46, 49, 51–57, 63–71, 74–76, 78–80, 83–89, 91–92
   main.rs0%100%0%0%100–211, 214–221, 224–227, 229–231, 234–236, 238, 240, 243–249, 252–265, 268–269, 27, 270–271, 273–279, 28, 280–284, 286, 29–99
   money.rs0%100%0%0%100–101, 104–122, 126–132, 138–145, 147, 151–156, 160, 163, 165, 168–173, 175–176, 180–181, 183, 186, 189–194, 199–205, 207–211, 214–215, 219–224, 226–227, 23, 230–239, 24, 240–241, 243, 245, 25–29, 31, 33, 35–39, 41–56, 58–59, 63–76, 79–89, 91, 93, 95–99
   parachain.rs0%100%0%0%16, 18–19, 25–32, 37–39
   rpc.rs0%100%0%0%15–20, 23–28, 30–38, 41–47, 49–52, 54–55
   sync.rs0%100%0%0%100–105, 107, 109, 114–119, 123–126, 133–134, 136, 139–142, 147–149, 152–153, 156–161, 163–165, 168, 170–171, 176–179, 182–183, 190–194, 196–202, 205–207, 209–210, 213–214, 219–222, 225, 227–228, 233–236, 239, 241–242, 245–251, 253–254, 257–258, 261–262, 265–266, 270–277, 280, 283, 285, 287–289, 292, 294, 298, 300–301, 304–305, 308–315, 317–318, 321–322, 324, 326–327, 331–333, 335–336, 338–339, 341–342, 345–347, 349–350, 352–353, 355–356, 360, 362, 365–366, 370, 372–377, 380–381, 384–386, 389, 392–395,

@JoshOrndorff JoshOrndorff merged commit 0bd3fca into main Apr 23, 2024
6 checks passed
@JoshOrndorff JoshOrndorff deleted the better-error-handling branch April 23, 2024 13:14
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