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

Added undelegation transactions to TabMyDelegation #1743

Merged
merged 19 commits into from
Jan 4, 2019

Conversation

sabau
Copy link
Contributor

@sabau sabau commented Dec 12, 2018

Description

  • Added the list of transactions related to unbound.
  • Changed the title of the unbounding validartor list
  • added title to the Active Validators list
  • refactored a the modifiers in the delegations store
  • updated e2e test

Graphical suggestions are really welcome :) I personally don't like the solution I pourpose here, but was a starting point to have the data ready by recycling the view.

An idea I had was to make the transacitons part of the table, so every transacitons will appear as subrow of the unbounding validator (eventually collapsable)

Closes #1387

Note

  • as this PR grew enough I think the redelegation will be a separate one

We should create a separate PR for that
❤️ Thank you!


  • Added entries in CHANGELOG.md with issue # and GitHub username
  • Reviewed Files changed in the github PR explorer
    screenshot 2018-12-13 at 13 26 11

@sabau sabau requested review from faboweb and nylira as code owners December 12, 2018 17:45
- setUnbondingDelegations now takes as input an array instead of doing that from outside

Signed-off-by: Karoly Albert Szabo <[email protected]>
@sabau sabau changed the title [WIP] Added undelegation transactions to TabMyDelegation Added undelegation transactions to TabMyDelegation Dec 13, 2018
@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #1743 into develop will decrease coverage by 0.05%.
The diff coverage is 91.66%.

@@             Coverage Diff             @@
##           develop    #1743      +/-   ##
===========================================
- Coverage     97.7%   97.65%   -0.06%     
===========================================
  Files          102      102              
  Lines         2093     2088       -5     
  Branches        93       93              
===========================================
- Hits          2045     2039       -6     
- Misses          39       40       +1     
  Partials         9        9
Impacted Files Coverage Δ
app/src/renderer/vuex/modules/delegation.js 100% <100%> (ø) ⬆️
...c/renderer/components/staking/TabMyDelegations.vue 93.75% <85.71%> (-6.25%) ⬇️

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #1743 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #1743      +/-   ##
===========================================
- Coverage    95.07%   95.06%   -0.01%     
===========================================
  Files          122      123       +1     
  Lines         2982     2978       -4     
  Branches       128      126       -2     
===========================================
- Hits          2835     2831       -4     
  Misses         137      137              
  Partials        10       10
Impacted Files Coverage Δ
.../src/renderer/components/staking/PageValidator.vue 98.75% <ø> (ø) ⬆️
...rer/components/transactions/TmLiAnyTransaction.vue 100% <ø> (ø) ⬆️
...rer/components/transactions/TmLiGovTransaction.vue 100% <ø> (ø) ⬆️
...c/renderer/components/staking/TabMyDelegations.vue 100% <100%> (ø) ⬆️
app/src/renderer/scripts/time.js 100% <100%> (ø)
app/src/renderer/vuex/modules/delegation.js 100% <100%> (ø) ⬆️
...rc/renderer/components/wallet/PageTransactions.vue 93.75% <100%> (-0.85%) ⬇️

@fedekunze
Copy link
Contributor

See my comment on #1387 (comment). Let's rename the tab to My Validators and change the the Delegated steak header from the second section to Unbonded steak so we can get rid of the unbonding tx.

@faboweb what do you think ?

@fedekunze
Copy link
Contributor

fedekunze commented Dec 13, 2018

@sabau had a cool idea about making a dropdown on the LiValidator component so when you click it, it displays the unbonding txs from that validator. Maybe we can implement that on another PR ?

@faboweb
Copy link
Collaborator

faboweb commented Dec 13, 2018

@sabau had a cool idea about making a dropdown on the LiValidator component so when you click it, it displays the unbonding txs from that validator.

sounds cool. but let's maybe sketch it first.

@@ -62,11 +62,13 @@ test(`delegation`, async function(t) {
t.test(`Stake`, async t => {
let totalAtoms = (await app.client
.$(`.header-balance .total-atoms h2`)
.getText()).split(`.`)[0] // 130.000...
.getText()).split(`.`)[0] // 30.000...
Copy link
Collaborator

Choose a reason for hiding this comment

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

huh? why is it suddenly 100 less?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think bonded atoms are not calculated in to the total atoms any longer. Needs to be fixed.

Copy link
Contributor Author

@sabau sabau Dec 14, 2018

Choose a reason for hiding this comment

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

Exaclty this point I was uncertain on how this changed!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Still an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed! 130.000 again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by replacing state.stuff = x with Vue.set(state, 'stuff', x)

@jbibla
Copy link
Collaborator

jbibla commented Dec 13, 2018

amazing work thank you @sabau!

@fedekunze we don't use the B (bond, unbond, bonding, unbonding) word, bud. 😉

making a dropdown on the LiValidator component so when you click it, it displays the unbonding txs from that validator.

very cool idea. i think i would prefer if we showed a link to the transaction on the transaction page as opposed to the actual tx component - but i can mock this up. either way, agreed - should be in a different PR.

data: () => ({
bondInfo: `Validators you are currently bonded to`,
unbondInfo: `Your bonded validators in unbonding process`
unbondInfo: `Your bonded validators in unbonding process`,
unbondTransactions: `The transactions currently in unbouding period`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
unbondTransactions: `The transactions currently in unbouding period`
unbondTransactions: `The transactions currently in unbonding period`

Copy link
Collaborator

Choose a reason for hiding this comment

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

#no-bonding ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

that's how the term is called, unbonding period. We agreed not to use bonding instead of delegation

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's just call it undelegation period?

@faboweb
Copy link
Collaborator

faboweb commented Dec 17, 2018

My proposal:

  • remove unbounding validators list
  • rename "unbounding transactions" to "undelegation transactions"
  • align transaction better with validator list
    (- maybe have a better list component that fits better with the table layout of the validator list)
  • create a followup issue about redesigning this view for multiple undelegations per vaidator

@fedekunze
Copy link
Contributor

My proposal:

  • remove unbonding delegations transactions
  • update LiValidator to show amount undelegated instead of delegated steak
  • rename My delegations to My validators, bc the first is inaccurate

@fedekunze
Copy link
Contributor

I vote NoWithVeto on showing the undelegation txs

@@ -33,32 +33,28 @@ export default ({ node }) => {
state.delegates = state.delegates.filter(c => c.id !== delegate)
},
setCommittedDelegation(state, { candidateId, value }) {
let committedDelegates = Object.assign({}, state.committedDelegates)
state.committedDelegates[candidateId] = value
Copy link
Collaborator

Choose a reason for hiding this comment

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

this may be why the total atoms do not update. Vue has sometimes a problem with checking updates on objects. the getter in getters.js is probably only updating when state.committedDelegates changes but only the properties of this change. Try using Vue.set(state.committedDelegates, candidateId, value).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh no back then I missed this comment! I just fixed this

@faboweb
Copy link
Collaborator

faboweb commented Dec 17, 2018

I vote NoWithVeto on showing the undelegation txs

no such thing as NoWithVeto here ;)

@faboweb
Copy link
Collaborator

faboweb commented Dec 17, 2018

remove unbonding delegations transactions

why?

update LiValidator to show amount undelegated instead of delegated steak

also an option, but if the 2 list items are too similar it could be confusing

rename My delegations to My validators, bc the first is inaccurate

I disagree, it's not only about your validators but also about the undelegations.

@sabau
Copy link
Contributor Author

sabau commented Dec 18, 2018

I think we should discuss this synchronously. I would like to answer and all together agree on those two questions:

  • What do we want to offer in this section exactly?
  • What the user would need from this section and why?
    • I think he needs to see a reaction from his delegation and undelegation actions (so the lists were OK)
    • Probably he wants to know where he put his atoms
    • I would like to know when I will have my atoms back
    • How the list should look depends on what he can do, as for now he can do a single undelegation per validator = we have a single validator with a single amount a single period to show
      • but we are working in the direction of allowing several, so probably I would choose to work already in that direction, and show several amounts with different periods per validator or just not grouped at all but ordered from the most recent to the oldest

@sabau
Copy link
Contributor Author

sabau commented Dec 18, 2018

Show just 2 list with minimal redisign until Staking 2

  • Get rid of liValidator 2 (unbounding validator)
  • make it nice

In Staking 2 group per validator the txs and we will decide the details there

  • working on design in staking 2!

sabau added 4 commits January 2, 2019 16:57
- adjust tests
- dirty fix: shares and shares_amount have to be fixed in the mock

Signed-off-by: Karoly Albert Szabo <[email protected]>
- fixed setCiommitedDelegation
- vue caveats for updated props not seen

Signed-off-by: Karoly Albert Szabo <[email protected]>
Signed-off-by: Karoly Albert Szabo <[email protected]>
- add Time helper to get min_time for unbonding transactions
- show only transactions in undelegation period

Signed-off-by: Karoly Albert Szabo <[email protected]>
@faboweb faboweb merged commit 8c78fe1 into develop Jan 4, 2019
@faboweb faboweb deleted the sabau/1387-unstaked-validator-list branch January 4, 2019 15:56
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.

4 participants