[#1689] client/netmap: Remove useless error-handling
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m13s
Pre-commit hooks / Pre-commit (push) Successful in 1m48s
Build / Build Components (push) Successful in 2m19s
Tests and linters / Run gofumpt (push) Successful in 2m22s
Tests and linters / Tests (push) Successful in 3m29s
Tests and linters / Staticcheck (push) Successful in 3m33s
Tests and linters / Lint (push) Successful in 4m17s
Tests and linters / gopls check (push) Successful in 4m26s
OCI image / Build container images (push) Successful in 4m49s
Tests and linters / Tests with -race (push) Successful in 5m17s

No functional changes.

Change-Id: I3a53c992c3ce5e8c6db252abb09aa40626142a97
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-04-05 09:16:25 +03:00
parent d933609084
commit c4f941a5f5
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -25,44 +25,24 @@ const (
// MaxObjectSize receives max object size configuration
// value through the Netmap contract call.
func (c *Client) MaxObjectSize(ctx context.Context) (uint64, error) {
objectSize, err := c.readUInt64Config(ctx, MaxObjectSizeConfig)
if err != nil {
return 0, err
}
return objectSize, nil
return c.readUInt64Config(ctx, MaxObjectSizeConfig)
}
// EpochDuration returns number of sidechain blocks per one FrostFS epoch.
func (c *Client) EpochDuration(ctx context.Context) (uint64, error) {
epochDuration, err := c.readUInt64Config(ctx, EpochDurationConfig)
if err != nil {
return 0, err
}
return epochDuration, nil
return c.readUInt64Config(ctx, EpochDurationConfig)
}
// ContainerFee returns fee paid by container owner to each alphabet node
// for container registration.
func (c *Client) ContainerFee(ctx context.Context) (uint64, error) {
fee, err := c.readUInt64Config(ctx, ContainerFeeConfig)
if err != nil {
return 0, err
}
return fee, nil
return c.readUInt64Config(ctx, ContainerFeeConfig)
}
// ContainerAliasFee returns additional fee paid by container owner to each
// alphabet node for container nice name registration.
func (c *Client) ContainerAliasFee(ctx context.Context) (uint64, error) {
fee, err := c.readUInt64Config(ctx, ContainerAliasFeeConfig)
if err != nil {
return 0, err
}
return fee, nil
return c.readUInt64Config(ctx, ContainerAliasFeeConfig)
}
// HomomorphicHashDisabled returns global configuration value of homomorphic hashing
@ -76,23 +56,13 @@ func (c *Client) HomomorphicHashDisabled(ctx context.Context) (bool, error) {
// InnerRingCandidateFee returns global configuration value of fee paid by
// node to be in inner ring candidates list.
func (c *Client) InnerRingCandidateFee(ctx context.Context) (uint64, error) {
fee, err := c.readUInt64Config(ctx, IrCandidateFeeConfig)
if err != nil {
return 0, err
}
return fee, nil
return c.readUInt64Config(ctx, IrCandidateFeeConfig)
}
// WithdrawFee returns global configuration value of fee paid by user to
// withdraw assets from FrostFS contract.
func (c *Client) WithdrawFee(ctx context.Context) (uint64, error) {
fee, err := c.readUInt64Config(ctx, WithdrawFeeConfig)
if err != nil {
return 0, err
}
return fee, nil
return c.readUInt64Config(ctx, WithdrawFeeConfig)
}
// MaintenanceModeAllowed reads admission of "maintenance" state from the