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

feat: ADR-009: Make MsgSaveProfile DTag optional #651

Merged
merged 9 commits into from
Oct 18, 2021

Conversation

leobragaz
Copy link
Contributor

@leobragaz leobragaz commented Oct 14, 2021

Description

This PR implements what's described inside ADR-009.
Closes: #622 .


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)

Avoid DTag override
@github-actions github-actions bot added x/CLI x/profiles Module that allows to create and manage decentralized social profiles labels Oct 14, 2021
@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #651 (ac86b7d) into master (1a22342) will decrease coverage by 68.54%.
The diff coverage is 37.70%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #651       +/-   ##
===========================================
- Coverage   84.23%   15.69%   -68.55%     
===========================================
  Files          91      168       +77     
  Lines        6624    45944    +39320     
===========================================
+ Hits         5580     7211     +1631     
- Misses        833    38117    +37284     
- Partials      211      616      +405     
Impacted Files Coverage Δ
app/desmos/cmd/chainlink/create_json.go 61.29% <ø> (+0.63%) ⬆️
x/profiles/client/cli/cli_app_links.go 34.16% <ø> (ø)
x/profiles/client/cli/cli_chain_links.go 85.84% <ø> (ø)
x/profiles/client/cli/cli_dtag_requests.go 81.89% <ø> (ø)
x/profiles/client/cli/cli_params.go 70.00% <ø> (ø)
x/profiles/client/cli/cli_relationships.go 75.51% <ø> (ø)
x/profiles/client/cli/query.go 0.00% <ø> (ø)
x/profiles/client/cli/tx.go 0.00% <ø> (ø)
x/profiles/client/utils/cli.pb.go 3.12% <ø> (ø)
x/profiles/client/utils/utils.go 56.25% <ø> (ø)
... and 197 more

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 a6af985...ac86b7d. Read the comment docs.

Copy link
Contributor

@dadamu dadamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, but I think there should be a test in msgServer.SaveProfile to confirm that Updating a profile with DTag [do-not-modify] does not update its value and returns no error.

@RiccardoM RiccardoM changed the title feat: ADR-009 implementation: Avoid accidental override of DTag feat: ADR-009: Avoid accidental override of DTag Oct 15, 2021
Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I agree with @dadamu that it appears there are some tests missing, particularly those with UpdateProfile. Also, linting is failing right now

added test case to ensure that DTag are not edited if DoNotModify placeholder is passed
Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test case (if necessary) to the TestProfile_Update function as well? If you think it's not necessary then it's ok

x/profiles/keeper/msgs_server_profile_test.go Outdated Show resolved Hide resolved
@leobragaz
Copy link
Contributor Author

Can you please add a test case (if necessary) to the TestProfile_Update function as well? If you think it's not necessary then it's ok

This test should be enough and match what you've asked

let update the other fields without error.
Fixed tests
@RiccardoM
Copy link
Contributor

@bragaz Please add the missing changeset entry

@RiccardoM RiccardoM changed the title feat: ADR-009: Avoid accidental override of DTag feat: ADR-009: Make it optional to specify a DTag inside MsgSaveProfile Oct 18, 2021
@RiccardoM RiccardoM changed the title feat: ADR-009: Make it optional to specify a DTag inside MsgSaveProfile feat: ADR-009: Make MsgSaveProfile DTag optional Oct 18, 2021
Copy link
Contributor

@dadamu dadamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@RiccardoM RiccardoM merged commit 6a3d49a into master Oct 18, 2021
@RiccardoM RiccardoM deleted the leonardo/adr-009-impl branch October 18, 2021 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x/CLI 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.

Avoid from overriding the Dtag accidentally
3 participants