Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestSPWithCounterReset make it more tolerant #4366

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix test merge issue
  • Loading branch information
algonautshant committed Aug 6, 2022
commit 024f6cba1337328c318584f423931b0d68f6f9f0
13 changes: 10 additions & 3 deletions test/e2e-go/features/stateproofs/stateproofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,10 @@ func TestSPWithTXPoolFull(t *testing.T) {
continue
}
require.Equal(t, string(protocol.StateProofTx), b.Transactions.Transactions[0].Type)
require.Equal(t, uint64(8), b.Transactions.Transactions[0].StateProof.StateProofIntervalLatestRound)
var msg stateproofmsg.Message
err = protocol.Decode(b.Transactions.Transactions[0].StateProof.StateProofMessage, &msg)
require.NoError(t, err)
require.Equal(t, uint64(8), msg.LastAttestedRound)
break
}
require.Less(t, round, uint64(20))
Expand Down Expand Up @@ -1005,7 +1008,12 @@ func TestSPWithCounterReset(t *testing.T) {
for ; tid < len(b.Transactions.Transactions); tid++ {
if b.Transactions.Transactions[tid].Type == string(protocol.StateProofTx) {
require.Equal(t, string(protocol.StateProofTx), b.Transactions.Transactions[tid].Type)
require.Equal(t, int(expectedSPRound), int(b.Transactions.Transactions[tid].StateProof.StateProofIntervalLatestRound))

var msg stateproofmsg.Message
err = protocol.Decode(b.Transactions.Transactions[tid].StateProof.StateProofMessage, &msg)
require.NoError(t, err)
require.Equal(t, int(expectedSPRound), int(msg.LastAttestedRound))

expectedSPRound = expectedSPRound + consensusParams.StateProofInterval
break
}
Expand All @@ -1029,7 +1037,6 @@ func getWellformedSPTransaction(round uint64, genesisHash crypto.Digest, consens
stxn.Txn.FirstValid = basics.Round(round)
stxn.Txn.LastValid = basics.Round(round + 1000)
stxn.Txn.GenesisHash = genesisHash
stxn.Txn.StateProofIntervalLastRound = basics.Round(round - 1)
stxn.Txn.StateProofType = protocol.StateProofBasic
stxn.Txn.StateProof = *proof
stxn.Txn.Message = msg
Expand Down