@@ -25,8 +25,8 @@ func TestNilDataAvailabilityHeaderHashDoesntCrash(t *testing.T) {
25
25
func TestMinDataAvailabilityHeader (t * testing.T ) {
26
26
dah := MinDataAvailabilityHeader ()
27
27
expectedHash := []byte {
28
- 0x7b , 0x57 , 0x8b , 0x35 , 0x1b , 0x1b , 0xb , 0xbd , 0x70 , 0xbb , 0x35 , 0x0 , 0x19 , 0xeb , 0xc9 , 0x64 ,
29
- 0xc4 , 0x4a , 0x14 , 0xa , 0x37 , 0xef , 0x71 , 0x5b , 0x55 , 0x2a , 0x7f , 0x8f , 0x31 , 0x5a , 0xcd , 0x19 ,
28
+ 0x6f , 0x52 , 0xda , 0xc1 , 0x65 , 0x45 , 0xe4 , 0x57 , 0x25 , 0xbe , 0x6e , 0xa3 , 0x2a , 0xed , 0x55 , 0x26 ,
29
+ 0x6e , 0x45 , 0x3 , 0x48 , 0x0 , 0xee , 0xe1 , 0xd8 , 0x7c , 0x94 , 0x28 , 0xf4 , 0x84 , 0x4e , 0xa4 , 0x7a ,
30
30
}
31
31
require .Equal (t , expectedHash , dah .hash )
32
32
require .NoError (t , dah .ValidateBasic ())
@@ -47,31 +47,32 @@ func TestNewDataAvailabilityHeader(t *testing.T) {
47
47
{
48
48
name : "typical" ,
49
49
expectedHash : []byte {
50
- 0xfe , 0x9c , 0x6b , 0xd8 , 0xe5 , 0x7c , 0xd1 , 0x5d , 0x1f , 0xd6 , 0x55 , 0x7e , 0x87 , 0x7d , 0xd9 , 0x7d ,
51
- 0xdb , 0xf2 , 0x66 , 0xfa , 0x60 , 0x24 , 0x2d , 0xb3 , 0xa0 , 0x9c , 0x4f , 0x4e , 0x5b , 0x2a , 0x2c , 0x2a ,
50
+ 0x57 , 0x71 , 0xc6 , 0x77 , 0x2f , 0x32 , 0x95 , 0x73 , 0xaa , 0xb8 , 0x20 , 0xd1 , 0xbe , 0x4c , 0xc2 , 0x21 ,
51
+ 0x7d , 0x54 , 0xb6 , 0x7e , 0xf2 , 0x4f , 0xbc , 0xd3 , 0x9a , 0x95 , 0x15 , 0xd0 , 0x92 , 0x63 , 0xc1 , 0xf9 ,
52
52
},
53
53
squareSize : 2 ,
54
54
shares : generateShares (4 , 1 ),
55
55
},
56
56
{
57
57
name : "max square size" ,
58
58
expectedHash : []byte {
59
- 0xe2 , 0x87 , 0x23 , 0xd0 , 0x2d , 0x54 , 0x25 , 0x5f , 0x79 , 0x43 , 0x8e , 0xfb , 0xb7 , 0xe8 , 0xfa , 0xf5 ,
60
- 0xbf , 0x93 , 0x50 , 0xb3 , 0x64 , 0xd0 , 0x4f , 0xa7 , 0x7b , 0xb1 , 0x83 , 0x3b , 0x8 , 0xba , 0xd3 , 0xa4 ,
59
+ 0xbf , 0xe5 , 0x8f , 0x4b , 0xae , 0x2b , 0x65 , 0x8b , 0xa8 , 0xcb , 0xf9 , 0xee , 0x8c , 0x6a , 0x1f , 0x72 ,
60
+ 0xa9 , 0x58 , 0xc4 , 0xcc , 0xca , 0x41 , 0x4c , 0xbf , 0x8b , 0x18 , 0xf9 , 0x53 , 0xe , 0xb1 , 0x40 , 0x54 ,
61
61
},
62
62
squareSize : appconsts .MaxSquareSize ,
63
63
shares : generateShares (appconsts .MaxSquareSize * appconsts .MaxSquareSize , 99 ),
64
64
},
65
65
}
66
66
67
67
for _ , tt := range tests {
68
- tt := tt
69
- eds , err := ExtendShares (tt .squareSize , tt .shares )
70
- require .NoError (t , err )
71
- resdah := NewDataAvailabilityHeader (eds )
72
- require .Equal (t , tt .squareSize * 2 , uint64 (len (resdah .ColumnRoots )), tt .name )
73
- require .Equal (t , tt .squareSize * 2 , uint64 (len (resdah .RowsRoots )), tt .name )
74
- require .Equal (t , tt .expectedHash , resdah .hash , tt .name )
68
+ t .Run (tt .name , func (t * testing.T ) {
69
+ eds , err := ExtendShares (tt .squareSize , tt .shares )
70
+ require .NoError (t , err )
71
+ resdah := NewDataAvailabilityHeader (eds )
72
+ require .Equal (t , tt .squareSize * 2 , uint64 (len (resdah .ColumnRoots )), tt .name )
73
+ require .Equal (t , tt .squareSize * 2 , uint64 (len (resdah .RowsRoots )), tt .name )
74
+ require .Equal (t , tt .expectedHash , resdah .hash , tt .name )
75
+ })
75
76
}
76
77
}
77
78
0 commit comments