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

implement --tmp and --dev for wallet #135

Merged
merged 5 commits into from
Nov 7, 2023
Merged

implement --tmp and --dev for wallet #135

merged 5 commits into from
Nov 7, 2023

Conversation

muraca
Copy link
Collaborator

@muraca muraca commented Nov 2, 2023

closes #133

  • default key Shawn is not included in the keystore anymore
    image1
  • it is only included when the --dev arg is set
    image2
  • arg --tmp will clear the data folder at the end. --dev enables --tmp under the hood.
    image3

I also improved some documentation here and there, mostly added verbatim_doc_comment to show the entire doc comment and support newlines.
image4

Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca muraca self-assigned this Nov 2, 2023
Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca
Copy link
Collaborator Author

muraca commented Nov 2, 2023

@JoshOrndorff I think data-path might be refactored to path, I think data doesn't give any useful information.

Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall great work. A couple little comments, but I trust you to address them (or not) as you see fit. Merge when ready.

  1. I was thinking that Alice was the default/development key and SHAWN was only used in one or two places. Can you just double check that you got the right one.

  2. What are the differences in the way the docs are rendered now? Ideally that would go in a separate PR. For example, in case there is some little bug in --dev and we want to revert it. We would not want to also revert the doc changes. But not a big deal in this case.

  3. Looks like we upped the sleep time from 10s to 20s in the CI. Was 10 not long enough?

Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed something.

When we specify --tmp we need to generate a new random path and use it for the run, and clean it up at the end. The current PR does not generate a new random path. It just relies on the existing methods to choose the path.

This is dangerous because someone could have a "real" wallet that they hold real funds in. And they don't want to be purging all of it's data. They may also do some development work and want to use --tmp for the dev work. We would not want this person to simply add --tmp to the cli and accidentally purge their real data.

If you really like the existing semantics, I think a better flag name would be --purge-when-done or similar. But I like the idea to generate a random path better because that's exactly what Substrate does.

@muraca
Copy link
Collaborator Author

muraca commented Nov 6, 2023

  1. I was thinking that Alice was the default/development key and SHAWN was only used in one or two places. Can you just double check that you got the right one.

Looks like Alice is never used in the wallet, Shawn is the default development key and it is also used in the template runtime.

  1. What are the differences in the way the docs are rendered now?

New lines are respected, allowing some longer descriptions to be displayed correctly.
I get your point, but it's both a small change and something clearly stated in the PR description, I think if one ever had to revert the PR they would notice and maybe apply the changes elsewhere.

  1. Looks like we upped the sleep time from 10s to 20s in the CI. Was 10 not long enough?

It was barely enough to kickstart the node, but not to produce any blocks. I should mention it in the changelog in the PR description as well.

When we specify --tmp we need to generate a new random path and use it for the run

I agree. I'll proceed with that.

Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca
Copy link
Collaborator Author

muraca commented Nov 6, 2023

/// Wallet data is just keystore at the moment, but will contain a local database of UTXOs in the future.

Is this comment still relevant?
As far as I understood from reading the code, it is not, but I wanted to double check before removing it.

Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right. That comment is outdated and should be removed.

Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca muraca merged commit ac4bf26 into main Nov 7, 2023
6 checks passed
@muraca muraca deleted the wallet-tmp-dev branch November 7, 2023 09:09
Copy link

github-actions bot commented Nov 7, 2023

Coverage after merging wallet-tmp-dev into main will be

63.32%

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%103, 108, 119, 125, 14, 17, 19, 28, 33, 38, 45, 56, 68, 91
   keystore.rs0%100%0%0%31–33, 38–45, 47–48, 51, 53–59, 65–73, 76–78, 80–82, 85–91, 93–94
   main.rs0%100%0%0%100–102, 107–108, 110–111, 114–126, 129, 131–135, 138–142, 144–153, 155–156, 160–170, 173–174, 176, 179–180, 182, 184, 186–189, 191–193, 195, 200–206, 208–211, 213–214, 217–224, 227–230, 232–234, 237–239, 241, 243, 246–252, 255–268, 271–274, 276–287, 289, 34–38, 41, 44–46, 48–49, 52, 54, 56–57, 61, 64–70, 73, 75–77, 82–85, 87, 89, 91–92, 95–96, 98
   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&nd

JoshOrndorff added a commit that referenced this pull request May 16, 2024
JoshOrndorff added a commit that referenced this pull request May 18, 2024
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.

Wallet: Add command to clear all data
2 participants