Skip to content

expose nullSliceAsEmptyEncoder amino field encoder #25222

@mhofman

Description

@mhofman

We've found that we needed to use the nullSliceAsEmptyEncoder for some of our own fields. Before 0.50 we used to rely on GetSignBytes to make sure nil slices are actually empty slices so the JSON encoder would write them as empty arrays ([]). The only way to replicate this behavior with the new amino json encoder seems to be a field encoder, but since nullSliceAsEmptyEncoder relies on a private marshalList, it's not possible to replicate it at the app layer. nullSliceAsEmptyEncoder is actually pretty generic and could be exposed publicly, or registered as a more generic field encoder name than legacy_coins.

Metadata

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