From 1ec79904544a8fd0d4efaf273062b3a9eeb4ed5d Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Thu, 12 Dec 2024 03:08:31 +0100 Subject: [PATCH] fix: session tree related tests --- pkg/relayer/session/session.go | 1 + x/proof/keeper/proof_validation_test.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/relayer/session/session.go b/pkg/relayer/session/session.go index a4f3da9b1..82594a0fd 100644 --- a/pkg/relayer/session/session.go +++ b/pkg/relayer/session/session.go @@ -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) diff --git a/x/proof/keeper/proof_validation_test.go b/x/proof/keeper/proof_validation_test.go index d3389f103..6d21f9c3c 100644 --- a/x/proof/keeper/proof_validation_test.go +++ b/x/proof/keeper/proof_validation_test.go @@ -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) @@ -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) @@ -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)