forked from TrueCloudLab/frostfs-node
[#280] ir: Add frostfs processor unit tests
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
5010b35466
commit
31b4da225a
16 changed files with 491 additions and 104 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"sync"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/balance"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfsid"
|
||||
nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
|
||||
|
@ -36,14 +35,34 @@ type (
|
|||
ToBalancePrecision(int64) int64
|
||||
}
|
||||
|
||||
BalanceClient interface {
|
||||
Mint(p balance.MintPrm) error
|
||||
Lock(p balance.LockPrm) error
|
||||
Burn(p balance.BurnPrm) error
|
||||
}
|
||||
|
||||
NetmapClient interface {
|
||||
SetConfig(p nmClient.SetConfigPrm) error
|
||||
}
|
||||
|
||||
MorphClient interface {
|
||||
GasBalance() (res int64, err error)
|
||||
TransferGas(receiver util.Uint160, amount fixedn.Fixed8) error
|
||||
}
|
||||
|
||||
IDClient interface {
|
||||
AddKeys(p frostfsid.CommonBindPrm) error
|
||||
RemoveKeys(args frostfsid.CommonBindPrm) error
|
||||
}
|
||||
|
||||
// Processor of events produced by frostfs contract in main net.
|
||||
Processor struct {
|
||||
log *logger.Logger
|
||||
pool *ants.Pool
|
||||
frostfsContract util.Uint160
|
||||
balanceClient *balance.Client
|
||||
netmapClient *nmClient.Client
|
||||
morphClient *client.Client
|
||||
balanceClient BalanceClient
|
||||
netmapClient NetmapClient
|
||||
morphClient MorphClient
|
||||
epochState EpochState
|
||||
alphabetState AlphabetState
|
||||
converter PrecisionConverter
|
||||
|
@ -52,8 +71,7 @@ type (
|
|||
mintEmitThreshold uint64
|
||||
mintEmitValue fixedn.Fixed8
|
||||
gasBalanceThreshold int64
|
||||
|
||||
frostfsIDClient *frostfsid.Client
|
||||
frostfsIDClient IDClient
|
||||
}
|
||||
|
||||
// Params of the processor constructor.
|
||||
|
@ -61,10 +79,10 @@ type (
|
|||
Log *logger.Logger
|
||||
PoolSize int
|
||||
FrostFSContract util.Uint160
|
||||
FrostFSIDClient *frostfsid.Client
|
||||
BalanceClient *balance.Client
|
||||
NetmapClient *nmClient.Client
|
||||
MorphClient *client.Client
|
||||
FrostFSIDClient IDClient
|
||||
BalanceClient BalanceClient
|
||||
NetmapClient NetmapClient
|
||||
MorphClient MorphClient
|
||||
EpochState EpochState
|
||||
AlphabetState AlphabetState
|
||||
Converter PrecisionConverter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue