-
Notifications
You must be signed in to change notification settings - Fork 98
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
Delegration (Delegation integration) #110
Conversation
a0b7704
to
969732b
Compare
I implemented the delegation vuex logic (fetching candidates from API and building txs when delegating) on top of the mock API, so this PR should be ready. Most of the delegation behavior will be inaccessible until we have a way to sign in, which should happen soon with @jolesbi's welcome screen. Other than some minor UI polish and a way to persist the delegation data in a JSON file, I think we've developed the delegation stuff as far as we can until we wait for the backend to solidify. |
5f4b698
to
c5eb1f4
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.
Nice proxy solution!
|
||
const CANDIDATE_INTERVAL = 1000 // update every second | ||
function pubkeyToString (pubkey) { | ||
let type = pubkey.type === 'ed25519' ? '01' : '02' |
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.
This would benefit from a comment I think.
|
||
console.log('new candidate', candidate) | ||
state.push(candidate) | ||
} | ||
} | ||
|
||
const actions = { | ||
async getCandidates ({ commit }) { |
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.
here you want "dispatch" instead of "commit" as of line 26
app/src/main/index.js
Outdated
log('baseserver ready') | ||
log('gaia server ready') | ||
|
||
if (!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.
Should we maybe introduce a flag "MOCK"?
app/src/renderer/node.js
Outdated
@@ -6,7 +6,8 @@ const RpcClient = require('tendermint') | |||
let sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) | |||
|
|||
module.exports = async function (nodeIP) { | |||
let rest = RestClient() | |||
// TODO: once we're done with the mock API server, switch this from port 8999 to 8998 | |||
let rest = RestClient('http://localhost:8999') |
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.
And maybe use the "MOCK" flag here to so we can't forget about it.
sorting doesn't work for the candidates list |
the name of this PR is 💯 |
@nylira I'm not sure how to get sorting working with this setup, could you help? It looks like the |
Looking great Matt! @mappum I'll get sorting working in a different PR. |
* new e2e flow * changelog * updated security critical deps * remove workspace * forgot to checkout the repo * correct cache key && cache app deps * install deps for e2e tets * update chromedriver * use npm in machine * don't use yarn in machine on ci * correct screenshot settings * remove experimental flags * working tests * fixed test * old lunie still serves with https * switch lunie to feature branch * fixed missing network and updated lunie * linted * fixed build script * use yarn.lock as cache key * use script from package.json * merge develop * use local url in tests * fix tests by importing the correct account instead of creating one * switch to working e2e extension branch * fix tests * wait for element to be present * skip moving to portfolio * switched to latest branches * switch submodule to master * switched to master branch fro lunie * force master checkout * security update
Resolves #24
Sets up a mock API server, with a mocked delegation API which can be un-mocked as soon as it becomes stable. I'm still in the process of integrating the vuex delegation logic with this mock API.