Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
celestia: add GetIDs, rm logger
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxcanfly committed Oct 16, 2023
1 parent e70b8e4 commit e7d042d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
10 changes: 8 additions & 2 deletions celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package celestia

import (
"context"
"errors"
"fmt"

"github.com/celestiaorg/celestia-app/x/blob/types"
rpc "github.com/celestiaorg/celestia-node/api/rpc/client"
Expand Down Expand Up @@ -37,7 +39,10 @@ func (c *CelestiaDA) Get(ids []da.ID) ([]da.Blob, error) {

func (c *CelestiaDA) GetIDs(height uint64) ([]da.ID, error) {
var ids []da.ID
blobs, err := c.rpc.Blob.GetAll(c.ctx, c.height, []share.Namespace{c.namespace.Bytes()})
blobs, err := c.client.Blob.GetAll(c.ctx, c.height, []share.Namespace{c.namespace})
if errors.Is(err, blob.ErrBlobNotFound) {
return nil, nil
}
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -81,7 +86,8 @@ func (c *CelestiaDA) Submit(daBlobs []da.Blob) ([]da.ID, []da.Proof, error) {
if err != nil {
return nil, nil, err
}
c.logger.Debug("succesfully submitted blobs", "height", height)
//c.logger.Debug("succesfully submitted blobs", "height", height)
fmt.Println("succesfully submitted blobs", "height", height)
return nil, nil, nil
}

Expand Down
7 changes: 5 additions & 2 deletions celestia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package celestia_test

import (
"testing"

"github.com/rollkit/celestia-da"
"github.com/rollkit/go-da/test"
)

func TestCelestiaDA(t *testing.T) {
t.Skip()
// TODO
da := &celestia.CelestiaDA{}
test.RunDATestSuite(t, da)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/celestiaorg/celestia-app v1.0.0-rc18
github.com/celestiaorg/celestia-node v0.11.0-rc15
github.com/celestiaorg/nmt v0.20.0
github.com/rollkit/go-da v0.0.0-20230925162736-97dc8dbc79e4
github.com/rollkit/go-da v0.0.0-20231011220854-6bd21b7f8cdb
github.com/rollkit/rollkit v0.10.4
github.com/tendermint/tendermint v0.35.9
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,8 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rollkit/go-da v0.0.0-20230925162736-97dc8dbc79e4 h1:HJMh8QqB2ywSEhgPbUHE3weIKNc1xBMQ42xu0IibWSY=
github.com/rollkit/go-da v0.0.0-20230925162736-97dc8dbc79e4/go.mod h1:+lzz3OlwFB4xTYnM+DrN4lfs2zoM3VxPfBonZC9ZIAM=
github.com/rollkit/go-da v0.0.0-20231011220854-6bd21b7f8cdb h1:1ALtbTM0YBBX7ZDMeZiB8v39BmtLJCVLLbvgL8IamHU=
github.com/rollkit/go-da v0.0.0-20231011220854-6bd21b7f8cdb/go.mod h1:+lzz3OlwFB4xTYnM+DrN4lfs2zoM3VxPfBonZC9ZIAM=
github.com/rollkit/rollkit v0.10.4 h1:0AFNxPnxwr8ISgOqqQsjRk7TQEZ8yJ8zVnntzJa+i5I=
github.com/rollkit/rollkit v0.10.4/go.mod h1:vpvq3Yzt9oo0yhC118lnvKbNx9Q208RwORpyMceYS8w=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
Expand Down

0 comments on commit e7d042d

Please sign in to comment.