[#280] ir: Add netmap processor unit tests

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-27 17:57:27 +03:00 committed by Evgenii Stratonikov
parent fb5dcc15d2
commit d00b1c0d29
15 changed files with 690 additions and 41 deletions

View file

@ -11,12 +11,12 @@ import (
// NewEpoch is a new epoch Neo:Morph event.
type NewEpoch struct {
num uint64
Num uint64
// txHash is used in notary environmental
// Hash is used in notary environmental
// for calculating unique but same for
// all notification receivers values.
txHash util.Uint256
Hash util.Uint256
}
// MorphEvent implements Neo:Morph Event interface.
@ -24,13 +24,13 @@ func (NewEpoch) MorphEvent() {}
// EpochNumber returns new epoch number.
func (s NewEpoch) EpochNumber() uint64 {
return s.num
return s.Num
}
// TxHash returns hash of the TX with new epoch
// notification.
func (s NewEpoch) TxHash() util.Uint256 {
return s.txHash
return s.Hash
}
// ParseNewEpoch is a parser of new epoch notification event.
@ -52,7 +52,7 @@ func ParseNewEpoch(e *state.ContainedNotificationEvent) (event.Event, error) {
}
return NewEpoch{
num: uint64(prmEpochNum),
txHash: e.Container,
Num: uint64(prmEpochNum),
Hash: e.Container,
}, nil
}