fix: post hash

This commit is contained in:
maksaid 2024-01-17 21:52:35 +03:00
parent 11cfa20533
commit efc1d5eafe
2 changed files with 19 additions and 1 deletions

View file

@ -35,7 +35,7 @@ func _deploy(data interface{}, isUpdate bool) {
}) })
if len(args.commentHash) != interop.Hash160Len { if len(args.commentHash) != interop.Hash160Len {
panic("invalid hash of player contrast") panic("invalid hash")
} }
ctx := storage.GetContext() ctx := storage.GetContext()

View file

@ -22,9 +22,27 @@ const (
lastIndex = "user_post_index" lastIndex = "user_post_index"
id = "current_post_id" id = "current_post_id"
comment_prefix = "comment_" comment_prefix = "comment_"
post_hash = "post_hash"
gas_decimals = 1_0000_0000 gas_decimals = 1_0000_0000
) )
func _deploy(data interface{}, isUpdate bool) {
if isUpdate {
return
}
args := data.(struct {
postHash interop.Hash160
})
if len(args.postHash) != interop.Hash160Len {
panic("invalid hash")
}
ctx := storage.GetContext()
storage.Put(ctx, post_hash, args.postHash)
}
func NewPost(login string, text string, postName string) { func NewPost(login string, text string, postName string) {
ctx := storage.GetContext() ctx := storage.GetContext()
updatePostId() updatePostId()