From bb25dd0ea1ef34c9e8ada9604924261bb8689971 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Wed, 11 Jan 2023 14:50:20 +0300 Subject: [PATCH] files: export DAGService --- commonfile/fileservice/fileservice.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commonfile/fileservice/fileservice.go b/commonfile/fileservice/fileservice.go index 0202fb02..0c23a5fc 100644 --- a/commonfile/fileservice/fileservice.go +++ b/commonfile/fileservice/fileservice.go @@ -31,6 +31,8 @@ type FileService interface { GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error) // AddFile adds file to ipfs storage AddFile(ctx context.Context, r io.Reader) (ipld.Node, error) + // DAGService returns ipld.DAGService object + DAGService() ipld.DAGService app.Component } @@ -60,6 +62,10 @@ func (fs *fileService) Name() string { return CName } +func (fs *fileService) DAGService() ipld.DAGService { + return fs.merkledag +} + func (fs *fileService) AddFile(ctx context.Context, r io.Reader) (ipld.Node, error) { dbp := helpers.DagBuilderParams{ Dagserv: fs.merkledag,