MCPcopy Create free account
hub / github.com/DOSNetwork/core / TestPublicRecoveryDeleteFail

Function TestPublicRecoveryDeleteFail

share/poly_test.go:148–167  ·  view source on GitHub ↗
(test *testing.T)

Source from the content-addressed store, hash-verified

146}
147
148func TestPublicRecoveryDeleteFail(test *testing.T) {
149 n := 10
150 t := n/2 + 1
151
152 priPoly := NewPriPoly(suite, t, nil, suite.RandomStream())
153 pubPoly := priPoly.Commit(nil)
154 shares := pubPoly.Shares(n)
155
156 // Corrupt one more share than acceptable
157 shares[1] = nil
158 shares[2] = nil
159 shares[5] = nil
160 shares[7] = nil
161 shares[8] = nil
162
163 _, err := RecoverCommit(suite, shares, t, n)
164 if err == nil {
165 test.Fatal("recovered commit unexpectably")
166 }
167}
168
169func TestPrivateAdd(test *testing.T) {
170 n := 10

Callers

nothing calls this directly

Calls 6

CommitMethod · 0.95
NewPriPolyFunction · 0.85
RecoverCommitFunction · 0.85
FatalMethod · 0.65
RandomStreamMethod · 0.45
SharesMethod · 0.45

Tested by

no test coverage detected