Skip to content

Fetching staker from stakerId is duplicated. #932

Description

@ashish10677

Rationale

Staker value is fetched in https://github.com/razor-network/razor-go/blob/33bdf45d066526da1eaa2ac4da8e7f92e5d2f7e2/cmd/vote.go#L154

But while calling HandleCommit it is again fetched, increasing the number of RPC call.
https://github.com/razor-network/razor-go/blob/33bdf45d066526da1eaa2ac4da8e7f92e5d2f7e2/cmd/vote.go#L279

This can be avoided if we pass staker instead of stakerId to the HandleCommit function.

Implementation

Pass staker instead of stakerId and modify the HandleCommit function accordingly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code cleanupImprovements to make the code clean and more readable.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions