a bunch of [32]byte conversions. still more needed.
This commit is contained in:
@@ -2,18 +2,17 @@ package sdk
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
"fiatjaf.com/nostr"
|
||||
)
|
||||
|
||||
var kvStoreLastFetchPrefix = byte('f')
|
||||
|
||||
func makeLastFetchKey(kind int, pubkey string) []byte {
|
||||
func makeLastFetchKey(kind uint16, pubkey nostr.PubKey) []byte {
|
||||
buf := make([]byte, 1+5+32)
|
||||
buf[0] = kvStoreLastFetchPrefix
|
||||
binary.LittleEndian.PutUint32(buf[1:], uint32(kind))
|
||||
hex.Decode(buf[5:], []byte(pubkey))
|
||||
copy(buf[5:], pubkey[:])
|
||||
return buf
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user