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

ERC721 posts #338

Merged
merged 6 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add MaxPostBodyLength param
  • Loading branch information
JakeHartnell authored and shanev committed Mar 13, 2021
commit a80cf49c7c4b7886211d6752b770b940d9d8496b
4 changes: 4 additions & 0 deletions x/curating/keeper/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (k Keeper) CreatePost(ctx sdk.Context, vendorID uint32, postID *types.PostI
if err != nil {
return post, err
}
err = k.validatePostBodyLength(ctx, body)
if err != nil {
return err
}
if rewardAccount.Empty() {
rewardAccount = creator
}
Expand Down
4 changes: 0 additions & 4 deletions x/curating/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ func (msg MsgPost) ValidateBasic() error {
if msg.Body == "" {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "empty body")
}
// TODO add param
if len(msg.Body) > 280 {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "post body is too long")
}
if strings.TrimSpace(msg.Creator) == "" {
return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "empty creator")
}
Expand Down