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

Function TestDeserializeNotify

vm/crossvm_codec/codec_test.go:46–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestDeserializeNotify(t *testing.T) {
47 addr := common.AddressFromVmCode([]byte("123"))
48 value := []interface{}{"helloworld", []byte("1234"), 123, -1, -128, -260, true, big.NewInt(100), addr, common.UINT256_EMPTY}
49 expected := []interface{}{"helloworld", hex.EncodeToString([]byte("1234")), "123", "-1", "-128", "-260", true, "100", addr.ToBase58(), common.UINT256_EMPTY.ToHexString()}
50 for i, val := range value {
51 assert.Equal(t, DeserializeNotify(EncodeNotify(t, val)), interface{}(expected[i]))
52 }
53
54 assert.Equal(t, DeserializeNotify(EncodeNotify(t, value)), interface{}(expected))
55}

Callers

nothing calls this directly

Calls 5

AddressFromVmCodeFunction · 0.92
DeserializeNotifyFunction · 0.85
EncodeNotifyFunction · 0.85
ToBase58Method · 0.80
ToHexStringMethod · 0.45

Tested by

no test coverage detected