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

Function TestSmartPoolSubmitCorrectClaim

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

Source from the content-addressed store, hash-verified

89}
90
91func TestSmartPoolSubmitCorrectClaim(t *testing.T) {
92 sp := newTestSmartPool()
93 sp.ShareThreshold = 1
94 sp.AcceptSolution(&testSolution{Counter: big.NewInt(9)})
95 sp.AcceptSolution(&testSolution{Counter: big.NewInt(8)})
96 sp.AcceptSolution(&testSolution{Counter: big.NewInt(10)})
97 sp.AcceptSolution(&testSolution{Counter: big.NewInt(5)})
98 sp.Submit()
99
100 testContract := sp.Contract.(*testContract)
101 claim := testContract.GetLastSubmittedClaim()
102 if claim.NumShares().Cmp(big.NewInt(4)) != 0 {
103 t.Fail()
104 }
105}
106
107func TestSmartPoolReturnFalseIfNoClaim(t *testing.T) {
108 sp := newTestSmartPool()

Callers

nothing calls this directly

Calls 5

newTestSmartPoolFunction · 0.85
SubmitMethod · 0.80
GetLastSubmittedClaimMethod · 0.80
AcceptSolutionMethod · 0.65
NumSharesMethod · 0.65

Tested by

no test coverage detected