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

multi: add accounts screen #94

Merged
merged 6 commits into from Mar 5, 2020
Merged

Conversation

buck54321
Copy link
Member

Step 1 of a few to implement full account functionality through the UI. Refactors a lot of UI code and simplifies the Wallet API. Also adds a SimpleWallet type, which is a single-account Decred wallet.

Adds an account selection screen. Right now, there is still only one account available, and no option to create more. That will follow in the next step.

@buck54321 buck54321 force-pushed the accountsui branch 2 times, most recently from 6ecb6da to 2aef091 Compare February 29, 2020 21:06
decred/decred/config.py Show resolved Hide resolved
decred/decred/wallet/wallet.py Show resolved Hide resolved
decred/decred/wallet/wallet.py Show resolved Hide resolved
tinywallet/tinywallet/screens.py Show resolved Hide resolved
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -93,5 +93,4 @@ def chain(coinType):
Returns:
obj: Network parameters.
"""
coinType = parseCoinType(coinType)
return _chains[coinType] if coinType in _chains else None
return _chains.get(parseCoinType(coinType), None)
Copy link
Member

Choose a reason for hiding this comment

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

default is None, but verbose is ok with me too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd rather omit it.

Comment on lines 2 to 3
Copyright (c) 2019, Brian Stafford
Copyright (c) 2019, The Decred developers
Copy link
Member

Choose a reason for hiding this comment

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

2020

decred/decred/wallet/simple.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@teknico teknico left a comment

Choose a reason for hiding this comment

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

As mentioned in my #53 review, this large pull requests are hard to review. Could we keep them smaller, ideally under 500 lines total?

One way could be to only change either decred or tinywallet code in each PR. If the change in the decred API would break tinywallet, and we want to keep master working at all times, one would include the bare minimum of tinywallet changes to keep it working, but reserve larger code changes to a dedicated tinywallet PR.

Also: much new code using os.path. I thought we agreed that pathlib.Path was the better alternative?

decred/decred/dcr/account.py Show resolved Hide resolved
decred/decred/dcr/account.py Show resolved Hide resolved
@@ -93,5 +93,4 @@ def chain(coinType):
Returns:
obj: Network parameters.
"""
coinType = parseCoinType(coinType)
return _chains[coinType] if coinType in _chains else None
return _chains.get(parseCoinType(coinType), None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd rather omit it.

decred/decred/wallet/accounts.py Outdated Show resolved Hide resolved
decred/decred/wallet/simple.py Outdated Show resolved Hide resolved
decred/decred/wallet/wallet.py Show resolved Hide resolved
decred/decred/wallet/wallet.py Show resolved Hide resolved
tinywallet/tinywallet/app.py Show resolved Hide resolved
tinywallet/tinywallet/app.py Show resolved Hide resolved
tinywallet/tinywallet/screens.py Outdated Show resolved Hide resolved
@buck54321
Copy link
Member Author

I switched to pathlib.Path for the code in decred, but not yet in tinywallet. Qt expects strings, and Path doesn't serialize for the configuration file. Punting for now.

As far as PR size, you point is well taken, but it's not always going to work out quite so clean and neat, especially as we hack out basic features. I only mention it because there are likely some large and far-reaching PRs coming up that are certain to be over 500 loc diff. If you're not comfortable putting your stamp on something because it's too big, which is totally understandable, just give me a heads up.

Copy link
Collaborator

@teknico teknico left a comment

Choose a reason for hiding this comment

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

Thanks for the changes.

Step 1 of a few to implement full account functionality through
the UI. Refactors a lot of UI code and simplifies the Wallet
API. Also adds a SimpleWallet type, which is a single-account Decred
wallet.

Adds an account selection screen. Right now, there is still only
one account available, and no option to create more. That will
follow in the next step.
@buck54321 buck54321 force-pushed the accountsui branch 2 times, most recently from a466343 to ea68e2e Compare March 5, 2020 11:52
if not oldThread.isFinished():
if not oldThread.completed:
Copy link
Member Author

Choose a reason for hiding this comment

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

Relying on the finished signal here was problematic for recursively created threads with connection type Qt.DirectConnection. We are less interested in whether the QThread.run method has completed, and more interested in whether the callback function has been called.

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.

None yet

3 participants