Skip to content

Commit

Permalink
Test coverage for Client ops (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthulhu-rider authored Dec 12, 2024
2 parents c040eb4 + 09b291d commit 0b9bb74
Show file tree
Hide file tree
Showing 35 changed files with 11,106 additions and 1,638 deletions.
599 changes: 161 additions & 438 deletions client/accounting_test.go

Large diffs are not rendered by default.

1,334 changes: 1,317 additions & 17 deletions client/client_test.go

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions client/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ func (c *Client) ContainerDelete(ctx context.Context, id cid.ID, signer neofscry
if signer == nil {
return ErrMissingSigner
}
if signer.Scheme() != neofscrypto.ECDSA_DETERMINISTIC_SHA256 {
return fmt.Errorf("%w: expected ECDSA_DETERMINISTIC_SHA256 scheme", neofscrypto.ErrIncorrectSigner)
}

// sign container ID
var cidV2 refs.ContainerID
Expand All @@ -390,7 +393,7 @@ func (c *Client) ContainerDelete(ctx context.Context, id cid.ID, signer neofscry

if !prm.sigSet {
if err = prm.sig.Calculate(signer, data); err != nil {
err = fmt.Errorf("calculate signature: %w", err)
err = fmt.Errorf("calculate container ID signature: %w", err)
return err
}
}
Expand Down Expand Up @@ -596,12 +599,15 @@ func (c *Client) ContainerSetEACL(ctx context.Context, table eacl.Table, signer
err = ErrMissingEACLContainer
return err
}
if signer.Scheme() != neofscrypto.ECDSA_DETERMINISTIC_SHA256 {
return fmt.Errorf("%w: expected ECDSA_DETERMINISTIC_SHA256 scheme", neofscrypto.ErrIncorrectSigner)
}

// sign the eACL table
eaclV2 := table.ToV2()
if !prm.sigSet {
if err = prm.sig.CalculateMarshalled(signer, eaclV2, nil); err != nil {
err = fmt.Errorf("calculate signature: %w", err)
err = fmt.Errorf("calculate eACL signature: %w", err)
return err
}
}
Expand Down
Loading

0 comments on commit 0b9bb74

Please sign in to comment.