Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit 222049e

Browse files
committed
Add TestHeaderExtraGetWith
1 parent fb591d8 commit 222049e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

core/types/header_ext_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// (c) 2025, Ava Labs, Inc. All rights reserved.
2+
// See the file LICENSE for licensing terms.
3+
4+
package types
5+
6+
import (
7+
"testing"
8+
9+
"github.com/stretchr/testify/assert"
10+
"github.com/stretchr/testify/require"
11+
)
12+
13+
func TestHeaderExtraGetWith(t *testing.T) {
14+
t.Parallel()
15+
16+
h := &Header{}
17+
18+
extra := GetHeaderExtra(h)
19+
require.NotNil(t, extra)
20+
assert.Equal(t, &HeaderExtra{}, extra)
21+
22+
extra = &HeaderExtra{
23+
ExtDataHash: [32]byte{1},
24+
}
25+
WithHeaderExtra(h, extra)
26+
27+
extra = GetHeaderExtra(h)
28+
assert.Equal(t, &HeaderExtra{
29+
ExtDataHash: [32]byte{1},
30+
}, extra)
31+
}

0 commit comments

Comments
 (0)