Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 4 additions & 2 deletions internal/round/smt_persistence_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func TestSmtPersistenceAndRestoration(t *testing.T) {

// Verify inclusion proofs work
for _, leaf := range testLeaves {
merkleTreePath := restoredRm.smt.GetPath(leaf.Path)
merkleTreePath, err := restoredRm.smt.GetPath(leaf.Path)
require.NoError(t, err)
require.NotNil(t, merkleTreePath, "Should be able to get Merkle path")
assert.NotEmpty(t, merkleTreePath.Root, "Merkle path should have root hash")
}
Expand Down Expand Up @@ -243,7 +244,8 @@ func TestCompleteWorkflowWithRestart(t *testing.T) {
path, err := commitment.RequestID.GetPath()
require.NoError(t, err, "Should be able to get path from request ID")

merkleTreePath := newRm.smt.GetPath(path)
merkleTreePath, err := newRm.smt.GetPath(path)
require.NoError(t, err)
require.NotNil(t, merkleTreePath, "Should be able to get Merkle path")
assert.NotEmpty(t, merkleTreePath.Root, "Merkle path should have root hash")
assert.NotEmpty(t, merkleTreePath.Steps, "Merkle path should have steps")
Expand Down
5 changes: 4 additions & 1 deletion internal/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ func (as *AggregatorService) GetInclusionProof(ctx context.Context, req *api.Get
if err != nil {
return nil, fmt.Errorf("failed to get path for request ID %s: %w", req.RequestID, err)
}
merkleTreePath := as.roundManager.GetSMT().GetPath(path)
merkleTreePath, err := as.roundManager.GetSMT().GetPath(path)
if err != nil {
return nil, fmt.Errorf("failed to get inclusion proof for request ID %s: %w", req.RequestID, err)
}

// Find the latest block that matches the current SMT root hash
rootHash, err := api.NewHexBytesFromString(merkleTreePath.Root)
Expand Down
Loading