forked from TrueCloudLab/frostfs-node
[#584] pkg/innerring: Delete using deprecated methods
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
057ebf9d51
commit
752efc6f8c
12 changed files with 2 additions and 134 deletions
|
@ -28,8 +28,6 @@ type (
|
||||||
epochTimerArgs struct {
|
epochTimerArgs struct {
|
||||||
l *zap.Logger
|
l *zap.Logger
|
||||||
|
|
||||||
notaryDisabled bool
|
|
||||||
|
|
||||||
nm *netmap.Processor // to handle new epoch tick
|
nm *netmap.Processor // to handle new epoch tick
|
||||||
|
|
||||||
cnrWrapper *container.Wrapper // to invoke stop container estimation
|
cnrWrapper *container.Wrapper // to invoke stop container estimation
|
||||||
|
|
|
@ -450,7 +450,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
||||||
nmSrc: nmClient,
|
nmSrc: nmClient,
|
||||||
clientCache: clientCache,
|
clientCache: clientCache,
|
||||||
balanceClient: balClient,
|
balanceClient: balClient,
|
||||||
notaryDisabled: server.sideNotaryConfig.disabled,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auditCalcDeps := &auditSettlementDeps{
|
auditCalcDeps := &auditSettlementDeps{
|
||||||
|
@ -541,7 +540,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
||||||
),
|
),
|
||||||
AlphabetSyncHandler: alphaSync,
|
AlphabetSyncHandler: alphaSync,
|
||||||
NodeValidator: locodeValidator,
|
NodeValidator: locodeValidator,
|
||||||
NotaryDisabled: server.sideNotaryConfig.disabled,
|
|
||||||
FeeProvider: server.feeConfig,
|
FeeProvider: server.feeConfig,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -645,7 +643,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
||||||
reputationProcessor, err := reputation.New(&reputation.Params{
|
reputationProcessor, err := reputation.New(&reputation.Params{
|
||||||
Log: log,
|
Log: log,
|
||||||
PoolSize: cfg.GetInt("workers.reputation"),
|
PoolSize: cfg.GetInt("workers.reputation"),
|
||||||
NotaryDisabled: server.sideNotaryConfig.disabled,
|
|
||||||
ReputationContract: server.contracts.reputation,
|
ReputationContract: server.contracts.reputation,
|
||||||
EpochState: server,
|
EpochState: server,
|
||||||
AlphabetState: server,
|
AlphabetState: server,
|
||||||
|
@ -665,7 +662,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
|
||||||
// initialize epoch timers
|
// initialize epoch timers
|
||||||
server.epochTimer = newEpochTimer(&epochTimerArgs{
|
server.epochTimer = newEpochTimer(&epochTimerArgs{
|
||||||
l: server.log,
|
l: server.log,
|
||||||
notaryDisabled: server.sideNotaryConfig.disabled,
|
|
||||||
nm: netmapProcessor,
|
nm: netmapProcessor,
|
||||||
cnrWrapper: cnrClient,
|
cnrWrapper: cnrClient,
|
||||||
epoch: server,
|
epoch: server,
|
||||||
|
|
|
@ -68,7 +68,6 @@ type (
|
||||||
|
|
||||||
nodeValidator NodeValidator
|
nodeValidator NodeValidator
|
||||||
|
|
||||||
notaryDisabled bool
|
|
||||||
feeProvider *config.FeeConfig
|
feeProvider *config.FeeConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +90,6 @@ type (
|
||||||
|
|
||||||
NodeValidator NodeValidator
|
NodeValidator NodeValidator
|
||||||
|
|
||||||
NotaryDisabled bool
|
|
||||||
FeeProvider *config.FeeConfig
|
FeeProvider *config.FeeConfig
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -154,7 +152,6 @@ func New(p *Params) (*Processor, error) {
|
||||||
|
|
||||||
nodeValidator: p.NodeValidator,
|
nodeValidator: p.NodeValidator,
|
||||||
|
|
||||||
notaryDisabled: p.NotaryDisabled,
|
|
||||||
feeProvider: p.FeeProvider,
|
feeProvider: p.FeeProvider,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,6 @@ type (
|
||||||
log *zap.Logger
|
log *zap.Logger
|
||||||
pool *ants.Pool
|
pool *ants.Pool
|
||||||
|
|
||||||
notaryDisabled bool
|
|
||||||
|
|
||||||
reputationContract util.Uint160
|
reputationContract util.Uint160
|
||||||
|
|
||||||
epochState EpochState
|
epochState EpochState
|
||||||
|
@ -42,7 +40,6 @@ type (
|
||||||
Params struct {
|
Params struct {
|
||||||
Log *zap.Logger
|
Log *zap.Logger
|
||||||
PoolSize int
|
PoolSize int
|
||||||
NotaryDisabled bool
|
|
||||||
ReputationContract util.Uint160
|
ReputationContract util.Uint160
|
||||||
EpochState EpochState
|
EpochState EpochState
|
||||||
AlphabetState AlphabetState
|
AlphabetState AlphabetState
|
||||||
|
@ -77,7 +74,6 @@ func New(p *Params) (*Processor, error) {
|
||||||
return &Processor{
|
return &Processor{
|
||||||
log: p.Log,
|
log: p.Log,
|
||||||
pool: pool,
|
pool: pool,
|
||||||
notaryDisabled: p.NotaryDisabled,
|
|
||||||
reputationContract: p.ReputationContract,
|
reputationContract: p.ReputationContract,
|
||||||
epochState: p.EpochState,
|
epochState: p.EpochState,
|
||||||
alphabetState: p.AlphabetState,
|
alphabetState: p.AlphabetState,
|
||||||
|
|
|
@ -46,8 +46,6 @@ type settlementDeps struct {
|
||||||
clientCache *ClientCache
|
clientCache *ClientCache
|
||||||
|
|
||||||
balanceClient *balanceClient.Wrapper
|
balanceClient *balanceClient.Wrapper
|
||||||
|
|
||||||
notaryDisabled bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type auditSettlementDeps struct {
|
type auditSettlementDeps struct {
|
||||||
|
|
|
@ -43,34 +43,16 @@ func (t *TransferXArgs) SetDetails(v []byte) {
|
||||||
// TransferX directly invokes the call of "transferX" method
|
// TransferX directly invokes the call of "transferX" method
|
||||||
// of NeoFS Balance contract.
|
// of NeoFS Balance contract.
|
||||||
func (c *Client) TransferX(args TransferXArgs) error {
|
func (c *Client) TransferX(args TransferXArgs) error {
|
||||||
return c.transferX(false, args)
|
err := c.client.Invoke(
|
||||||
}
|
|
||||||
|
|
||||||
// TransferXNotary invokes the call of "transferX" method
|
|
||||||
// of NeoFS Balance contract via notary contract.
|
|
||||||
//
|
|
||||||
// Deprecated: construct underlying StaticClient with TryNotary() option
|
|
||||||
// and use TransferX.
|
|
||||||
func (c *Client) TransferXNotary(args TransferXArgs) error {
|
|
||||||
return c.transferX(true, args)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) transferX(notary bool, args TransferXArgs) error {
|
|
||||||
f := c.client.Invoke
|
|
||||||
if notary {
|
|
||||||
f = c.client.NotaryInvoke
|
|
||||||
}
|
|
||||||
|
|
||||||
err := f(
|
|
||||||
c.transferXMethod,
|
c.transferXMethod,
|
||||||
args.sender,
|
args.sender,
|
||||||
args.recipient,
|
args.recipient,
|
||||||
args.amount,
|
args.amount,
|
||||||
args.details,
|
args.details,
|
||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not invoke method (%s): %w", c.transferXMethod, err)
|
return fmt.Errorf("could not invoke method (%s): %w", c.transferXMethod, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,16 +21,6 @@ type TransferPrm struct {
|
||||||
//
|
//
|
||||||
// If TryNotary is provided, calls notary contract.
|
// If TryNotary is provided, calls notary contract.
|
||||||
func (w *Wrapper) TransferX(p TransferPrm) error {
|
func (w *Wrapper) TransferX(p TransferPrm) error {
|
||||||
return w.transferX(false, p)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TransferXNotary transfers p.Amount of GASe-12 from p.From to p.To
|
|
||||||
// with details p.Details via notary contract.
|
|
||||||
func (w *Wrapper) TransferXNotary(p TransferPrm) error {
|
|
||||||
return w.transferX(true, p)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *Wrapper) transferX(notary bool, p TransferPrm) error {
|
|
||||||
from, err := owner.ScriptHashBE(p.From)
|
from, err := owner.ScriptHashBE(p.From)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("invalid sender: %w", err)
|
return fmt.Errorf("invalid sender: %w", err)
|
||||||
|
|
|
@ -27,27 +27,9 @@ func (c *Client) StartEstimation(args StartEstimation) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: construct underlying StaticClient with TryNotary() option
|
|
||||||
// and use StartEstimation.
|
|
||||||
func (c *Client) StartEstimationNotary(args StartEstimation) error {
|
|
||||||
if err := c.client.NotaryInvoke(c.startEstimation, args.epoch); err != nil {
|
|
||||||
return fmt.Errorf("could not invoke method (%s): %w", c.startEstimation, err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) StopEstimation(args StopEstimation) error {
|
func (c *Client) StopEstimation(args StopEstimation) error {
|
||||||
if err := c.client.Invoke(c.stopEstimation, args.epoch); err != nil {
|
if err := c.client.Invoke(c.stopEstimation, args.epoch); err != nil {
|
||||||
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)
|
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: construct underlying StaticClient with TryNotary() option
|
|
||||||
// and use StopEstimation.
|
|
||||||
func (c *Client) StopEstimationNotary(args StopEstimation) error {
|
|
||||||
if err := c.client.NotaryInvoke(c.stopEstimation, args.epoch); err != nil {
|
|
||||||
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,18 +12,6 @@ func (w *Wrapper) StartEstimation(epoch uint64) error {
|
||||||
return w.client.StartEstimation(args)
|
return w.client.StartEstimation(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartEstimationNotary votes to produce start estimation notification through
|
|
||||||
// notary contract.
|
|
||||||
//
|
|
||||||
// Deprecated: provide TryNotary() option to NewFromMorph
|
|
||||||
// and use StartEstimation.
|
|
||||||
func (w *Wrapper) StartEstimationNotary(epoch uint64) error {
|
|
||||||
args := container.StartEstimation{}
|
|
||||||
args.SetEpoch(int64(epoch))
|
|
||||||
|
|
||||||
return w.client.StartEstimationNotary(args)
|
|
||||||
}
|
|
||||||
|
|
||||||
// StopEstimation votes to produce stop estimation notification.
|
// StopEstimation votes to produce stop estimation notification.
|
||||||
func (w *Wrapper) StopEstimation(epoch uint64) error {
|
func (w *Wrapper) StopEstimation(epoch uint64) error {
|
||||||
args := container.StopEstimation{}
|
args := container.StopEstimation{}
|
||||||
|
@ -31,15 +19,3 @@ func (w *Wrapper) StopEstimation(epoch uint64) error {
|
||||||
|
|
||||||
return w.client.StopEstimation(args)
|
return w.client.StopEstimation(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopEstimationNotary votes to produce stop estimation notification through
|
|
||||||
// notary contract.
|
|
||||||
//
|
|
||||||
// Deprecated: provide TryNotary() option to NewFromMorph
|
|
||||||
// and use StopEstimation.
|
|
||||||
func (w *Wrapper) StopEstimationNotary(epoch uint64) error {
|
|
||||||
args := container.StopEstimation{}
|
|
||||||
args.SetEpoch(int64(epoch))
|
|
||||||
|
|
||||||
return w.client.StopEstimationNotary(args)
|
|
||||||
}
|
|
||||||
|
|
|
@ -40,22 +40,3 @@ func (c *Client) Put(args PutArgs) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutViaNotary invokes notary call of "put reputation value" method of
|
|
||||||
// reputation contract.
|
|
||||||
//
|
|
||||||
// Deprecated: construct underlying StaticClient with TryNotary() option
|
|
||||||
// and use Put.
|
|
||||||
func (c *Client) PutViaNotary(args PutArgs) error {
|
|
||||||
err := c.client.NotaryInvoke(
|
|
||||||
c.putMethod,
|
|
||||||
int64(args.epoch),
|
|
||||||
args.peerID,
|
|
||||||
args.value,
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("could not invoke method (%s): %w", c.putMethod, err)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
|
@ -43,17 +43,6 @@ func (w *ClientWrapper) Put(v PutArgs) error {
|
||||||
return (*reputationClient.Client)(w).Put(args)
|
return (*reputationClient.Client)(w).Put(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutViaNotary invokes notary call of "put reputation value" method of
|
|
||||||
// reputation contract.
|
|
||||||
func (w *ClientWrapper) PutViaNotary(v PutArgs) error {
|
|
||||||
args, err := preparePutArgs(v)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return (*reputationClient.Client)(w).PutViaNotary(args)
|
|
||||||
}
|
|
||||||
|
|
||||||
func preparePutArgs(v PutArgs) (reputationClient.PutArgs, error) {
|
func preparePutArgs(v PutArgs) (reputationClient.PutArgs, error) {
|
||||||
args := reputationClient.PutArgs{}
|
args := reputationClient.PutArgs{}
|
||||||
|
|
||||||
|
|
|
@ -96,20 +96,3 @@ func (s StaticClient) TestInvoke(method string, args ...interface{}) ([]stackite
|
||||||
args...,
|
args...,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotaryInvoke calls NotaryInvoke method of Client with static internal
|
|
||||||
// script hash. Panics if notary support was not enabled in underlying
|
|
||||||
// morph client.
|
|
||||||
//
|
|
||||||
// Deprecated: provide TryNotary() option to NewStatic and use Invoke.
|
|
||||||
func (s StaticClient) NotaryInvoke(method string, args ...interface{}) error {
|
|
||||||
if s.client.notary == nil {
|
|
||||||
panic(notaryNotEnabledPanicMsg)
|
|
||||||
}
|
|
||||||
return s.client.notaryInvoke(
|
|
||||||
false,
|
|
||||||
s.scScriptHash,
|
|
||||||
method,
|
|
||||||
args...,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue