Skip to content

AppendTags usage issue in x/staking/handler.go #4273

Closed
@cryptophonic

Description

Summary of Bug

Mark [12:06 PM]
in x/staking/handler.go there are a couple sections of code that looks like:

           resTags.AppendTags(sdk.NewTags(
                   tags.Action, tags.ActionCompleteUnbonding,
                   tags.Delegator, dvPair.DelegatorAddress.String(),
                   tags.SrcValidator, dvPair.ValidatorAddress.String(),
           ))

this code will have no effect on resTags itself because AppendTags() returns its result and does not modify its base object. Should be:

           resTags = resTags.AppendTags(sdk.NewTags(
                   tags.Action, tags.ActionCompleteUnbonding,
                   tags.Delegator, dvPair.DelegatorAddress.String(),
                   tags.SrcValidator, dvPair.ValidatorAddress.String(),
           ))

Zaki Manian [12:08 PM]
yes that's a bug
Make a PR?

Mark[12:08 PM]
yup will do

Version

Latest SDK code - master branch

Steps to Reproduce

N/A code review produce the issue, confirmed with Zaki


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions