Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow AddressData to be properly serialized using Amino #680

Merged
merged 3 commits into from
Nov 24, 2021

Conversation

RiccardoM
Copy link
Contributor

@RiccardoM RiccardoM commented Nov 24, 2021

Description

This PR fixes a bug that currently makes it impossible to properly serialize an AddressData value using Amino.

Currently the AddressData interface has two implementations that are serialized as follows when using Amino:

  • Base32Address
    {
      "prefix": "",
      "value": ""
    }
  • Bech58Address
    {
      "value": ""
    }

However, since it is an interface, it should have been registered properly and should be serialized as follow:

  • Base32Address
    {
      "type": "desmos/Bech32Address",
      "value": {
        "prefix": "",
        "value": ""
      }
    }
  • Base58Address
    {
      "type": "desmos/Base58Address",
      "value": {
        "value": ""
      }
    }

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@github-actions github-actions bot added the x/profiles Module that allows to create and manage decentralized social profiles label Nov 24, 2021
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@RiccardoM RiccardoM marked this pull request as ready for review November 24, 2021 10:49
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@codecov
Copy link

codecov bot commented Nov 24, 2021

Codecov Report

Merging #680 (c902dbc) into master (90aa668) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #680   +/-   ##
=======================================
  Coverage   15.77%   15.78%           
=======================================
  Files         169      169           
  Lines       46033    46037    +4     
=======================================
+ Hits         7263     7267    +4     
  Misses      38143    38143           
  Partials      627      627           
Impacted Files Coverage Δ
x/profiles/types/codec.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90aa668...c902dbc. Read the comment docs.

@leobragaz
Copy link
Contributor

I guess this is needed if we want to use ledger to create chain-links right�? @RiccardoM

@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Nov 24, 2021
@mergify mergify bot merged commit f29f9c2 into master Nov 24, 2021
@mergify mergify bot deleted the riccardo/fix-amino branch November 24, 2021 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass x/profiles Module that allows to create and manage decentralized social profiles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants