(t *testing.T)
| 170 | } |
| 171 | |
| 172 | func 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 | |
| 190 | func TestSmartPoolOnlySubmitWhenMeetShareThreshold(t *testing.T) { |
| 191 | sp := newTestSmartPool() |
nothing calls this directly
no test coverage detected