MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / TestSmartPoolOnlySubmitPeriodly

Function TestSmartPoolOnlySubmitPeriodly

protocol/smartpool_test.go:172–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func TestSmartPoolOnlySubmitPeriodly(t *testing.T) {
173 sp := newTestSmartPool()
174 ct := sp.Contract.(*testContract)
175 ct.Registered = true
176 sp.AcceptSolution(&testSolution{Counter: big.NewInt(9)})
177 c := sp.Contract.(*testContract)
178 sp.SubmitInterval = 40 * time.Millisecond
179 sp.ShareThreshold = 1
180 sp.Run()
181 if c.GetLastSubmittedClaim() != nil {
182 t.Fail()
183 }
184 time.Sleep(60 * time.Millisecond)
185 if c.GetLastSubmittedClaim() == nil {
186 t.Fail()
187 }
188}
189
190func TestSmartPoolOnlySubmitWhenMeetShareThreshold(t *testing.T) {
191 sp := newTestSmartPool()

Callers

nothing calls this directly

Calls 4

newTestSmartPoolFunction · 0.85
RunMethod · 0.80
GetLastSubmittedClaimMethod · 0.80
AcceptSolutionMethod · 0.65

Tested by

no test coverage detected