diff --git a/pkg/morph/event/container/eacl.go b/pkg/morph/event/container/eacl.go index 561ae7c6..5b3e64e9 100644 --- a/pkg/morph/event/container/eacl.go +++ b/pkg/morph/event/container/eacl.go @@ -38,14 +38,18 @@ func (x SetEACL) PublicKey() []byte { } // ParseSetEACL parses SetEACL notification event from list of stack items. +// +// Expects 4 stack items. func ParseSetEACL(items []stackitem.Item) (event.Event, error) { var ( ev SetEACL err error ) - if ln := len(items); ln != 3 { - return nil, event.WrongNumberOfParameters(3, ln) + const expectedItemNumEACL = 4 + + if ln := len(items); ln != expectedItemNumEACL { + return nil, event.WrongNumberOfParameters(expectedItemNumEACL, ln) } // parse table diff --git a/pkg/morph/event/container/eacl_test.go b/pkg/morph/event/container/eacl_test.go index 6cb62a93..67949496 100644 --- a/pkg/morph/event/container/eacl_test.go +++ b/pkg/morph/event/container/eacl_test.go @@ -23,7 +23,7 @@ func TestParseEACL(t *testing.T) { } _, err := container.ParseSetEACL(items) - require.EqualError(t, err, event.WrongNumberOfParameters(3, len(items)).Error()) + require.EqualError(t, err, event.WrongNumberOfParameters(4, len(items)).Error()) }) t.Run("wrong container parameter", func(t *testing.T) { @@ -60,6 +60,7 @@ func TestParseEACL(t *testing.T) { stackitem.NewByteArray(binaryTable), stackitem.NewByteArray(signature), stackitem.NewByteArray(publicKey), + stackitem.NewMap(), }) require.NoError(t, err)