[#584] pkg/innerring: Delete using deprecated methods

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-06-02 19:29:19 +03:00 committed by Alex Vanin
parent 057ebf9d51
commit 752efc6f8c
12 changed files with 2 additions and 134 deletions

View file

@ -28,8 +28,6 @@ type (
epochTimerArgs struct {
l *zap.Logger
notaryDisabled bool
nm *netmap.Processor // to handle new epoch tick
cnrWrapper *container.Wrapper // to invoke stop container estimation

View file

@ -450,7 +450,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
nmSrc: nmClient,
clientCache: clientCache,
balanceClient: balClient,
notaryDisabled: server.sideNotaryConfig.disabled,
}
auditCalcDeps := &auditSettlementDeps{
@ -541,7 +540,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
),
AlphabetSyncHandler: alphaSync,
NodeValidator: locodeValidator,
NotaryDisabled: server.sideNotaryConfig.disabled,
FeeProvider: server.feeConfig,
})
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{
Log: log,
PoolSize: cfg.GetInt("workers.reputation"),
NotaryDisabled: server.sideNotaryConfig.disabled,
ReputationContract: server.contracts.reputation,
EpochState: server,
AlphabetState: server,
@ -665,7 +662,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
// initialize epoch timers
server.epochTimer = newEpochTimer(&epochTimerArgs{
l: server.log,
notaryDisabled: server.sideNotaryConfig.disabled,
nm: netmapProcessor,
cnrWrapper: cnrClient,
epoch: server,

View file

@ -68,7 +68,6 @@ type (
nodeValidator NodeValidator
notaryDisabled bool
feeProvider *config.FeeConfig
}
@ -91,7 +90,6 @@ type (
NodeValidator NodeValidator
NotaryDisabled bool
FeeProvider *config.FeeConfig
}
)
@ -154,7 +152,6 @@ func New(p *Params) (*Processor, error) {
nodeValidator: p.NodeValidator,
notaryDisabled: p.NotaryDisabled,
feeProvider: p.FeeProvider,
}, nil
}

View file

@ -28,8 +28,6 @@ type (
log *zap.Logger
pool *ants.Pool
notaryDisabled bool
reputationContract util.Uint160
epochState EpochState
@ -42,7 +40,6 @@ type (
Params struct {
Log *zap.Logger
PoolSize int
NotaryDisabled bool
ReputationContract util.Uint160
EpochState EpochState
AlphabetState AlphabetState
@ -77,7 +74,6 @@ func New(p *Params) (*Processor, error) {
return &Processor{
log: p.Log,
pool: pool,
notaryDisabled: p.NotaryDisabled,
reputationContract: p.ReputationContract,
epochState: p.EpochState,
alphabetState: p.AlphabetState,

View file

@ -46,8 +46,6 @@ type settlementDeps struct {
clientCache *ClientCache
balanceClient *balanceClient.Wrapper
notaryDisabled bool
}
type auditSettlementDeps struct {

View file

@ -43,34 +43,16 @@ func (t *TransferXArgs) SetDetails(v []byte) {
// TransferX directly invokes the call of "transferX" method
// of NeoFS Balance contract.
func (c *Client) TransferX(args TransferXArgs) error {
return c.transferX(false, args)
}
// 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(
err := c.client.Invoke(
c.transferXMethod,
args.sender,
args.recipient,
args.amount,
args.details,
)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.transferXMethod, err)
}
return nil
}

View file

@ -21,16 +21,6 @@ type TransferPrm struct {
//
// If TryNotary is provided, calls notary contract.
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)
if err != nil {
return fmt.Errorf("invalid sender: %w", err)

View file

@ -27,27 +27,9 @@ func (c *Client) StartEstimation(args StartEstimation) error {
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 {
if err := c.client.Invoke(c.stopEstimation, args.epoch); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)
}
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
}

View file

@ -12,18 +12,6 @@ func (w *Wrapper) StartEstimation(epoch uint64) error {
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.
func (w *Wrapper) StopEstimation(epoch uint64) error {
args := container.StopEstimation{}
@ -31,15 +19,3 @@ func (w *Wrapper) StopEstimation(epoch uint64) error {
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)
}

View file

@ -40,22 +40,3 @@ func (c *Client) Put(args PutArgs) error {
}
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
}

View file

@ -43,17 +43,6 @@ func (w *ClientWrapper) Put(v PutArgs) error {
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) {
args := reputationClient.PutArgs{}

View file

@ -96,20 +96,3 @@ func (s StaticClient) TestInvoke(method string, args ...interface{}) ([]stackite
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...,
)
}