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

Function TestPublicRecovery

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

Source from the content-addressed store, hash-verified

104}
105
106func TestPublicRecovery(test *testing.T) {
107 n := 10
108 t := n/2 + 1
109
110 priPoly := NewPriPoly(suite, t, nil, suite.RandomStream())
111 pubPoly := priPoly.Commit(nil)
112 pubShares := pubPoly.Shares(n)
113
114 recovered, err := RecoverCommit(suite, pubShares, t, n)
115 if err != nil {
116 test.Fatal(err)
117 }
118
119 if !recovered.Equal(pubPoly.Commit()) {
120 test.Fatal("recovered commit does not match initial value")
121 }
122}
123
124func TestPublicRecoveryDelete(test *testing.T) {
125 n := 10

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected