Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Sep 21, 2024
1 parent 27d50d2 commit 948a41c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion api/clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ func (c *disperserClient) DisperseBlob(ctx context.Context, data []byte, quorums
}

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")
}

// first check if signer is valid
accountId, err := c.signer.GetAccountID()
if err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("please configure signer key if you want to use authenticated endpoint %w", err)
}

quorumNumbers := make([]uint32, len(quorums))
Expand Down
4 changes: 3 additions & 1 deletion api/clients/eigenda_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ func NewEigenDAClient(log log.Logger, config EigenDAClientConfig) (*EigenDAClien
var signer core.BlobRequestSigner
if len(config.SignerPrivateKeyHex) == 64 {
signer = auth.NewLocalBlobRequestSigner(config.SignerPrivateKeyHex)
} else {
} else if len(config.SignerPrivateKeyHex) == 0 {
signer = auth.NewLocalNoopSigner()
} else {
return nil, fmt.Errorf("invalid length for signer private key")
}

llConfig := NewConfig(host, port, config.ResponseTimeout, !config.DisableTLS)
Expand Down

0 comments on commit 948a41c

Please sign in to comment.