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 accountless ticket purchasing #22

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JoeGruffins
Copy link
Member

depends on #7, #18
closes #16

Together with the api/purchaseticket endpoint, allows for ticket purchases without creating an account.
see: decred/dcrstakepool#515

pr 515 there is currently running on my testnet vsp at www.dcrstakedinner.com, that vsp has also been hardcoded into the list of vsp's

Right now, the same address is used for every request, but we could easily use a new one for every ticket, which would make tracking user tickets much more difficult.

screens

addprovider
accounts

pydecred/vsp.py Outdated
@@ -140,6 +150,8 @@ def __init__(self, url, apiKey):
# The signingAddress (also called a votingAddress in other contexts) is
# the P2SH 1-of-2 multi-sig address that spends SSTX outputs.
self.signingAddress = None
self.isAccountless = isAccountless
self.ID = ID
Copy link
Member Author

Choose a reason for hiding this comment

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

using an incremented id to track pools, rather than the api key, as accountless has none

"""
self.app.appWindow.pop(self)
self.poolScreen.isAccountless = True
self.poolScreen.refreshAccountless()
self.app.appWindow.stack(self.poolScreen)
Copy link
Member Author

Choose a reason for hiding this comment

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

these click events are tricky, wasn't sure how to pass a variable, so made a separate event for accountless, though seems wasteful

if len(self.stakePools) > 0:
pool.ID = max([p.ID for p in self.stakePools]) + 1
self.stakePools = [pool] + [p for p in self.stakePools if p.ID !=
pool.ID]
Copy link
Member Author

Choose a reason for hiding this comment

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

Separated add and set because accountless should have different data to set each time we buy a ticket whenever we start to derive a new address for every ticket.

When connecting to dcrdata, pull down the current agendas for use when
voting.
Add a screen to show current agendas and a dropdown menu to choose how
to vote.
Save a reference to the drowdown in the function that fires when
activated. Move agendasInfo back to dcrdata blockchain.
If a vsp has APIVersionsSupported 3 allow accountless ticket
purchasing for that pool.
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.

Add accountless ticket purchasing.
1 participant