[#11] Rename contract-related NeoFS occurences

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-01-10 16:07:47 +03:00 committed by fyrchik
parent 9cb4b4cc17
commit 054bc4a727
11 changed files with 34 additions and 34 deletions

View file

@ -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 {

View file

@ -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,

View file

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

View file

@ -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,

View file

@ -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,

View file

@ -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
}

View file

@ -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,

View file

@ -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(&notHaltStateError{state: val.State, exception: val.FaultException})
return nil, wrapFrostFSError(&notHaltStateError{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

View file

@ -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.

View file

@ -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(&notHaltStateError{state: test.State, exception: test.FaultException})
return wrapFrostFSError(&notHaltStateError{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))
}
}

View file

@ -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(&notHaltStateError{state: r.State, exception: r.FaultException})
return wrapFrostFSError(&notHaltStateError{state: r.State, exception: r.FaultException})
}
t.SystemFee += add