MCPcopy
hub / github.com/canopy-network/canopy / TestPhaseJSON

Function TestPhaseJSON

lib/consensus_test.go:1152–1163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1150}
1151
1152func TestPhaseJSON(t *testing.T) {
1153 expected := Phase(2)
1154 // convert structure to json bytes
1155 gotBytes, err := json.Marshal(expected)
1156 require.NoError(t, err)
1157 // convert bytes to structure
1158 got := new(Phase)
1159 // unmarshal into bytes
1160 require.NoError(t, json.Unmarshal(gotBytes, got))
1161 // compare got vs expected
1162 require.Equal(t, &expected, got)
1163}
1164
1165func TestAddHeight(t *testing.T) {
1166 // pre-define expected

Callers

nothing calls this directly

Calls 4

PhaseTypeAlias · 0.85
EqualMethod · 0.80
MarshalMethod · 0.65
UnmarshalMethod · 0.65

Tested by

no test coverage detected