MCPcopy Create free account
hub / github.com/tendermint/tendermint / TestHeaderHashVector

Function TestHeaderHashVector

types/block_test.go:1317–1349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1315}
1316
1317func TestHeaderHashVector(t *testing.T) {
1318 chainID := "test"
1319 h := Header{
1320 Version: version.Consensus{Block: 1, App: 1},
1321 ChainID: chainID,
1322 Height: 50,
1323 Time: time.Date(math.MaxInt64, 0, 0, 0, 0, 0, math.MaxInt64, time.UTC),
1324 LastBlockID: BlockID{},
1325 LastCommitHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1326 DataHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1327 ValidatorsHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1328 NextValidatorsHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1329 ConsensusHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1330 AppHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1331
1332 LastResultsHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1333
1334 EvidenceHash: []byte("f2564c78071e26643ae9b3e2a19fa0dc10d4d9e873aa0be808660123f11a1e78"),
1335 ProposerAddress: []byte("2915b7b15f979e48ebc61774bb1d86ba3136b7eb"),
1336 }
1337
1338 testCases := []struct {
1339 header Header
1340 expBytes string
1341 }{
1342 {header: h, expBytes: "87b6117ac7f827d656f178a3d6d30b24b205db2b6a3a053bae8baf4618570bfc"},
1343 }
1344
1345 for _, tc := range testCases {
1346 hash := tc.header.Hash()
1347 require.Equal(t, tc.expBytes, hex.EncodeToString(hash))
1348 }
1349}

Callers

nothing calls this directly

Calls 2

HashMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…