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

Function TestTransactionHandle

p2pserver/message/utils/msg_handler_test.go:641–661  ·  view source on GitHub ↗

TestTransactionHandle tests Function TransactionHandle handling a transaction message

(t *testing.T)

Source from the content-addressed store, hash-verified

639
640// TestTransactionHandle tests Function TransactionHandle handling a transaction message
641func TestTransactionHandle(t *testing.T) {
642 code := []byte("ont")
643 invokeCodePayload := &payload.InvokeCode{
644 Code: code,
645 }
646 tx := &ct.Transaction{
647 Version: 0,
648 TxType: ct.InvokeNeo,
649 Payload: invokeCodePayload,
650 }
651
652 buf := msgpack.NewTxn(tx)
653
654 msg := &types.MsgPayload{
655 Id: 0,
656 Addr: "127.0.0.1:50010",
657 Payload: buf,
658 }
659
660 TransactionHandle(msg, network, nil)
661}
662
663// TestAddrHandle tests Function AddrHandle handling a neighbor address response message
664func TestAddrHandle(t *testing.T) {

Callers

nothing calls this directly

Calls 1

TransactionHandleFunction · 0.85

Tested by

no test coverage detected