|
@ -34,7 +34,7 @@ func TestBasicPartSet(t *testing.T) { |
|
|
for i := 0; i < partSet.Total(); i++ { |
|
|
for i := 0; i < partSet.Total(); i++ { |
|
|
part := partSet.GetPart(i) |
|
|
part := partSet.GetPart(i) |
|
|
//t.Logf("\n%v", part)
|
|
|
//t.Logf("\n%v", part)
|
|
|
added, err := partSet2.AddPart(part, true) |
|
|
|
|
|
|
|
|
added, err := partSet2.AddPart(part) |
|
|
if !added || err != nil { |
|
|
if !added || err != nil { |
|
|
t.Errorf("Failed to add part %v, error: %v", i, err) |
|
|
t.Errorf("Failed to add part %v, error: %v", i, err) |
|
|
} |
|
|
} |
|
@ -74,7 +74,7 @@ func TestWrongProof(t *testing.T) { |
|
|
// Test adding a part with wrong trail.
|
|
|
// Test adding a part with wrong trail.
|
|
|
part := partSet.GetPart(0) |
|
|
part := partSet.GetPart(0) |
|
|
part.Proof.Aunts[0][0] += byte(0x01) |
|
|
part.Proof.Aunts[0][0] += byte(0x01) |
|
|
added, err := partSet2.AddPart(part, true) |
|
|
|
|
|
|
|
|
added, err := partSet2.AddPart(part) |
|
|
if added || err == nil { |
|
|
if added || err == nil { |
|
|
t.Errorf("Expected to fail adding a part with bad trail.") |
|
|
t.Errorf("Expected to fail adding a part with bad trail.") |
|
|
} |
|
|
} |
|
@ -82,7 +82,7 @@ func TestWrongProof(t *testing.T) { |
|
|
// Test adding a part with wrong bytes.
|
|
|
// Test adding a part with wrong bytes.
|
|
|
part = partSet.GetPart(1) |
|
|
part = partSet.GetPart(1) |
|
|
part.Bytes[0] += byte(0x01) |
|
|
part.Bytes[0] += byte(0x01) |
|
|
added, err = partSet2.AddPart(part, true) |
|
|
|
|
|
|
|
|
added, err = partSet2.AddPart(part) |
|
|
if added || err == nil { |
|
|
if added || err == nil { |
|
|
t.Errorf("Expected to fail adding a part with bad bytes.") |
|
|
t.Errorf("Expected to fail adding a part with bad bytes.") |
|
|
} |
|
|
} |
|
|