-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fabo/1199 improve jank at start (#1216)
* added native menu for versions * remove about from view * changelog * fixed tests * linted and simplified * remove more about code * show correct voting power * changelog * extracted keybase and throttle updates to localstorage * changelog * fixed wallet tests * fixed tests * fixed tests * added throttle tests * removed check if state has loaded, as we are filtering mutations * updated snapshots * skip loading validators at start * linted * fixed check for validators test * add in cart delegates to cache * fix moniker not showing * fix tests * fixed page bond test * add test for restoring committed delegations * handle issue with staking e2e tests * fixed current atoms in pagebond not being updated right away * changelog * fixed cache not restoring cart * increased coverage * fix showing undefined for bonding denom * fix staked indicator * changelog * fix wrong error showing on pagebond * changelog * removed querying for delegations after staking and relying on optimistic update * fixed bad test on pagebond * readded updating validators after staking * fixed back pagebond snapshot
- Loading branch information
Showing
27 changed files
with
364 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Submodule networks
added at
07c6bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import axios from "axios" | ||
|
||
export default ({}) => { | ||
const emptyState = { | ||
identities: {}, | ||
loading: false | ||
} | ||
const state = JSON.parse(JSON.stringify(emptyState)) | ||
|
||
const mutations = { | ||
setKeybaseIdentities(state, identities) { | ||
identities.forEach(identity => { | ||
state.identities[identity.keybaseId] = identity | ||
}) | ||
} | ||
} | ||
|
||
const actions = { | ||
async getKeybaseIdentity({ state }, keybaseId) { | ||
if (!/.{16}/.test(keybaseId)) return // the keybase id is not correct | ||
if (state.identities[keybaseId]) return // we already have this identity | ||
|
||
let urlPrefix = | ||
"https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=" | ||
let fullUrl = urlPrefix + keybaseId | ||
let json = await axios.get(fullUrl) | ||
if (json.data.status.name === "OK") { | ||
let user = json.data.them[0] | ||
if (user && user.pictures && user.pictures.primary) { | ||
return { | ||
keybaseId, | ||
avatarUrl: user.pictures.primary.url, | ||
userName: user.basics.username, | ||
profileUrl: "https://keybase.io/" + user.basics.username | ||
} | ||
} | ||
} | ||
}, | ||
async getKeybaseIdentities({ dispatch, commit }, validators) { | ||
return Promise.all( | ||
validators.map(async validator => { | ||
if (validator.description.identity) { | ||
return dispatch( | ||
"getKeybaseIdentity", | ||
validator.description.identity | ||
) | ||
} | ||
}) | ||
).then(identities => { | ||
commit("setKeybaseIdentities", identities.filter(x => !!x)) | ||
}) | ||
} | ||
} | ||
|
||
return { | ||
state, | ||
actions, | ||
mutations | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.