Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage for Client ops #641

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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
Loading