Skip to content

Commit

Permalink
fix: session tree related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Dec 12, 2024
1 parent 8f541cd commit 1ec7990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/relayer/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ func (rs *relayerSessionsManager) deleteExpiredSessionTreesFn(
return
}

// TODO_TEST: Add tests that cover existing expired failed session trees.
for _, sessionTree := range failedSessionTrees {
sessionEndHeight := sessionTree.GetSessionHeader().GetSessionEndBlockHeight()
proofWindowCloseHeight := expirationHeightFn(sharedParams, sessionEndHeight)
Expand Down
6 changes: 3 additions & 3 deletions x/proof/keeper/proof_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func TestEnsureValidProof_Error(t *testing.T) {
desc: "relay must be deserializable",
newProof: func(t *testing.T) *prooftypes.Proof {
// Construct a session tree to which we'll add 1 unserializable relay.
mangledRelaySessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr)
mangledRelaySessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr, ctx)

// Add the mangled relay to the session tree.
err = mangledRelaySessionTree.Update([]byte{1}, mangledRelayBz, 1)
Expand Down Expand Up @@ -444,7 +444,7 @@ func TestEnsureValidProof_Error(t *testing.T) {

// Construct a session tree with 1 relay with a session header containing
// a session ID that doesn't match the expected session ID.
invalidRequestSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr)
invalidRequestSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr, ctx)

// Add the relay to the session tree.
err = invalidRequestSignatureSessionTree.Update([]byte{1}, invalidRequestSignatureRelayBz, 1)
Expand Down Expand Up @@ -505,7 +505,7 @@ func TestEnsureValidProof_Error(t *testing.T) {

// Construct a session tree with 1 relay with a session header containing
// a session ID that doesn't match the expected session ID.
invalidResponseSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr)
invalidResponseSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr, ctx)

// Add the relay to the session tree.
err = invalidResponseSignatureSessionTree.Update([]byte{1}, relayBz, 1)
Expand Down

0 comments on commit 1ec7990

Please sign in to comment.