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

Websockets - subscribe to votes #1908

Merged
merged 4 commits into from
Apr 18, 2019

Conversation

guilhermelawless
Copy link
Contributor

@guilhermelawless guilhermelawless commented Apr 18, 2019

Related: #1901 .

{
  "topic": "vote",
  "time": "1554995525343",
  "message": {
    "account": "xrb_1n5aisgwmq1oibg8c7aerrubboccp3mfcjgm8jaas1fwhxmcndaf4jrt75fy",
    "signature": "1950700796914893705657789944906107642480343124305202910152471520450456881722545967829502369630995363643731706156278026749554294222131169148120786048025353",
    "sequence": "855471574",
    "blocks": [
      "6FB9DE5D7908DEB8A2EA391AEA95041587CBF3420EF8A606F1489FECEE75C869"
    ]
  }
}

Added the ability to filter by representative as well, very similarly to the other filtering options. I think this one has no performance penalties, just a O(1) search in an unordered_set.

A good filter would also be rebroadcasting_only or a minimum weight. What do you think?

@cryptocode cryptocode added documentation This item indicates the need for or supplies updated or expanded documentation enhancement websockets labels Apr 18, 2019
@cryptocode cryptocode added this to the V19.0 milestone Apr 18, 2019
Copy link
Contributor

@clemahieu clemahieu left a comment

Choose a reason for hiding this comment

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

Great feature, this is going to be far, far better than vote log parsing.

{
// Do not insert the given raw data to keep old prefix support
representatives.insert (result_l.to_account ());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we log if the account doesn't decode correctly? It seems like on a type-o someone could be confused as to why it's not working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah makes more sense to log, thanks! Also logging if the resulting filter is empty.

Note to change documentation which warned about this.

@guilhermelawless
Copy link
Contributor Author

So, for now, have only representatives as a filter if you agree.

Updated documentation WebSockets.zip

Copy link
Contributor

@cryptocode cryptocode left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@SergiySW SergiySW left a comment

Choose a reason for hiding this comment

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

Looking good

@cryptocode cryptocode merged commit 1e09b14 into nanocurrency:master Apr 18, 2019
@cryptocode
Copy link
Contributor

@guilhermelawless guilhermelawless deleted the websockets/votes branch April 19, 2019 07:23
@zhyatt zhyatt removed the documentation This item indicates the need for or supplies updated or expanded documentation label Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants