[#446] innerring: Use alphabet state in processors

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-23 18:20:44 +03:00 committed by Alex Vanin
parent 1332db883e
commit e05f1e1394
17 changed files with 80 additions and 69 deletions

View file

@ -11,9 +11,9 @@ import (
)
type (
// ActiveState is a callback interface for inner ring global state.
ActiveState interface {
IsActive() bool
// AlphabetState is a callback interface for inner ring global state.
AlphabetState interface {
IsAlphabet() bool
}
// Processor of events produced by container contract in morph chain.
@ -22,7 +22,7 @@ type (
pool *ants.Pool
containerContract util.Uint160
morphClient *client.Client
activeState ActiveState
alphabetState AlphabetState
}
// Params of the processor constructor.
@ -31,7 +31,7 @@ type (
PoolSize int
ContainerContract util.Uint160
MorphClient *client.Client
ActiveState ActiveState
AlphabetState AlphabetState
}
)
@ -47,7 +47,7 @@ func New(p *Params) (*Processor, error) {
return nil, errors.New("ir/container: logger is not set")
case p.MorphClient == nil:
return nil, errors.New("ir/container: neo:morph client is not set")
case p.ActiveState == nil:
case p.AlphabetState == nil:
return nil, errors.New("ir/container: global state is not set")
}
@ -63,7 +63,7 @@ func New(p *Params) (*Processor, error) {
pool: pool,
containerContract: p.ContainerContract,
morphClient: p.MorphClient,
activeState: p.ActiveState,
alphabetState: p.AlphabetState,
}, nil
}