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

Integrate ticket auto buyer #2577

Merged
merged 37 commits into from
Oct 19, 2020
Merged

Conversation

vctt94
Copy link
Member

@vctt94 vctt94 commented Jul 14, 2020

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.

@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from a273f81 to b797422 Compare July 21, 2020 20:31
Copy link
Member

@amass01 amass01 left a 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.

});
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"
Copy link
Member

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";
Copy link
Member

Choose a reason for hiding this comment

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

🔪

@@ -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";
Copy link
Member

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";
Copy link
Member

Choose a reason for hiding this comment

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

🔪

defaultSpendingAccount,
// spendingAccounts,
Copy link
Member

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 }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{...{ account }}
account={account}

@@ -0,0 +1,60 @@
import { substruct, compose, eq, get } from "fp";
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

reminder ;)

// 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
Copy link
Member

Choose a reason for hiding this comment

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

reminder to remove

name
];
return !APIEnabled ? null : { Host: URL, Network, APIVersionsSupported };
})
.filter((v) => v);
// const stakePoolNames = Object.keys(response.data);
Copy link
Member

Choose a reason for hiding this comment

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

comments

@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from b797422 to 772a0c5 Compare July 28, 2020 20:09
@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from 772a0c5 to 57fb347 Compare August 5, 2020 22:01
@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from da8272e to d654d5e Compare August 20, 2020 15:34
@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from d68aee9 to 480cca4 Compare October 15, 2020 15:32
@vctt94 vctt94 changed the title [wip] Integrate ticket auto buyer Integrate ticket auto buyer Oct 15, 2020
@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from 480cca4 to 86b5909 Compare October 15, 2020 15:45
@vctt94 vctt94 force-pushed the integrate-ticket-auto-buyer branch from b9e4d6f to 846fb30 Compare October 17, 2020 21:36
@alexlyp alexlyp merged commit 2521c90 into decred:master Oct 19, 2020
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.

3 participants