MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestNotFoundHandle

Function TestNotFoundHandle

p2pserver/message/utils/msg_handler_test.go:623–638  ·  view source on GitHub ↗

TestNotFoundHandle tests Function NotFoundHandle handling a not found message

(t *testing.T)

Source from the content-addressed store, hash-verified

621
622// TestNotFoundHandle tests Function NotFoundHandle handling a not found message
623func TestNotFoundHandle(t *testing.T) {
624 tempStr := "3369930accc1ddd067245e8edadcd9bea207ba5e1753ac18a51df77a343bfe92"
625 hex, _ := hex.DecodeString(tempStr)
626 var hash common.Uint256
627 hash.Deserialize(bytes.NewReader(hex))
628
629 buf := msgpack.NewNotFound(hash)
630
631 msg := &types.MsgPayload{
632 Id: 0,
633 Addr: "127.0.0.1:50010",
634 Payload: buf,
635 }
636
637 NotFoundHandle(msg, network, nil)
638}
639
640// TestTransactionHandle tests Function TransactionHandle handling a transaction message
641func TestTransactionHandle(t *testing.T) {

Callers

nothing calls this directly

Calls 2

DeserializeMethod · 0.95
NotFoundHandleFunction · 0.85

Tested by

no test coverage detected