mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Remove unused utils * Remove unneeded randomness from tests * Remove more unused functions * Remove unused protobuf structures * Fix small errors
28 lines
700 B
Go
28 lines
700 B
Go
// Copyright (c) 2013-2016 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package appmessage
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestPing tests the MsgPing API against the latest protocol version.
|
|
func TestPing(t *testing.T) {
|
|
// Ensure we get the same nonce back out.
|
|
nonce := uint64(0x61c2c5535902862)
|
|
msg := NewMsgPing(nonce)
|
|
if msg.Nonce != nonce {
|
|
t.Errorf("NewMsgPing: wrong nonce - got %v, want %v",
|
|
msg.Nonce, nonce)
|
|
}
|
|
|
|
// Ensure the command is expected value.
|
|
wantCmd := MessageCommand(7)
|
|
if cmd := msg.Command(); cmd != wantCmd {
|
|
t.Errorf("NewMsgPing: wrong command - got %v want %v",
|
|
cmd, wantCmd)
|
|
}
|
|
}
|