fix: merge
This commit is contained in:
parent
974a9c9be6
commit
d1d6b51c80
1 changed files with 0 additions and 34 deletions
|
@ -1,11 +1,7 @@
|
|||
package Post
|
||||
|
||||
import (
|
||||
<<<<<<< HEAD
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/oracle"
|
||||
=======
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/iterator"
|
||||
>>>>>>> post-brench
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/native/std"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
||||
)
|
||||
|
@ -44,33 +40,7 @@ func NewPost(login string, text string, postName string) {
|
|||
|
||||
updatePostIndex(login)
|
||||
lastPostIndex := storage.Get(ctx, login+lastIndex).(string)
|
||||
|
||||
<<<<<<< HEAD
|
||||
storage.Put(ctx, authorId+lastPostIndex, post.id)
|
||||
}
|
||||
|
||||
func CbGetUUID(url string, postData any, code int, result []byte) {
|
||||
callingHash := runtime.GetCallingScriptHash()
|
||||
if !callingHash.Equals(oracle.Hash) {
|
||||
panic("not called from the oracle contract")
|
||||
}
|
||||
if code != oracle.Success {
|
||||
panic("request failed for " + url + " with code " + std.Itoa10(code))
|
||||
}
|
||||
runtime.Log("result for " + url + " is: " + string(result))
|
||||
|
||||
ctx := storage.GetContext()
|
||||
storage.Put(ctx, "lastPostId", string(result))
|
||||
}
|
||||
|
||||
func appendPostToAllPosts(post Post) {
|
||||
ctx := storage.GetContext()
|
||||
all_posts := GetAllPosts()
|
||||
posts := append(all_posts, post)
|
||||
storage.Put(ctx, all_posts_key, posts)
|
||||
=======
|
||||
storage.Put(ctx, login+"_p_"+lastPostIndex, post.id)
|
||||
>>>>>>> post-brench
|
||||
}
|
||||
|
||||
func GetAllPosts() []Post {
|
||||
|
@ -101,11 +71,7 @@ func GetAllPostsByUser(login string) []Post {
|
|||
i := 0
|
||||
n := getPostIndex(login)
|
||||
for i < n {
|
||||
<<<<<<< HEAD
|
||||
post := storage.Get(ctx, userId+std.Itoa10(i))
|
||||
=======
|
||||
post := storage.Get(ctx, login+"_p_"+std.Itoa10(i))
|
||||
>>>>>>> post-brench
|
||||
i++
|
||||
postsByUser = append(postsByUser, std.Deserialize(post.([]byte)).(Post))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue