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

Revert "Fedekunze/1010 lcd stake" #1120

Merged
merged 2 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions app/src/renderer/components/common/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export default {
document.documentElement.clientWidth,
window.innerWidth || 0
)

if (w >= 1024) {
this.close()
this.$store.commit("setConfigDesktop", true)
Expand All @@ -66,7 +65,6 @@ export default {

#app-header
z-index z(appHeader)

.container
-webkit-app-region drag

Expand All @@ -87,6 +85,7 @@ export default {
top 0
left 0
width 100%

background var(--app-bg)

> .container
Expand All @@ -104,6 +103,7 @@ export default {
align-items center
justify-content center
padding 0 1rem

color var(--link)
cursor pointer

Expand Down Expand Up @@ -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
</style>
20 changes: 5 additions & 15 deletions app/src/renderer/components/staking/PageBond.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -179,22 +177,14 @@ 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
if (delta > 0) {
return atoms + delta
}
return atoms
}, this.oldUnbondingAtoms)
}, 0)
},
newUnbondingAtomsDelta() {
return this.delta(this.newUnbondingAtoms, 0)
Expand Down Expand Up @@ -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 =>
Expand Down
57 changes: 11 additions & 46 deletions app/src/renderer/components/wallet/PageTransactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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")
</template>

<script>
Expand All @@ -32,15 +27,12 @@ import Mousetrap from "mousetrap"
import DataEmptySearch from "common/TmDataEmptySearch"
import DataEmptyTx from "common/TmDataEmptyTx"
import ModalSearch from "common/TmModalSearch"
import { TmPage, TmDataLoading } from "@tendermint/ui"
import TmLiTransaction from "./TmLiTransaction"
import TmLiStakingTransaction from "./TmLiStakingTransaction"
import { TmPage, TmDataLoading, TmLiTransaction } from "@tendermint/ui"
import ToolBar from "common/TmToolBar"
export default {
name: "page-transactions",
components: {
TmLiTransaction,
TmLiStakingTransaction,
TmDataLoading,
DataEmptySearch,
DataEmptyTx,
Expand All @@ -49,37 +41,12 @@ export default {
ToolBar
},
computed: {
...mapGetters([
"filters",
"transactions",
"wallet",
"config",
"delegation"
]),
...mapGetters(["filters", "transactions", "wallet", "config"]),
somethingToSearch() {
return !this.wallet.historyLoading && !!this.allTransactions.length
},
allTransactions() {
return [].concat(
this.transactions.map(t => {
t.type = "wallet"
return t
}),
this.delegation.delegationTxs.map(t => {
t.type = "staking"
return t
})
)
return !this.wallet.historyLoading && !!this.transactions.length
},
orderedTransactions() {
return orderBy(
this.allTransactions.map(t => {
t.height = parseInt(t.height)
return t // TODO what happens if block height is bigger then int?
}),
[this.sort.property],
[this.sort.order]
)
return orderBy(this.transactions, [this.sort.property], [this.sort.order])
},
filteredTransactions() {
let query = this.filters.transactions.search.query
Expand All @@ -103,7 +70,6 @@ export default {
methods: {
refreshTransactions() {
this.$store.dispatch("queryWalletHistory")
this.$store.dispatch("getDelegationTxs")
},
setSearch(bool = !this.filters["transactions"].search.visible) {
if (!this.somethingToSearch) return false
Expand All @@ -113,7 +79,6 @@ export default {
mounted() {
Mousetrap.bind(["command+f", "ctrl+f"], () => this.setSearch(true))
Mousetrap.bind("esc", () => this.setSearch(false))
this.refreshTransactions()
}
}
</script>
160 changes: 0 additions & 160 deletions app/src/renderer/components/wallet/TmLiStakingTransaction.vue

This file was deleted.

Loading