Skip to content

types.ChainAnteDecorators() flaws #5741

Closed
@alessio

Description

While I've been writing test cases for the package types, I stumble upon a couple of small issues with sdk.ChainAnteDecorators():

  1. When the chain argument is an empty slice, the function panics. The godoc comment does not mention such a case.
  2. The second if clause never evaluates true:
    if len(chain) == 1 {

    When len(chain) == 1 a Terminator had already been appended in the previous if block.

Wrt 1, there are two solutions:

  • let it panic and mention this case in the documentation
  • just fix return nil when len(chain) == 0 and add a godoc line. This would be an ABI breakage (i.e. a change in function's semantic), though I think it's not a big deal.

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions