Code Monkey home page Code Monkey logo

Comments (3)

Imod7 avatar Imod7 commented on September 14, 2024 1

Will this "simply" add a new field pending to the endpoint response? If that is the case, is this pending rewards information not available (doing a bit of local computation) in current and previous versions of the staking pallet? This way we would have a stable output format.

No, my intention was not to modify the endpoints' responses as soon as pending_rewards goes live, only to check if it can be used to simplify the internal calculations in our endpoints. The reason I added this issue was more of a tracker issue to re iterate through the logic as soon as it is available. It could potentially make the code simpler and more efficient.

Based on this comment for example, the response under claimed will now be something like this:

"claimedRewards": [
      {
        "era": "1322",
        "status": "claimed"
      },
      {
        "era": "1323",
        "status": "unclaimed"
      },
      {
        "era": "1324",
        "status": "partially claimed"
      },

which is calculated by currently comparing the results from 3 calls and quite a few if else statements. So if pending_rewards can be used to reduce this, maybe it is worth re iterating. Wdyt?

Note: I updated the More Info section in the Description to give some more context.

from substrate-api-sidecar.

IkerAlus avatar IkerAlus commented on September 14, 2024 1

So if pending_rewards can be used to reduce this, maybe it is worth re iterating. Wdyt?

Yes, that total makes sense. Bear in mind that this will simplify the logic from the relevant spec version onwards, but for previous ones, we will still need to maintain the more complex logic as introduced by #1445

from substrate-api-sidecar.

IkerAlus avatar IkerAlus commented on September 14, 2024

Will this "simply" add a new field pending to the endpoint response? If that is the case, is this pending rewards information not available (doing a bit of local computation) in current and previous versions of the staking pallet? This way we would have a stable output format.

from substrate-api-sidecar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.