// Functions to manually debug encoding/decoding. No actual automated unit tests. package core import ( "fmt" "testing" "github.com/PeernetOfficial/core/protocol" ) func TestMessageEncodingAnnouncement(t *testing.T) { _, publicKey, err := Secp256k1NewPrivateKey() if err != nil { fmt.Printf("Error: %s\n", err.Error()) return } // encode and decode announcement packetR := protocol.PacketRaw{Protocol: 0, Command: protocol.CommandAnnouncement, Sequence: 123} var findPeer []KeyHash var findValue []KeyHash var files []InfoStore hash1 := protocol.HashData([]byte("test")) hash2 := protocol.HashData([]byte("test3")) findPeer = append(findPeer, KeyHash{Hash: hash1}) findValue = append(findValue, KeyHash{Hash: hash2}) packets := EncodeAnnouncement(true, true, findPeer, findValue, files, 1<