Skip to content

Commit

Permalink
[payments] paid blob dispersal api definitions (Layr-Labs#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen authored Oct 24, 2024
1 parent 977308e commit db3da32
Show file tree
Hide file tree
Showing 14 changed files with 450 additions and 358 deletions.
7 changes: 7 additions & 0 deletions api/clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"
"time"

"github.com/Layr-Labs/eigenda/api"
disperser_rpc "github.com/Layr-Labs/eigenda/api/grpc/disperser"
"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/disperser"
Expand Down Expand Up @@ -42,6 +43,7 @@ type DisperserClient interface {
Close() error
DisperseBlob(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
DisperseBlobAuthenticated(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
DispersePaidBlob(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
GetBlobStatus(ctx context.Context, key []byte) (*disperser_rpc.BlobStatusReply, error)
RetrieveBlob(ctx context.Context, batchHeaderHash []byte, blobIndex uint32) ([]byte, error)
}
Expand Down Expand Up @@ -144,6 +146,11 @@ func (c *disperserClient) DisperseBlob(ctx context.Context, data []byte, quorums
return blobStatus, reply.GetRequestId(), nil
}

// TODO: implemented in subsequent PR
func (c *disperserClient) DispersePaidBlob(ctx context.Context, data []byte, quorums []uint8) (*disperser.BlobStatus, []byte, error) {
return nil, nil, api.NewErrorInternal("not implemented")
}

func (c *disperserClient) DisperseBlobAuthenticated(ctx context.Context, data []byte, quorums []uint8) (*disperser.BlobStatus, []byte, error) {
err := c.initOnceGrpcConnection()
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions api/clients/mock/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ func (c *MockDisperserClient) DisperseBlob(ctx context.Context, data []byte, quo
return status, key, err
}

// TODO: implement in the subsequent PR
func (c *MockDisperserClient) DispersePaidBlob(ctx context.Context, data []byte, quorums []uint8) (*disperser.BlobStatus, []byte, error) {
return nil, nil, nil
}

func (c *MockDisperserClient) GetBlobStatus(ctx context.Context, key []byte) (*disperser_rpc.BlobStatusReply, error) {
args := c.Called(key)
var reply *disperser_rpc.BlobStatusReply
Expand Down
Loading

0 comments on commit db3da32

Please sign in to comment.