Skip to content

Commit

Permalink
feat: placeholder paid blob dispersal api
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Oct 8, 2024
1 parent 8bf93ee commit 45df40e
Show file tree
Hide file tree
Showing 6 changed files with 545 additions and 281 deletions.
5 changes: 5 additions & 0 deletions api/clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type DisperserClient interface {
DisperseBlob(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
DisperseBlobAuthenticated(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
GetBlobStatus(ctx context.Context, key []byte) (*disperser_rpc.BlobStatusReply, error)
PaidDisperseBlob(ctx context.Context, data []byte, customQuorums []uint8) (*disperser.BlobStatus, []byte, error)
RetrieveBlob(ctx context.Context, batchHeaderHash []byte, blobIndex uint32) ([]byte, error)
}

Expand Down Expand Up @@ -106,6 +107,10 @@ func (c *disperserClient) DisperseBlob(ctx context.Context, data []byte, quorums
return blobStatus, reply.GetRequestId(), nil
}

func (c *disperserClient) PaidDisperseBlob(ctx context.Context, data []byte, quorums []uint8) (*disperser.BlobStatus, []byte, error) {
return nil, nil, nil
}

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

func (c *MockDisperserClient) PaidDisperseBlob(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 45df40e

Please sign in to comment.