-
Notifications
You must be signed in to change notification settings - Fork 46
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
Refuse and Cancel features for DTag #305
Conversation
# Conflicts: # CHANGELOG.md
added docs updated CHANGELOG.md
…eonardo/dtag-request-reject-cancel � Conflicts: � CHANGELOG.md � cli_test/cli_profile_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-reviewed
updated CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code and the documentation of the different DTag transfer-related message, I think that the current naming can create some confusion.
Currently there are two names: current_owner
and sender
, but I think that instead we should use sender
and receiver
.
So, I propose to change the different messages as:
type ... struct {
Receiver sdk.AccAddress `json:"receiver" yaml:"receiver"`
Sender sdk.AccAddress `json:"sender" yaml:"sender"`
}
Also, I think we should rename the event attributes to request_sender
and request_receiver
for better understanding.
This would create a naming convention that makes it easier to understand what the different fields represent. What do you think?
fixed docs
@@ -707,8 +707,8 @@ func TestDesmosCLIPostsReactions(t *testing.T) { | |||
subspace := "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e" | |||
reactions := types.Reactions{ | |||
types.Reaction{":earth:", "http://earth.jpg", subspace, fooAddr}, | |||
types.Reaction{":blush:", "https://gph.is/2p19Zai", subspace, fooAddr}, | |||
types.Reaction{":thumbsdown:", "https://gph.is/2phybnt", subspace, fooAddr}, | |||
types.Reaction{":plot:", "https://gph.is/2p19Zai", subspace, fooAddr}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we revert all the changes that were made to this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes I made were to fix some errors inside tests to exclude them from the possible causes that make the whole suite fail, should I revert them anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bragaz Yes please, they were part of tests that have always been passing so I don't think they consitute any problem
x/profiles/client/rest/tx.go
Outdated
r.HandleFunc("/profiles/dtag/request/{receiverAddress}", requestDTagTransferHandler(cliCtx)).Methods("POST") | ||
r.HandleFunc("/profiles/dtag/accept/{senderAddress}", acceptTransferRequestHandler(cliCtx)).Methods("POST") | ||
r.HandleFunc("/profiles/dtag/refuse/{senderAddress}", refuseDTagTransferRequestHandler(cliCtx)).Methods("POST") | ||
r.HandleFunc("/profiles/dtag/cancel/{receiverAddress}", cancelDTagTransferRequestHandler(cliCtx)).Methods("POST") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these can be further improved by writing them as
r.HandleFunc("/profiles/dtag/request/{receiverAddress}", requestDTagTransferHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtag/accept/{senderAddress}", acceptTransferRequestHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtag/refuse/{senderAddress}", refuseDTagTransferRequestHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtag/cancel/{receiverAddress}", cancelDTagTransferRequestHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtagrequests", requestDTagTransferHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtagrequests/{senderAddress}/acceptances", acceptTransferRequestHandler(cliCtx)).Methods("POST") | |
r.HandleFunc("/profiles/dtagrequests/{senderAddress}", refuseDTagTransferRequestHandler(cliCtx)).Methods("DELETE") | |
r.HandleFunc("/profiles/dtagrequests/{receiverAddress}", cancelDTagTransferRequestHandler(cliCtx)).Methods("DELETE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
This PR implement the possibility from both the sender and receiver of a DTag request to cancel or refuse it.
Closes #297 .
Checklist
CHANGELOG.md
file.Files changed
in the Github PR explorer.