(t *testing.T)
| 643 | } |
| 644 | |
| 645 | func TestConsensusValidatorJSON(t *testing.T) { |
| 646 | expected := &ConsensusValidator{ |
| 647 | PublicKey: newTestPublicKeyBytes(t), |
| 648 | VotingPower: 100, |
| 649 | NetAddress: "tcp://example.com", |
| 650 | } |
| 651 | // convert structure to json bytes |
| 652 | gotBytes, err := json.Marshal(expected) |
| 653 | require.NoError(t, err) |
| 654 | // convert bytes to structure |
| 655 | got := new(ConsensusValidator) |
| 656 | // unmarshal into bytes |
| 657 | require.NoError(t, json.Unmarshal(gotBytes, got)) |
| 658 | // compare got vs expected |
| 659 | require.Equal(t, expected, got) |
| 660 | } |
| 661 | |
| 662 | func TestViewCheckBasic(t *testing.T) { |
| 663 | tests := []struct { |
nothing calls this directly
no test coverage detected