@@ -160,14 +160,14 @@ func TestBlockRecovery(t *testing.T) {
160
160
// adjustedLeafSize describes the size of a leaf that will not get split
161
161
adjustedLeafSize := types .MsgShareSize
162
162
163
- originalSquareWidth := 2
164
- sharecount := originalSquareWidth * originalSquareWidth
165
- extendedSquareWidth := originalSquareWidth * originalSquareWidth
163
+ originalSquareWidth := 8
164
+ shareCount := originalSquareWidth * originalSquareWidth
165
+ extendedSquareWidth := 2 * originalSquareWidth
166
166
extendedShareCount := extendedSquareWidth * extendedSquareWidth
167
167
168
168
// generate test data
169
- quarterShares := generateRandNamespacedRawData (sharecount , types .NamespaceSize , adjustedLeafSize )
170
- allShares := generateRandNamespacedRawData (sharecount , types .NamespaceSize , adjustedLeafSize )
169
+ quarterShares := generateRandNamespacedRawData (shareCount , types .NamespaceSize , adjustedLeafSize )
170
+ allShares := generateRandNamespacedRawData (shareCount , types .NamespaceSize , adjustedLeafSize )
171
171
172
172
testCases := []struct {
173
173
name string
@@ -177,8 +177,7 @@ func TestBlockRecovery(t *testing.T) {
177
177
errString string
178
178
d int // number of shares to delete
179
179
}{
180
- // missing more shares causes RepairExtendedDataSquare to hang see
181
- // https://github.com/lazyledger/rsmt2d/issues/21
180
+ {"missing 1/2 shares" , quarterShares , false , "" , extendedShareCount / 2 },
182
181
{"missing 1/4 shares" , quarterShares , false , "" , extendedShareCount / 4 },
183
182
{"missing all but one shares" , allShares , true , "failed to solve data square" , extendedShareCount - 1 },
184
183
}
@@ -227,7 +226,8 @@ func TestBlockRecovery(t *testing.T) {
227
226
}
228
227
229
228
func flatten (eds * rsmt2d.ExtendedDataSquare ) [][]byte {
230
- out := make ([][]byte , eds .Width ()* eds .Width ())
229
+ flattenedEDSSize := eds .Width () * eds .Width ()
230
+ out := make ([][]byte , flattenedEDSSize )
231
231
count := 0
232
232
for i := uint (0 ); i < eds .Width (); i ++ {
233
233
for _ , share := range eds .Row (i ) {
0 commit comments