cli icon indicating copy to clipboard operation
cli copied to clipboard

docs(scavenge): convert message creator address from null `scavenge.Scavenger` breaks submit scavenge

Open WesJourdan opened this issue 4 years ago • 2 comments

A bug was introduced with here with PR #1645 and then fixed here with PR #2153, but there remains a related bug.

Now that the created scavenge looks like this: https://github.com/tendermint/starport/blob/1e3eee787a9024eb4ce318689142e4c5243fdea1/docs/guide/scavenge/07-keeper.md?plain=1#L33-L38

line 48 will always return an error because we're passing the null value scavenge.Scavenger https://github.com/tendermint/starport/blob/1e3eee787a9024eb4ce318689142e4c5243fdea1/docs/guide/scavenge/07-keeper.md?plain=1#L47-L48

causing this block to fail because scavenger is not a valid address https://github.com/tendermint/starport/blob/1e3eee787a9024eb4ce318689142e4c5243fdea1/docs/guide/scavenge/07-keeper.md?plain=1#L57-L61

Since we must pass the message Creator at line 48, the solution is to either re-add scavenge.Creator or pass msg.Creator directly.

I'm happy to submit a fix once it's decided how to proceed.

WesJourdan avatar Mar 16 '22 17:03 WesJourdan

Indeed, there is an issue in docs. I used msg.creator in msg_server_submit_scavenge.go and it works fine.

  scavenger, err := sdk.AccAddressFromBech32(msg.GetCreator())

nikoumba avatar Jun 13 '22 20:06 nikoumba

This issue has been fixed in #2632

jeronimoalbi avatar Jul 26 '22 14:07 jeronimoalbi