diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d4d0bc999..4410a9744c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,13 +14,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* removed light theme option from preferences page @jbibla
* enabled staked balance on PageWallet in production @faboweb
* removed unused xmlhttprequest dependency @faboweb
-* LCD staking endpoints @fedekunze @faboweb
### Added
* storing balance, tx history and delegations locally to serve an old state faster @faboweb
* added error message for missing network config @faboweb
-* showing staking txs in history @faboweb
### Fixed
diff --git a/README.md b/README.md
index 177f200e7d..5309ac70d6 100644
--- a/README.md
+++ b/README.md
@@ -182,7 +182,7 @@ $ sed -i.bak 's/seeds = ""/seeds = "localhost"/g' ./builds/testnets/local-testne
Activate TX indexing in your local node:
```bash
-$ sed -i.bak 's/index_all_tags = false/index_all_tags = true/g' ~/.gaiad-testnet/config/config.toml
+$ sed -i.bak 's/index_all_tags = true/index_all_tags = false/g' ./builds/testnets/local-testnet/config.toml
```
Store the gaia version used in your local testnet:
diff --git a/app/src/renderer/components/common/AppHeader.vue b/app/src/renderer/components/common/AppHeader.vue
index 7c0a630be4..0e189ce8dc 100644
--- a/app/src/renderer/components/common/AppHeader.vue
+++ b/app/src/renderer/components/common/AppHeader.vue
@@ -44,7 +44,6 @@ export default {
document.documentElement.clientWidth,
window.innerWidth || 0
)
-
if (w >= 1024) {
this.close()
this.$store.commit("setConfigDesktop", true)
@@ -66,7 +65,6 @@ export default {
#app-header
z-index z(appHeader)
-
.container
-webkit-app-region drag
@@ -87,6 +85,7 @@ export default {
top 0
left 0
width 100%
+
background var(--app-bg)
> .container
@@ -104,6 +103,7 @@ export default {
align-items center
justify-content center
padding 0 1rem
+
color var(--link)
cursor pointer
@@ -131,7 +131,6 @@ export default {
border-bottom px solid var(--bc)
padding 2.5rem 1rem 1rem 1rem
line-height normal
-
img
height 1.75rem
diff --git a/app/src/renderer/components/staking/PageBond.vue b/app/src/renderer/components/staking/PageBond.vue
index 60fda33780..92c99c1970 100644
--- a/app/src/renderer/components/staking/PageBond.vue
+++ b/app/src/renderer/components/staking/PageBond.vue
@@ -152,17 +152,15 @@ export default {
ToolBar
},
computed: {
- ...mapGetters(["shoppingCart", "user", "delegation", "config"]),
+ ...mapGetters(["shoppingCart", "user", "committedDelegations", "config"]),
denom() {
return this.config.bondingDenom.toUpperCase()
},
totalAtoms() {
- return (
- parseInt(this.user.atoms) + this.oldBondedAtoms + this.oldUnbondingAtoms
- )
+ return parseInt(this.user.atoms) + this.oldBondedAtoms
},
oldBondedAtoms() {
- return Object.values(this.delegation.committedDelegates).reduce(
+ return Object.values(this.committedDelegations).reduce(
(sum, d) => sum + parseInt(d),
0
)
@@ -179,14 +177,6 @@ export default {
return atoms
}, this.oldUnbondedAtoms)
},
- oldUnbondingAtoms() {
- return Object.values(this.delegation.unbondingDelegations).reduce(
- (atoms, value) => {
- return atoms + value
- },
- 0
- )
- },
newUnbondingAtoms() {
return this.fields.delegates.reduce((atoms, d) => {
let delta = d.oldAtoms - d.atoms
@@ -194,7 +184,7 @@ export default {
return atoms + delta
}
return atoms
- }, this.oldUnbondingAtoms)
+ }, 0)
},
newUnbondingAtomsDelta() {
return this.delta(this.newUnbondingAtoms, 0)
@@ -257,7 +247,7 @@ export default {
}
},
resetFields() {
- let committedDelegations = this.delegation.committedDelegates
+ let committedDelegations = this.committedDelegations
let totalAtoms = this.totalAtoms
this.fields.bondConfirm = false
this.fields.delegates = this.shoppingCart.map(c =>
diff --git a/app/src/renderer/components/wallet/PageTransactions.vue b/app/src/renderer/components/wallet/PageTransactions.vue
index 546fbc1d1a..8bd0958c92 100644
--- a/app/src/renderer/components/wallet/PageTransactions.vue
+++ b/app/src/renderer/components/wallet/PageTransactions.vue
@@ -9,19 +9,14 @@ tm-page(title='Transactions')
modal-search(type="transactions" v-if="somethingToSearch")
tm-data-loading(v-if="wallet.historyLoading")
- data-empty-tx(v-else-if='allTransactions.length === 0')
+ data-empty-tx(v-else-if='transactions.length === 0')
data-empty-search(v-else-if="filteredTransactions.length === 0")
- template(v-else v-for="i in filteredTransactions")
- tm-li-transaction(
- v-if="i.type === 'wallet'"
- :key="shortid.generate()"
- :transaction="i"
- :address="wallet.address")
- tm-li-staking-transaction(
- v-if="i.type === 'staking'"
- :key="shortid.generate()"
- :transaction="i"
- :address="wallet.address")
+ tm-li-transaction(
+ v-else
+ v-for="i in filteredTransactions"
+ :key="shortid.generate()"
+ :transaction="i"
+ :address="wallet.address")
diff --git a/app/src/renderer/components/wallet/TmLiStakingTransaction.vue b/app/src/renderer/components/wallet/TmLiStakingTransaction.vue
deleted file mode 100644
index e557cb4ddc..0000000000
--- a/app/src/renderer/components/wallet/TmLiStakingTransaction.vue
+++ /dev/null
@@ -1,160 +0,0 @@
-
-.tm-li-tx(v-if="type === 'cosmos-sdk/MsgDelegate'" @click="() => devMode && viewTransaction()")
- .tx-icon: i.material-icons remove_circle
- .tx-container
- .tx-element.tx-coins
- .tx-coin
- .key {{ tx.delegation.denom.toUpperCase() }}
- .value {{ pretty(tx.delegation.amount) }}
- div
- .tx-element.tx-date(v-if="devMode") {{ date }}
- .tx-element.tx-address Staked to {{ tx.validator_addr }}
-
-.tm-li-tx.tm-li-tx-sent(v-else-if="type === 'cosmos-sdk/BeginUnbonding'" @click="() => devMode && viewTransaction()")
- .tx-icon: i.material-icons add_circle
- .tx-container
- .tx-element.tx-coins
- .tx-coin
- .key STEAK
- .value {{ pretty(tx.shares_amount) }}
- div
- .tx-element.tx-date(v-if="devMode") {{ date }}
- .tx-element.tx-address Started unbonding from {{ tx.validator_addr }}
-
-
-
-
-
diff --git a/app/src/renderer/components/wallet/TmLiTransaction.vue b/app/src/renderer/components/wallet/TmLiTransaction.vue
deleted file mode 100644
index 57e8f15a0a..0000000000
--- a/app/src/renderer/components/wallet/TmLiTransaction.vue
+++ /dev/null
@@ -1,219 +0,0 @@
-
-mixin tx-container-sent
- .tx-container
- .tx-element.tx-coins
- .tx-coin(v-for='coin in coinsSent')
- .key {{ coin.denom.toUpperCase() }}
- .value {{ pretty(coin.amount) }}
- div
- .tx-element.tx-date(v-if="devMode") {{ date }}
- .tx-element.tx-address(v-if="!sentSelf") Sent to {{ receiver }}
- .tx-element.tx-address(v-if="sentSelf") You sent this amount to yourself.
-.tm-li-tx(v-if="sentSelf" @click="() => devMode && viewTransaction()")
- .tx-icon: i.material-icons swap_horiz
- +tx-container-sent
-
-.tm-li-tx.tm-li-tx-sent(v-else-if="sent" @click="() => devMode && viewTransaction()")
- .tx-icon: i.material-icons remove_circle
- +tx-container-sent
-
-.tm-li-tx.tm-li-tx-received(v-else @click="() => devMode && viewTransaction()")
- .tx-icon: i.material-icons add_circle
- .tx-container
- .tx-element.tx-coins
- .tx-coin(v-for='coin, key in coinsReceived' :key="key")
- .key {{ coin.denom.toUpperCase() }}
- .value {{ pretty(coin.amount) }}
- div
- .tx-element.tx-date(v-if="devMode") {{ date }}
- .tx-element.tx-address Received from {{ sender }}
-
-
-
-
-
diff --git a/app/src/renderer/connectors/lcdClient.js b/app/src/renderer/connectors/lcdClient.js
index 75974d5ec1..79d470fbd0 100644
--- a/app/src/renderer/connectors/lcdClient.js
+++ b/app/src/renderer/connectors/lcdClient.js
@@ -90,64 +90,12 @@ Object.assign(Client.prototype, {
},
tx: argReq("GET", "/txs"),
- /* ============ STAKE ============ */
-
- // Get all delegations information from a delegator
- getDelegator: function(addr) {
- return req("GET", `/stake/delegators/${addr}`).call(this)
- },
- // Get all txs from a delegator
- getDelegatorTxs: function(addr, types) {
- if (!types) {
- return req("GET", `/stake/delegators/${addr}/txs`).call(this)
- } else {
- return req("GET", `/stake/delegators/${addr}/txs?type=${types}`).call(
- this
- )
- }
- },
- // // Query all validators that a delegator is bonded to
- // getDelegatorValidators: function(delegatorAddr) {
- // return req("GET", `/stake/delegators/${delegatorAddr}/validators`).call(this)
- // },
- // // Query a validator info that a delegator is bonded to
- // getDelegatorValidator: function(delegatorAddr, validatorAddr) {
- // return req("GET", `/stake/delegators/${delegatorAddr}/validators/${validatorAddr}`).call(this)
- // },
-
- // Get a list containing all the validator candidates
- getCandidates: req("GET", "/stake/validators"),
- // Get information from a validator
- getCandidate: function(addr) {
- return req("GET", `/stake/validators/${addr}`).call(this)
- },
- // // Get all of the validator bonded delegators
- // getValidatorDelegators: function(addr) {
- // return req("GET", `/stake/validator/${addr}/delegators`).call(this)
- // },
-
- // Get the list of the validators in the latest validator set
- getValidatorSet: req("GET", "/validatorsets/latest"),
-
- updateDelegations: function(delegatorAddr, data) {
- return req("POST", `/stake/delegators/${delegatorAddr}/delegations`).call(
- this,
- data
- )
- },
-
- // Query a delegation between a delegator and a validator
- queryDelegation: function(delegatorAddr, validatorAddr) {
- return req(
- "GET",
- `/stake/delegators/${delegatorAddr}/delegations/${validatorAddr}`
- ).call(this)
- },
- queryUnbonding: function(delegatorAddr, validatorAddr) {
- return req(
- "GET",
- `/stake/delegators/${delegatorAddr}/unbonding_delegations/${validatorAddr}`
- ).call(this)
+ // staking
+ updateDelegations: req("POST", "/stake/delegations"),
+ candidates: req("GET", "/stake/validators"),
+ getValidators: req("GET", "/validatorsets/latest"),
+ queryDelegation: function(delegator, validator) {
+ return req("GET", `/stake/${delegator}/delegation/${validator}`).call(this)
}
})
diff --git a/app/src/renderer/connectors/lcdClientMock.js b/app/src/renderer/connectors/lcdClientMock.js
index d5ccf0dcd7..a995f0ceb8 100644
--- a/app/src/renderer/connectors/lcdClientMock.js
+++ b/app/src/renderer/connectors/lcdClientMock.js
@@ -48,7 +48,6 @@ let state = {
value: {
msg: [
{
- type: "cosmos-sdk/Send",
value: {
inputs: [
{
@@ -85,7 +84,6 @@ let state = {
value: {
msg: [
{
- type: "cosmos-sdk/Send",
value: {
inputs: [
{
@@ -120,15 +118,12 @@ let state = {
],
stake: {
[addresses[0]]: {
- delegations: [
- {
- delegator_addr: addresses[0],
- validator_addr: validators[0],
- shares: "14",
- height: 123
- }
- ],
- unbonding_delegations: []
+ [validators[0]]: {
+ delegator_addr: addresses[0],
+ validator_addr: validators[0],
+ shares: "130",
+ height: 123
+ }
}
},
candidates: [
@@ -241,8 +236,8 @@ module.exports = {
)
})
},
- async tx(hash) {
- return state.txs.find(tx => tx.hash === hash)
+ async tx() {
+ return {}
},
async send(to, req) {
let fromKey = state.keys.find(a => a.name === req.name)
@@ -259,10 +254,7 @@ module.exports = {
},
// staking
- async updateDelegations(
- delegatorAddr,
- { name, sequence, delegations, begin_unbondings }
- ) {
+ async updateDelegations({ name, sequence, delegations, begin_unbondings }) {
let results = []
let fromKey = state.keys.find(a => a.name === name)
@@ -302,15 +294,10 @@ module.exports = {
// update stake
let delegator = state.stake[fromKey.address]
if (!delegator) {
- state.stake[fromKey.address] = {
- delegations: [],
- unbonding_delegations: []
- }
+ state.stake[fromKey.address] = {}
delegator = state.stake[fromKey.address]
}
- let delegation = delegator.delegations.find(
- d => d.validator_addr === tx.validator_addr
- )
+ let delegation = delegator[tx.validator_addr]
if (!delegation) {
delegation = {
delegator_addr: fromKey.address,
@@ -318,9 +305,8 @@ module.exports = {
shares: "0",
height: 0
}
- delegator.delegations.push(delegation)
+ delegator[tx.validator_addr] = delegation
}
-
let shares = parseInt(delegation.shares)
delegation.shares = (shares + amount).toString()
@@ -330,7 +316,6 @@ module.exports = {
parseInt(candidate.delegator_shares) + amount
).toString()
- storeTx("cosmos-sdk/MsgDelegate", tx)
results.push(txResult(0))
}
@@ -349,9 +334,7 @@ module.exports = {
results.push(txResult(2, "Nonexistent delegator"))
return results
}
- let delegation = delegator.delegations.find(
- d => d.validator_addr === tx.validator_addr
- )
+ let delegation = delegator[tx.validator_addr]
if (!delegation) {
results.push(txResult(2, "Nonexistent delegation"))
return results
@@ -362,59 +345,26 @@ module.exports = {
let candidate = state.candidates.find(c => c.owner === tx.validator_addr)
shares = parseInt(candidate.tokens)
candidate.tokens = (+shares - amount).toString()
- delegator.unbonding_delegations.push(
- Object.assign({}, tx, {
- balance: {
- amount: tx.shares
- }
- })
- )
- storeTx("cosmos-sdk/BeginUnbonding", tx)
results.push(txResult(0))
}
return results
},
async queryDelegation(delegatorAddress, validatorAddress) {
- let delegator = state.stake[delegatorAddress]
- if (!delegator) return {}
- return delegator.delegations.find(
- ({ validator_addr }) => validator_addr === validatorAddress
- )
- },
- async queryUnbonding(delegatorAddress, validatorAddress) {
let delegator = state.stake[delegatorAddress]
if (!delegator) return
- return delegator.unbonding_delegations.find(
- d => d.validator_addr === validatorAddress
- )
- },
- // Get all delegations information from a delegator
- getDelegator(delegatorAddress) {
- let delegator = state.stake[delegatorAddress] || {}
- return delegator
- },
- getDelegatorTxs(addr, types = []) {
- if (types.length === 0) types = ["bonding", "unbonding"]
- types = types.map(type => {
- if (type === "bonding") return "cosmos-sdk/MsgDelegate"
- if (type === "unbonding") return "cosmos-sdk/BeginUnbonding"
- })
- return getTxs(types)
+ return delegator[validatorAddress]
},
- async getCandidates() {
+ async candidates() {
return state.candidates
},
- async getValidatorSet() {
+ async getValidators() {
return {
block_height: 1,
validators: state.candidates
}
},
- async getCandidate(addr) {
- return state.candidates.find(c => c.owner === addr)
- },
// exports to be used in tests
state,
addresses,
@@ -485,52 +435,43 @@ function send(to, from, req) {
}
// log tx
- storeTx("cosmos-sdk/Send", {
- inputs: [
- {
- coins: req.amount,
- address: from
- }
- ],
- outputs: [
- {
- coins: req.amount,
- address: to
- }
- ]
- })
-
- // if receiver is bot address, send money back
- if (to === botAddress) {
- send(from, botAddress, {
- amount: req.amount,
- sequence: state.accounts[botAddress].sequence
- })
- }
-
- return txResult(0)
-}
-
-function storeTx(type, body) {
state.txs.push({
tx: {
value: {
msg: [
{
- type,
- value: body
+ value: {
+ inputs: [
+ {
+ coins: req.amount,
+ address: from
+ }
+ ],
+ outputs: [
+ {
+ coins: req.amount,
+ address: to
+ }
+ ]
+ }
}
]
}
},
hash: makeHash(),
- height: getHeight(),
+ height: getHeight() + (from === botAddress ? 1 : 0),
time: Date.now()
})
-}
-function getTxs(types) {
- return state.txs.filter(tx => types.indexOf(tx.tx.value.msg[0].type) !== -1)
+ // if receiver is bot address, send money back
+ if (to === botAddress) {
+ send(from, botAddress, {
+ amount: req.amount,
+ sequence: state.accounts[botAddress].sequence
+ })
+ }
+
+ return txResult(0)
}
// function delegate (sender, { pub_key: { data: pubKey }, amount: delegation }) {
diff --git a/app/src/renderer/vuex/getters.js b/app/src/renderer/vuex/getters.js
index 78a1832cdf..a310805974 100644
--- a/app/src/renderer/vuex/getters.js
+++ b/app/src/renderer/vuex/getters.js
@@ -17,7 +17,6 @@ export const transactions = state => state.wallet.history
export const wallet = state => state.wallet
// staking
-export const delegation = state => state.delegation
export const committedDelegations = state => state.delegation.committedDelegates
export const delegates = state => state.delegates
export const shoppingCart = state => state.delegation.delegates
diff --git a/app/src/renderer/vuex/modules/delegates.js b/app/src/renderer/vuex/modules/delegates.js
index 2ef8eca4a5..ab16ae8a83 100644
--- a/app/src/renderer/vuex/modules/delegates.js
+++ b/app/src/renderer/vuex/modules/delegates.js
@@ -38,16 +38,16 @@ export default ({ node }) => {
},
async getDelegates({ state, commit }) {
commit("setDelegateLoading", true)
- let candidates = await node.getCandidates()
- let { validators } = await node.getValidatorSet()
- for (let delegate of candidates) {
+ let delegates = await node.candidates()
+ let { validators } = await node.getValidators()
+ for (let delegate of delegates) {
if (validators.find(v => v.pub_key === delegate.pub_key)) {
delegate.isValidator = true
}
commit("addDelegate", delegate)
}
- commit("setDelegates", candidates)
+ commit("setDelegates", delegates)
commit("setDelegateLoading", false)
return state.delegates
diff --git a/app/src/renderer/vuex/modules/delegation.js b/app/src/renderer/vuex/modules/delegation.js
index 404d90eb16..6e51c627b6 100644
--- a/app/src/renderer/vuex/modules/delegation.js
+++ b/app/src/renderer/vuex/modules/delegation.js
@@ -6,9 +6,7 @@ export default ({ node }) => {
delegates: [],
// our delegations which are already on the blockchain
- committedDelegates: {},
- unbondingDelegations: {},
- delegationTxs: []
+ committedDelegates: {}
}
const mutations = {
@@ -38,18 +36,6 @@ export default ({ node }) => {
committedDelegates[candidateId] = value
}
state.committedDelegates = committedDelegates
- },
- setUnbondingDelegations(state, { candidateId, value }) {
- let unbondingDelegations = Object.assign({}, state.unbondingDelegations)
- if (value === 0) {
- delete unbondingDelegations[candidateId]
- } else {
- unbondingDelegations[candidateId] = value
- }
- state.unbondingDelegations = unbondingDelegations
- },
- setDelegationTxs(state, txs) {
- state.delegationTxs = txs
}
}
@@ -60,44 +46,36 @@ export default ({ node }) => {
}
},
// load committed delegations from LCD
- async getBondedDelegates(
- { state, rootState, commit, dispatch },
- candidates
- ) {
+ async getBondedDelegates({ state, rootState, dispatch }, candidates) {
state.loading = true
let address = rootState.user.address
candidates = candidates || (await dispatch("getDelegates"))
- let delegator = await node.getDelegator(address)
- if (delegator.delegations) {
- delegator.delegations.forEach(({ validator_addr, shares }) => {
- commit("setCommittedDelegation", {
- candidateId: validator_addr,
- value: parseFloat(shares)
+ await Promise.all(
+ candidates.map(candidate =>
+ dispatch("getBondedDelegate", {
+ delegator: address,
+ validator: candidate.owner
})
- if (shares > 0) {
- const delegate = candidates.find(
- ({ owner }) => owner === validator_addr // this should change to address instead of owner
- )
- commit("addToCart", delegate)
- }
- })
- }
- if (delegator.unbonding_delegations) {
- delegator.unbonding_delegations.forEach(
- ({ validator_addr, balance: { amount } }) => {
- commit("setUnbondingDelegations", {
- candidateId: validator_addr,
- value: parseFloat(amount)
- })
- }
)
- }
+ )
state.loading = false
},
- async getDelegationTxs({ commit, rootState }) {
- let address = rootState.user.address
- let txs = await node.getDelegatorTxs(address)
- commit("setDelegationTxs", txs)
+ // load committed delegation from LCD
+ async getBondedDelegate({ commit, rootState }, { delegator, validator }) {
+ let bond = await node.queryDelegation(delegator, validator)
+
+ let shares = bond ? bond.shares : 0
+ let delegate = rootState.delegates.delegates.find(
+ d => d.owner === validator
+ )
+
+ commit("setCommittedDelegation", {
+ candidateId: validator,
+ value: shares
+ })
+ if (shares > 0) {
+ commit("addToCart", delegate)
+ }
},
async updateDelegates({ dispatch }) {
let candidates = await dispatch("getDelegates")
@@ -139,7 +117,6 @@ export default ({ node }) => {
await dispatch("sendTx", {
type: "updateDelegations",
- to: rootState.wallet.address, // TODO strange syntax
delegations: delegate,
begin_unbondings: unbond
})
diff --git a/app/src/renderer/vuex/modules/node.js b/app/src/renderer/vuex/modules/node.js
index ea585e6370..39f0b781b0 100644
--- a/app/src/renderer/vuex/modules/node.js
+++ b/app/src/renderer/vuex/modules/node.js
@@ -36,7 +36,7 @@ export default function({ node }) {
}
const actions = {
- async setLastHeader({ state, rootState, dispatch }, header) {
+ setLastHeader({ state, rootState, dispatch }, header) {
state.lastHeader = header
// TODO do this somewhere else probably
@@ -44,7 +44,7 @@ export default function({ node }) {
rootState.wallet.zoneIds.unshift(header.chain_id)
}
- await dispatch("maybeUpdateValidators", header)
+ dispatch("maybeUpdateValidators", header)
},
async reconnect({ commit }) {
if (state.stopConnecting) return
diff --git a/app/src/renderer/vuex/modules/user.js b/app/src/renderer/vuex/modules/user.js
index 60a37e9b63..391643beca 100644
--- a/app/src/renderer/vuex/modules/user.js
+++ b/app/src/renderer/vuex/modules/user.js
@@ -109,7 +109,7 @@ export default ({ node }) => {
let { address } = await node.getKey(account)
state.address = address
- commit("loadPersistedState", { address, password })
+ commit("loadPersistedState", { account, password })
commit("setModalSession", false)
dispatch("initializeWallet", address)
dispatch("loadErrorCollection", account)
diff --git a/app/src/renderer/vuex/modules/validators.js b/app/src/renderer/vuex/modules/validators.js
index f74bfa7dfd..198e8de8ce 100644
--- a/app/src/renderer/vuex/modules/validators.js
+++ b/app/src/renderer/vuex/modules/validators.js
@@ -20,24 +20,25 @@ export default ({ node }) => {
dispatch("getValidators")
}
},
- async getValidators({ state, commit }) {
+ getValidators({ state, commit }) {
state.loading = true
- try {
- let validators = (await node.getValidatorSet()).validators
+ node.rpc.validators((err, { validators } = {}) => {
+ if (err) {
+ commit("notifyError", {
+ title: "Error fetching validator set",
+ body: err.message
+ })
+ return
+ }
commit("setValidators", validators)
- } catch (err) {
- commit("notifyError", {
- title: "Error fetching validator set",
- body: err.message
- })
- }
- state.loading = false
+ state.loading = false
+ })
},
- async maybeUpdateValidators({ state, commit, dispatch }, header) {
+ maybeUpdateValidators({ state, commit, dispatch }, header) {
let validatorHash = header.validators_hash
if (validatorHash === state.validatorHash) return
commit("setValidatorHash", validatorHash)
- await dispatch("getValidators")
+ dispatch("getValidators")
}
}
diff --git a/app/src/renderer/vuex/modules/wallet.js b/app/src/renderer/vuex/modules/wallet.js
index e7ceb8624e..b6e513a852 100644
--- a/app/src/renderer/vuex/modules/wallet.js
+++ b/app/src/renderer/vuex/modules/wallet.js
@@ -69,7 +69,7 @@ export default ({ node }) => {
},
queryWalletState({ dispatch }) {
dispatch("queryWalletBalances")
- // dispatch("queryWalletHistory") // is done on mounting transactions
+ dispatch("queryWalletHistory")
},
async queryWalletBalances({ state, rootState, commit }) {
let res = await node.queryAccount(state.address)
diff --git a/app/src/renderer/vuex/store.js b/app/src/renderer/vuex/store.js
index 1ca4037985..6c6fa9a9ce 100644
--- a/app/src/renderer/vuex/store.js
+++ b/app/src/renderer/vuex/store.js
@@ -47,11 +47,11 @@ function persistState(state) {
state.user.password
)
// Store the state object as a JSON string
- localStorage.setItem("store_" + state.user.address, encryptedState)
+ localStorage.setItem("store_" + state.user.account, encryptedState)
}
-function loadPersistedState(state, { address, password }) {
- const cachedState = localStorage.getItem("store_" + address)
+function loadPersistedState(state, { account, password }) {
+ const cachedState = localStorage.getItem("store_" + account)
if (cachedState) {
const bytes = CryptoJS.AES.decrypt(cachedState, password)
const plaintext = bytes.toString(CryptoJS.enc.Utf8)
diff --git a/tasks/build/Gaia/COMMIT.sh b/tasks/build/Gaia/COMMIT.sh
index f097f53326..61800138c4 100755
--- a/tasks/build/Gaia/COMMIT.sh
+++ b/tasks/build/Gaia/COMMIT.sh
@@ -2,4 +2,4 @@
# This is the commit of the SDK version to use for building Gaia. We use an
# explicit hash instead of a tag so we don't have to trust GitHub.
-export COMMIT=6d95d1cef47ec6806fba26e17ac63c7d387bb771
+export COMMIT=23e3d5ac12145c02fcb4b4767d7dfccad782aee5
diff --git a/test/e2e/launch.js b/test/e2e/launch.js
index 41e9524a91..1683776d15 100644
--- a/test/e2e/launch.js
+++ b/test/e2e/launch.js
@@ -253,9 +253,6 @@ function initLocalNode() {
const localnodeProcess = spawn(command, { shell: true })
localnodeProcess.stderr.pipe(process.stderr)
- // the init command now asks for a password for some default account we don't need
- localnodeProcess.stdin.write("\n")
-
localnodeProcess.stdout.once("data", data => {
let msg = data.toString()
diff --git a/test/unit/helpers/vuex-setup.js b/test/unit/helpers/vuex-setup.js
index b6c971a5e7..7fe8d0ae87 100644
--- a/test/unit/helpers/vuex-setup.js
+++ b/test/unit/helpers/vuex-setup.js
@@ -16,7 +16,7 @@ export default function vuexSetup() {
function init(
componentConstructor,
testType = shallow,
- { stubs, getters = {}, propsData, methods, doBefore = () => {} } // doBefore receives router and store
+ { stubs, getters = {}, propsData, doBefore = () => {} } // doBefore receives router and store
) {
const node = Object.assign({}, require("../helpers/node_mock"))
const modules = Modules({ node })
@@ -58,8 +58,7 @@ export default function vuexSetup() {
store,
router,
stubs,
- propsData,
- methods
+ propsData
})
}
}
@@ -68,24 +67,22 @@ export default function vuexSetup() {
localVue,
shallow: (
componentConstructor,
- { stubs, getters, propsData, methods, doBefore } = {}
+ { stubs, getters, propsData, doBefore } = {}
) =>
init(componentConstructor, shallow, {
stubs,
getters,
propsData,
- methods,
doBefore
}),
mount: (
componentConstructor,
- { stubs, getters, propsData, methods, doBefore } = {}
+ { stubs, getters, propsData, doBefore } = {}
) =>
init(componentConstructor, mount, {
stubs,
getters,
propsData,
- methods,
doBefore
})
}
diff --git a/test/unit/specs/__snapshots__/lcdClient.spec.js.snap b/test/unit/specs/__snapshots__/lcdClient.spec.js.snap
index 767113f074..72925727b2 100644
--- a/test/unit/specs/__snapshots__/lcdClient.spec.js.snap
+++ b/test/unit/specs/__snapshots__/lcdClient.spec.js.snap
@@ -1,53 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`LCD Client queries for a candidate 1`] = `
-Array [
- Array [
- "http://localhost:8998/stake/validators/abc",
- undefined,
- ],
-]
-`;
-
-exports[`LCD Client queries for a delegation summary for a delegator 1`] = `
-Array [
- Array [
- "http://localhost:8998/stake/delegators/abc",
- undefined,
- ],
-]
-`;
-
-exports[`LCD Client queries for a delegation txs 1`] = `
-Array [
- Array [
- "http://localhost:8998/stake/delegators/abc/txs",
- undefined,
- ],
- Array [
- "http://localhost:8998/stake/delegators/abc/txs?type=bonding",
- undefined,
- ],
- Array [
- "http://localhost:8998/stake/delegators/abc/txs?type=unbonding",
- undefined,
- ],
-]
-`;
-
exports[`LCD Client queries for shares for a validator and delegate 1`] = `
Array [
Array [
- "http://localhost:8998/stake/delegators/abc/delegations/efg",
- undefined,
- ],
-]
-`;
-
-exports[`LCD Client queries for undelegations between a delegator and a validator 1`] = `
-Array [
- Array [
- "http://localhost:8998/stake/delegators/abc/unbonding_delegations/def",
+ "http://localhost:8998/stake/abc/delegation/efg",
undefined,
],
]
diff --git a/test/unit/specs/__snapshots__/lcdClientMock.spec.js.snap b/test/unit/specs/__snapshots__/lcdClientMock.spec.js.snap
index 3028ce00dc..cd6a39cd30 100644
--- a/test/unit/specs/__snapshots__/lcdClientMock.spec.js.snap
+++ b/test/unit/specs/__snapshots__/lcdClientMock.spec.js.snap
@@ -2,10 +2,10 @@
exports[`LCD Client Mock delegates to multiple validators at once 1`] = `"10"`;
-exports[`LCD Client Mock delegates to multiple validators at once 2`] = `"24"`;
+exports[`LCD Client Mock delegates to multiple validators at once 2`] = `"140"`;
exports[`LCD Client Mock deletes keys 1`] = `[Error: Passwords do not match]`;
-exports[`LCD Client Mock queries bondings per delegator 1`] = `"14"`;
+exports[`LCD Client Mock queries bondings per delegator 1`] = `"130"`;
exports[`LCD Client Mock updates keys 1`] = `[Error: Passwords do not match]`;
diff --git a/test/unit/specs/components/common/AppHeader.spec.js b/test/unit/specs/components/common/AppHeader.spec.js
index 0da3326809..d03615efe3 100644
--- a/test/unit/specs/components/common/AppHeader.spec.js
+++ b/test/unit/specs/components/common/AppHeader.spec.js
@@ -8,7 +8,8 @@ describe("AppHeader", () => {
beforeEach(() => {
instance = mount(AppHeader, {
- stubs: { "app-menu": "