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

Ana/emoney-add multidenom rewards to tmbalance & livalidator #3559

Merged
merged 31 commits into from
Feb 20, 2020

Conversation

Bitcoinera
Copy link
Contributor

Closes #ISSUE

Description:

Making the necessary changes to accommodate multidenom rewards.

Please give me all the feedback you can come up with to improve the UI. (Remember that Mario's PR for big numbers will also be added)

The responsiveness is still really bad. It's a work in progress.

Thank you! 🚀


For contributor:

  • Added changes entries. Run yarn changelog for a guided process.
  • Reviewed Files changed in the github PR explorer
  • Attach screenshots of the UI components on the PR description (if applicable)
  • Scope of work approved for big PRs

For reviewer:

  • Manually tested the changes on the UI

@Bitcoinera Bitcoinera changed the title WIP: Ana/emoney-add multidenom rewards to tmbalance & livalidator Ana/emoney-add multidenom rewards to tmbalance & livalidator Feb 13, 2020
@Bitcoinera
Copy link
Contributor Author

OK, this is how it is going now. The only thing is that at the end I'm getting the pyramid (below 667px) but I don't know how to do this any way better... I mean, the scrolling how I had it was breaking the styles.

Maybe have the pyramid but just make the fonts for rewards smaller? What do you think?

Also need to look into the last bit, why is showing that strange margin on the right...

GIF:

Lunie-Simple-Staking-Wallet-Stak

@Bitcoinera
Copy link
Contributor Author

Hmm... not working for Terra 🤷‍♀

So probably not that good. Something is failing. Also still compatibility problems with other networks.

I will set it back to "WIP". Not ready yet.

@Bitcoinera Bitcoinera changed the title Ana/emoney-add multidenom rewards to tmbalance & livalidator WIP: Ana/emoney-add multidenom rewards to tmbalance & livalidator Feb 13, 2020
@Bitcoinera
Copy link
Contributor Author

Bitcoinera commented Feb 14, 2020

OK, this branch should be call now "multidenom-format-rewards" 😎

It's also going to include Terra and hopefully all the ones to come

Terra:

@Bitcoinera
Copy link
Contributor Author

OK, now it should be just the test missing and this one is good to go

.toString()
.concat(
this.isMultiDenomReward
? ` ${rewards[0].denom.slice(-3).toUpperCase()}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

who is TOM 😉

i don't think this is good logic. we don't need to change the denom.

Screen Shot 2020-02-14 at 8 42 32 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hahaha. Yes, I also saw this one. It is outdated though. I am not showing now any denom for single-denom networks. It is not needed.

src/scripts/common.js Outdated Show resolved Hide resolved
<h3>
{{
isMultiDenomReward
? `Total Rewards in ${stakingDenom}`
Copy link
Collaborator

@jbibla jbibla Feb 14, 2020

Choose a reason for hiding this comment

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

Suggested change
? `Total Rewards in ${stakingDenom}`
? `${stakingDenom} Rewards`

@Bitcoinera Bitcoinera changed the title WIP: Ana/emoney-add multidenom rewards to tmbalance & livalidator Ana/emoney-add multidenom rewards to tmbalance & livalidator Feb 15, 2020
@Bitcoinera
Copy link
Contributor Author

I call this one ready! 💪

@Bitcoinera
Copy link
Contributor Author

OK, maybe it is not so ready. The problem I'm having here is with styles of the positioning of alt-tokens in Desktop view.

You can see here if there are only a few it looks kind of weird:

image

Whereas if there are a lot of them it looks OK:

image

I am thinking of using some kind of "conditional" CSS

@Bitcoinera Bitcoinera mentioned this pull request Feb 18, 2020
4 tasks
@jbibla
Copy link
Collaborator

jbibla commented Feb 19, 2020

Let's merge this amazing PR @Bitcoinera!!

not as nice as charlie would make it — but totally great for now!

Screen Shot 2020-02-18 at 11 24 29 PM
Screen Shot 2020-02-18 at 11 24 40 PM
Screen Shot 2020-02-19 at 12 05 06 AM
Screen Shot 2020-02-19 at 12 04 54 AM
Screen Shot 2020-02-19 at 12 04 41 AM
Screen Shot 2020-02-19 at 12 05 23 AM

@Bitcoinera
Copy link
Contributor Author

OK, this one is definitely ready to go now!

Please somebody approve and merge and let's deliver 💪 !

@@ -124,6 +158,7 @@ export default {
ModalTutorial
},
filters: {
removeUFromMicroDenom,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this already tells me something is wrong. the UI should not have to handle micro denoms in views

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought I had deleted this one... but good that is signaling something wrong 👍

},
isMultiDenomReward() {
if (this.overview.rewards && this.overview.rewards.length > 0) {
return this.overview.rewards[0].denom !== this.overview.rewards[1].denom
Copy link
Collaborator

Choose a reason for hiding this comment

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

are multiple rewards with the same denom possible?

Copy link
Contributor Author

@Bitcoinera Bitcoinera Feb 19, 2020

Choose a reason for hiding this comment

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

yes, because of rewards from different validators.

But I don't like this logic either. This is why I want this PR luniehq/lunie-api#343 merged

EDIT: I will add a TODO here

Copy link
Collaborator

Choose a reason for hiding this comment

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

why does the overview query receive all rewards? doesn't only need a sum per denom?

rewards: [
{
amount: 1,
denom: `utoken1`
Copy link
Collaborator

Choose a reason for hiding this comment

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

here is the issue. you implemented the API wrong. the rewards need to be delivered in a view token

Copy link
Contributor Author

@Bitcoinera Bitcoinera Feb 20, 2020

Choose a reason for hiding this comment

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

Here I fix it: #351

I will change now tests

@faboweb faboweb merged commit e7cbcf0 into develop Feb 20, 2020
@faboweb faboweb deleted the ana/emoney-format-rewards branch February 20, 2020 13:52
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.

3 participants