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: relationships module #750

Merged
merged 64 commits into from
Mar 1, 2022
Merged

feat: relationships module #750

merged 64 commits into from
Mar 1, 2022

Conversation

RiccardoM
Copy link
Contributor

@RiccardoM RiccardoM commented Feb 22, 2022

Description

This PR implements the new x/relationships module. This module contains all the user blocks and relationships actions that were previously present inside the x/profiles module.

Some changes have been done to the logic of relationships and user blocks, particularly:

  • it is not required anymore to have a Desmos profile in order to block another user
  • it is not required anymore that both parties have a Desmos profile in order to establish a relationship
  • blocking a user inside the subspace 0 will not lead to the user being blocked on all subspaces anymore. The subspace with id 0 now only identifies the x/profiles subspace. Users blocked there won't be able to send DTag transfer requests to other users or perform other actions from within the x/profiles module that involve the blocker.

Depends-On: #753


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>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…subspace-module-adr-impl

� Conflicts:
�	x/profiles/types/models_chain_links.pb.go
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
… files

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…ps module

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…relationships-module

� Conflicts:
�	app/app.go
�	app/desmos/cmd/chainlink/create_json_test.go
�	app/params/weights.go
�	client/docs/swagger-ui/swagger.yaml
�	proto/desmos/profiles/v1beta1/query_relationships.proto
�	proto/desmos/profiles/v2/models_relationships.proto
�	proto/desmos/profiles/v3/genesis.proto
�	proto/desmos/profiles/v3/msg_server.proto
�	proto/desmos/profiles/v3/msgs_dtag_requests.proto
�	proto/desmos/profiles/v3/msgs_profile.proto
�	proto/desmos/profiles/v3/msgs_relationships.proto
�	proto/desmos/profiles/v3/query.proto
�	proto/desmos/profiles/v3/query_relationships.proto
�	proto/desmos/relationships/v1/query.proto
�	proto/desmos/subspaces/v1/genesis.proto
�	proto/desmos/subspaces/v1/msgs.proto
�	proto/desmos/subspaces/v1/query.proto
�	x/profiles/client/cli/cli_test.go
�	x/profiles/keeper/genesis_test.go
�	x/profiles/keeper/grpc_query.go
�	x/profiles/keeper/grpc_query_test.go
�	x/profiles/keeper/invariants.go
�	x/profiles/keeper/invariants_test.go
�	x/profiles/keeper/keeper.go
�	x/profiles/keeper/migrations.go
�	x/profiles/keeper/msg_server_blocks.go
�	x/profiles/keeper/msg_server_relationships.go
�	x/profiles/keeper/msg_server_relationships_test.go
�	x/profiles/legacy/v2/models_relationships.pb.go
�	x/profiles/legacy/v3/store.go
�	x/profiles/module.go
�	x/profiles/simulation/decoder.go
�	x/profiles/simulation/decoder_test.go
�	x/profiles/simulation/genesis.go
�	x/profiles/simulation/operations.go
�	x/profiles/types/genesis.go
�	x/profiles/types/genesis.pb.go
�	x/profiles/types/genesis_test.go
�	x/profiles/types/keys.go
�	x/profiles/types/msg_server.pb.go
�	x/profiles/types/msgs_dtag_requests.pb.go
�	x/profiles/types/msgs_profile.pb.go
�	x/profiles/types/query.pb.go
�	x/profiles/types/query.pb.gw.go
�	x/relationships/client/cli/tx.go
�	x/relationships/keeper/blocks.go
�	x/relationships/keeper/blocks_test.go
�	x/relationships/keeper/msg_server_test.go
�	x/relationships/keeper/relationships.go
�	x/relationships/simulation/operations_relationships.go
�	x/relationships/types/models.go
�	x/relationships/types/msg_server.pb.go
�	x/relationships/types/msgs.go
�	x/relationships/types/query.pb.go
�	x/subspaces/client/cli/cli_test.go
�	x/subspaces/client/cli/query.go
�	x/subspaces/client/cli/tx.go
�	x/subspaces/handler.go
�	x/subspaces/keeper/alias_functions.go
�	x/subspaces/keeper/genesis.go
�	x/subspaces/keeper/genesis_test.go
�	x/subspaces/keeper/groups.go
�	x/subspaces/keeper/groups_test.go
�	x/subspaces/keeper/grpc_query.go
�	x/subspaces/keeper/grpc_query_test.go
�	x/subspaces/keeper/invariants.go
�	x/subspaces/keeper/invariants_test.go
�	x/subspaces/keeper/keeper.go
�	x/subspaces/keeper/msg_server.go
�	x/subspaces/keeper/msg_server_test.go
�	x/subspaces/keeper/permissions.go
�	x/subspaces/keeper/permissions_test.go
�	x/subspaces/keeper/subspaces.go
�	x/subspaces/keeper/subspaces_test.go
�	x/subspaces/simulation/decoder.go
�	x/subspaces/simulation/decoder_test.go
�	x/subspaces/simulation/genesis.go
�	x/subspaces/simulation/operations.go
�	x/subspaces/simulation/operations_groups.go
�	x/subspaces/simulation/operations_permissions.go
�	x/subspaces/simulation/operations_subspaces.go
�	x/subspaces/simulation/utils.go
�	x/subspaces/types/codec.go
�	x/subspaces/types/events.go
�	x/subspaces/types/genesis.go
�	x/subspaces/types/genesis.pb.go
�	x/subspaces/types/genesis_test.go
�	x/subspaces/types/keys.go
�	x/subspaces/types/msgs.go
�	x/subspaces/types/msgs.pb.go
�	x/subspaces/types/msgs_test.go
�	x/subspaces/types/permissions.go
�	x/subspaces/types/query.go
�	x/subspaces/types/query.pb.go
�	x/subspaces/types/query.pb.gw.go

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@github-actions github-actions bot added x/CLI x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module labels Feb 22, 2022
RiccardoM and others added 2 commits February 22, 2022 10:18
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…space is deleted

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Copy link
Contributor

@leobragaz leobragaz left a comment

Choose a reason for hiding this comment

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

The overall looks good but there are some tests failing because of the hooks.

Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
…into riccardo/relationships-module

� Conflicts:
�	x/subspaces/simulation/genesis.go
@github-actions github-actions bot added kind/build Related to the build of the project kind/ci Improve the CI/CD labels Feb 28, 2022
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@RiccardoM RiccardoM mentioned this pull request Feb 28, 2022
19 tasks
…relationships-module

� Conflicts:
�	app/sim_test.go
�	x/subspaces/simulation/genesis.go
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
@github-actions github-actions bot removed kind/build Related to the build of the project kind/ci Improve the CI/CD labels Mar 1, 2022
@RiccardoM RiccardoM requested a review from dadamu March 1, 2022 07:42
app/sim_test.go Outdated
@@ -231,7 +229,6 @@ func TestAppImportExport(t *testing.T) {

{app.keys[subspacestypes.StoreKey], newApp.keys[subspacestypes.StoreKey], [][]byte{}},
{app.keys[profilestypes.StoreKey], newApp.keys[profilestypes.StoreKey], [][]byte{}},
{app.keys[relationshipstypes.StoreKey], newApp.keys[relationshipstypes.StoreKey], [][]byte{}},
Copy link
Contributor

Choose a reason for hiding this comment

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

why we remove this?

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 is good to me. It is ready to go once the problem @bragaz proposed is solved.

@mergify mergify bot merged commit 8998def into master Mar 1, 2022
@mergify mergify bot deleted the riccardo/relationships-module branch March 1, 2022 11:13
mergify bot pushed a commit that referenced this pull request Mar 2, 2022
## Description
This PR adds missing events inside the `x/profiles` modukes

Closes: #721

Depends-On: #750

---

### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)
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/CLI x/profiles Module that allows to create and manage decentralized social profiles x/subspaces Issue on the x/subspaces module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants