diff --git a/pkg/innerring/contracts.go b/pkg/innerring/contracts.go index 094c65d1..4cac9183 100644 --- a/pkg/innerring/contracts.go +++ b/pkg/innerring/contracts.go @@ -63,7 +63,7 @@ func parseContracts(cfg *viper.Viper, morph *client.Client, withoutMainNet, with {"contracts.audit", client.NNSAuditContractName, &result.audit}, {"contracts.reputation", client.NNSReputationContractName, &result.reputation}, {"contracts.subnet", client.NNSSubnetworkContractName, &result.subnet}, - {"contracts.frostfsid", client.NNSNeoFSIDContractName, &result.frostfsID}, + {"contracts.frostfsid", client.NNSFrostFSIDContractName, &result.frostfsID}, } for _, t := range targets { diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 69dfed1d..fa56315c 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -670,7 +670,7 @@ func New(ctx context.Context, log *logger.Logger, cfg *viper.Viper, errChan chan // create governance processor governanceProcessor, err := governance.New(&governance.Params{ Log: log, - NeoFSClient: frostfsCli, + FrostFSClient: frostfsCli, NetmapClient: server.netmapClient, AlphabetState: server, EpochState: server, @@ -743,7 +743,7 @@ func New(ctx context.Context, log *logger.Logger, cfg *viper.Viper, errChan chan PoolSize: cfg.GetInt("workers.container"), AlphabetState: server, ContainerClient: cnrClient, - NeoFSIDClient: frostfsIDClient, + FrostFSIDClient: frostfsIDClient, NetworkState: server.netmapClient, NotaryDisabled: server.sideNotaryConfig.disabled, SubnetClient: subnetClient, @@ -761,7 +761,7 @@ func New(ctx context.Context, log *logger.Logger, cfg *viper.Viper, errChan chan balanceProcessor, err := balance.New(&balance.Params{ Log: log, PoolSize: cfg.GetInt("workers.balance"), - NeoFSClient: frostfsCli, + FrostFSClient: frostfsCli, BalanceSC: server.contracts.balance, AlphabetState: server, Converter: &server.precision, @@ -780,8 +780,8 @@ func New(ctx context.Context, log *logger.Logger, cfg *viper.Viper, errChan chan frostfsProcessor, err := frostfs.New(&frostfs.Params{ Log: log, PoolSize: cfg.GetInt("workers.frostfs"), - NeoFSContract: server.contracts.frostfs, - NeoFSIDClient: frostfsIDClient, + FrostFSContract: server.contracts.frostfs, + FrostFSIDClient: frostfsIDClient, BalanceClient: server.balanceClient, NetmapClient: server.netmapClient, MorphClient: server.morphClient, diff --git a/pkg/innerring/processors/balance/process_assets.go b/pkg/innerring/processors/balance/process_assets.go index 68d7c8dc..197ce555 100644 --- a/pkg/innerring/processors/balance/process_assets.go +++ b/pkg/innerring/processors/balance/process_assets.go @@ -22,7 +22,7 @@ func (bp *Processor) processLock(lock *balanceEvent.Lock) { prm.SetLock(lock.LockAccount()) prm.SetHash(lock.TxHash()) - err := bp.neofsClient.Cheque(prm) + err := bp.frostfsClient.Cheque(prm) if err != nil { bp.log.Error("can't send lock asset tx", zap.Error(err)) } diff --git a/pkg/innerring/processors/balance/processor.go b/pkg/innerring/processors/balance/processor.go index 73eebbd9..b4a4d749 100644 --- a/pkg/innerring/processors/balance/processor.go +++ b/pkg/innerring/processors/balance/processor.go @@ -28,7 +28,7 @@ type ( Processor struct { log *logger.Logger pool *ants.Pool - neofsClient *frostfscontract.Client + frostfsClient *frostfscontract.Client balanceSC util.Uint160 alphabetState AlphabetState converter PrecisionConverter @@ -38,7 +38,7 @@ type ( Params struct { Log *logger.Logger PoolSize int - NeoFSClient *frostfscontract.Client + FrostFSClient *frostfscontract.Client BalanceSC util.Uint160 AlphabetState AlphabetState Converter PrecisionConverter @@ -70,7 +70,7 @@ func New(p *Params) (*Processor, error) { return &Processor{ log: p.Log, pool: pool, - neofsClient: p.NeoFSClient, + frostfsClient: p.FrostFSClient, balanceSC: p.BalanceSC, alphabetState: p.AlphabetState, converter: p.Converter, diff --git a/pkg/innerring/processors/container/processor.go b/pkg/innerring/processors/container/processor.go index b8cc3c8b..a916cc03 100644 --- a/pkg/innerring/processors/container/processor.go +++ b/pkg/innerring/processors/container/processor.go @@ -39,7 +39,7 @@ type ( PoolSize int AlphabetState AlphabetState ContainerClient *container.Client - NeoFSIDClient *frostfsid.Client + FrostFSIDClient *frostfsid.Client SubnetClient *morphsubnet.Client NetworkState NetworkState NotaryDisabled bool @@ -80,7 +80,7 @@ func New(p *Params) (*Processor, error) { return nil, errors.New("ir/container: global state is not set") case p.ContainerClient == nil: return nil, errors.New("ir/container: Container client is not set") - case p.NeoFSIDClient == nil: + case p.FrostFSIDClient == nil: return nil, errors.New("ir/container: NeoFS ID client is not set") case p.NetworkState == nil: return nil, errors.New("ir/container: network state is not set") @@ -100,7 +100,7 @@ func New(p *Params) (*Processor, error) { pool: pool, alphabetState: p.AlphabetState, cnrClient: p.ContainerClient, - idClient: p.NeoFSIDClient, + idClient: p.FrostFSIDClient, netState: p.NetworkState, notaryDisabled: p.NotaryDisabled, subnetClient: p.SubnetClient, diff --git a/pkg/innerring/processors/frostfs/processor.go b/pkg/innerring/processors/frostfs/processor.go index 12634394..ff9eeb95 100644 --- a/pkg/innerring/processors/frostfs/processor.go +++ b/pkg/innerring/processors/frostfs/processor.go @@ -59,8 +59,8 @@ type ( Params struct { Log *logger.Logger PoolSize int - NeoFSContract util.Uint160 - NeoFSIDClient *frostfsid.Client + FrostFSContract util.Uint160 + FrostFSIDClient *frostfsid.Client BalanceClient *balance.Client NetmapClient *nmClient.Client MorphClient *client.Client @@ -113,7 +113,7 @@ func New(p *Params) (*Processor, error) { return &Processor{ log: p.Log, pool: pool, - frostfsContract: p.NeoFSContract, + frostfsContract: p.FrostFSContract, balanceClient: p.BalanceClient, netmapClient: p.NetmapClient, morphClient: p.MorphClient, @@ -126,7 +126,7 @@ func New(p *Params) (*Processor, error) { mintEmitValue: p.MintEmitValue, gasBalanceThreshold: p.GasBalanceThreshold, - frostfsIDClient: p.NeoFSIDClient, + frostfsIDClient: p.FrostFSIDClient, }, nil } diff --git a/pkg/innerring/processors/governance/processor.go b/pkg/innerring/processors/governance/processor.go index 1aa8c281..1c0a6ee9 100644 --- a/pkg/innerring/processors/governance/processor.go +++ b/pkg/innerring/processors/governance/processor.go @@ -84,7 +84,7 @@ type ( MorphClient *client.Client MainnetClient *client.Client - NeoFSClient *frostfscontract.Client + FrostFSClient *frostfscontract.Client NetmapClient *nmClient.Client NotaryDisabled bool @@ -121,7 +121,7 @@ func New(p *Params) (*Processor, error) { return &Processor{ log: p.Log, pool: pool, - frostfsClient: p.NeoFSClient, + frostfsClient: p.FrostFSClient, netmapClient: p.NetmapClient, alphabetState: p.AlphabetState, epochState: p.EpochState, diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index fbe416f1..473a09d7 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -163,7 +163,7 @@ func (e *notHaltStateError) Error() string { var errEmptyInvocationScript = errors.New("got empty invocation script from neo node") -// implementation of error interface for NeoFS-specific errors. +// implementation of error interface for FrostFS-specific errors. type frostfsError struct { err error } @@ -172,8 +172,8 @@ func (e frostfsError) Error() string { return fmt.Sprintf("frostfs error: %v", e.err) } -// wraps NeoFS-specific error into frostfsError. Arg must not be nil. -func wrapNeoFSError(err error) error { +// wraps FrostFS-specific error into frostfsError. Arg must not be nil. +func wrapFrostFSError(err error) error { return frostfsError{err} } @@ -216,7 +216,7 @@ func (c *Client) TestInvoke(contract util.Uint160, method string, args ...interf } if val.State != HaltState { - return nil, wrapNeoFSError(¬HaltStateError{state: val.State, exception: val.FaultException}) + return nil, wrapFrostFSError(¬HaltStateError{state: val.State, exception: val.FaultException}) } return val.Stack, nil @@ -433,7 +433,7 @@ func toStackParameter(value interface{}) (sc.Parameter, error) { result.Type = sc.BoolType result.Value = v default: - return result, wrapNeoFSError(fmt.Errorf("chain/client: unsupported parameter %v", value)) + return result, wrapFrostFSError(fmt.Errorf("chain/client: unsupported parameter %v", value)) } return result, nil diff --git a/pkg/morph/client/nns.go b/pkg/morph/client/nns.go index 616d67b1..cc3412f9 100644 --- a/pkg/morph/client/nns.go +++ b/pkg/morph/client/nns.go @@ -26,8 +26,8 @@ const ( NNSBalanceContractName = "balance.frostfs" // NNSContainerContractName is a name of the container contract in NNS. NNSContainerContractName = "container.frostfs" - // NNSNeoFSIDContractName is a name of the frostfsid contract in NNS. - NNSNeoFSIDContractName = "frostfsid.frostfs" + // NNSFrostFSIDContractName is a name of the frostfsid contract in NNS. + NNSFrostFSIDContractName = "frostfsid.frostfs" // NNSNetmapContractName is a name of the netmap contract in NNS. NNSNetmapContractName = "netmap.frostfs" // NNSProxyContractName is a name of the proxy contract in NNS. diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 334fcda9..c879e6ea 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -243,12 +243,12 @@ func (c *Client) GetNotaryDeposit() (res int64, err error) { } if len(items) != 1 { - return 0, wrapNeoFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, errUnexpectedItems)) + return 0, wrapFrostFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, errUnexpectedItems)) } bigIntDeposit, err := items[0].TryInteger() if err != nil { - return 0, wrapNeoFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, err)) + return 0, wrapFrostFSError(fmt.Errorf("%v: %w", notaryBalanceErrMsg, err)) } return bigIntDeposit.Int64(), nil @@ -475,12 +475,12 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint // check invocation state if test.State != HaltState { - return wrapNeoFSError(¬HaltStateError{state: test.State, exception: test.FaultException}) + return wrapFrostFSError(¬HaltStateError{state: test.State, exception: test.FaultException}) } // if test invocation failed, then return error if len(test.Script) == 0 { - return wrapNeoFSError(errEmptyInvocationScript) + return wrapFrostFSError(errEmptyInvocationScript) } // after test invocation we build main multisig transaction @@ -570,7 +570,7 @@ func (c *Client) notaryCosigners(invokedByAlpha bool, ir []*keys.PublicKey, comm multisigScript, err := sc.CreateMultiSigRedeemScript(m, ir) if err != nil { // wrap error as NeoFS-specific since the call is not related to any client - return nil, wrapNeoFSError(fmt.Errorf("can't create ir multisig redeem script: %w", err)) + return nil, wrapFrostFSError(fmt.Errorf("can't create ir multisig redeem script: %w", err)) } s = append(s, transaction.Signer{ @@ -704,7 +704,7 @@ func (c *Client) notaryMultisigAccount(ir []*keys.PublicKey, committee, invokedB err := multisigAccount.ConvertMultisig(m, ir) if err != nil { // wrap error as NeoFS-specific since the call is not related to any client - return nil, wrapNeoFSError(fmt.Errorf("can't convert account to inner ring multisig wallet: %w", err)) + return nil, wrapFrostFSError(fmt.Errorf("can't convert account to inner ring multisig wallet: %w", err)) } } else { // alphabet multisig redeem script is @@ -713,7 +713,7 @@ func (c *Client) notaryMultisigAccount(ir []*keys.PublicKey, committee, invokedB multisigAccount, err = notary.FakeMultisigAccount(m, ir) if err != nil { // wrap error as NeoFS-specific since the call is not related to any client - return nil, wrapNeoFSError(fmt.Errorf("can't make inner ring multisig wallet: %w", err)) + return nil, wrapFrostFSError(fmt.Errorf("can't make inner ring multisig wallet: %w", err)) } } diff --git a/pkg/morph/client/util.go b/pkg/morph/client/util.go index 82044216..ff8e507f 100644 --- a/pkg/morph/client/util.go +++ b/pkg/morph/client/util.go @@ -98,7 +98,7 @@ func StringFromStackItem(param stackitem.Item) (string, error) { func addFeeCheckerModifier(add int64) func(r *result.Invoke, t *transaction.Transaction) error { return func(r *result.Invoke, t *transaction.Transaction) error { if r.State != HaltState { - return wrapNeoFSError(¬HaltStateError{state: r.State, exception: r.FaultException}) + return wrapFrostFSError(¬HaltStateError{state: r.State, exception: r.FaultException}) } t.SystemFee += add