-
Notifications
You must be signed in to change notification settings - Fork 120
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
Integrate ticket auto buyer #2577
Conversation
a273f81
to
b797422
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks neat, left some minors.
app/actions/VSPActions.js
Outdated
}); | ||
const signature = await dispatch(getTicketSignature(tickethash, request, passphrase)); | ||
// host here needs "http://" or "https://". When sending it to dcrwallet it can not have. | ||
const host = "https://teststakepool.decred.org" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint
@@ -1,7 +1,6 @@ | |||
import { Creatable } from "react-select"; | |||
import Select from "react-select"; | |||
import { FormattedMessage as T, injectIntl, defineMessages } from "react-intl"; | |||
import { newStakePool } from "connectors"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔪
app/components/inputs/VSPSelect.js
Outdated
@@ -3,10 +3,10 @@ import { injectIntl, defineMessages } from "react-intl"; | |||
import { useState } from "react"; | |||
import * as vspa from "actions/VSPActions"; | |||
import { useDispatch } from "react-redux"; | |||
import { base64ToHex } from "helpers"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint
@@ -1,4 +1,3 @@ | |||
import ticketAutoBuyer from "connectors/ticketAutoBuyer"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔪
defaultSpendingAccount, | ||
// spendingAccounts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
</div> | ||
<div className="stakepool-autobuyer-input"> | ||
<AccountsSelect | ||
{...{ account }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{...{ account }} | |
account={account} |
@@ -0,0 +1,60 @@ | |||
import { substruct, compose, eq, get } from "fp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linting
|
||
const onStopAutoBuyer = () => onDisableTicketAutoBuyer(); | ||
|
||
// TODO remove this - using to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder ;)
app/middleware/vspapi.js
Outdated
// stakepPoolInfoResponseToConfig converts a response object for the | ||
// stakePoolInfo call into an object array of available stakepool configs. | ||
function stakepPoolInfoResponseToConfig(response) { | ||
const stakePoolNames = Object.keys(response.data); | ||
// TODO remove this json. | ||
// used to test with localhost and teststakepool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder to remove
app/middleware/vspapi.js
Outdated
name | ||
]; | ||
return !APIEnabled ? null : { Host: URL, Network, APIVersionsSupported }; | ||
}) | ||
.filter((v) => v); | ||
// const stakePoolNames = Object.keys(response.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments
b797422
to
772a0c5
Compare
772a0c5
to
57fb347
Compare
da8272e
to
d654d5e
Compare
d68aee9
to
480cca4
Compare
480cca4
to
86b5909
Compare
…hich failed to process
b9e4d6f
to
846fb30
Compare
This PR depends on decred/dcrwallet#1786
it starts integrating the ticket autobuyer into decrediton using the new vsp.
It still a WIP because right now because we need to hard code responses in order to get new VSPs. This can be fixed after decred/dcrwebapi#104 is merged.