(t *testing.T)
| 477 | } |
| 478 | |
| 479 | func TestGetProposalHash2(t *testing.T) { |
| 480 | expectedHashHex := "7b622ef4e1ab9b7093ec3bbfbca17d5d6f14a437914a6839319978a7034f7960" |
| 481 | expectedHash, _ := hex.DecodeString(expectedHashHex) |
| 482 | hdr := &cb.Header{ |
| 483 | ChannelHeader: []byte("chdr"), |
| 484 | SignatureHeader: []byte("shdr"), |
| 485 | } |
| 486 | propHash, err := protoutil.GetProposalHash2(hdr, []byte("ccproppayload")) |
| 487 | require.NoError(t, err, "Unexpected error getting hash2 for proposal") |
| 488 | require.Equal(t, expectedHash, propHash, "Proposal hash did not match expected hash") |
| 489 | |
| 490 | _, err = protoutil.GetProposalHash2(&cb.Header{}, []byte("ccproppayload")) |
| 491 | require.Error(t, err, "Expected error with nil arguments") |
| 492 | } |
| 493 | |
| 494 | func TestGetProposalHash1(t *testing.T) { |
| 495 | expectedHashHex := "d4c1e3cac2105da5fddc2cfe776d6ec28e4598cf1e6fa51122c7f70d8076437b" |
nothing calls this directly
no test coverage detected