[#822] event/notaryPreparator: Do not pass PACK opcode

Do not pass high level `PACK` opcode to
notary parsers. Add opcode amount check.
Delete `PACK` cases in notary parsers.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-09-10 20:29:15 +03:00 committed by Alex Vanin
parent 4f3de1a9af
commit 3b9ef4f63c
4 changed files with 70 additions and 21 deletions

View file

@ -57,8 +57,6 @@ func ParseDeleteNotary(ne event.NotaryEvent) (event.Event, error) {
deleteFieldSetters[fieldNum](&ev, op.Param())
fieldNum++
case opcode.PUSH0 <= currentOp && currentOp <= opcode.PUSH16 || currentOp == opcode.PACK:
// array packing opcodes. do nothing with it
default:
return nil, event.UnexpectedOpcode(DeleteNotaryEvent, op.Code())
}

View file

@ -64,8 +64,6 @@ func ParseSetEACLNotary(ne event.NotaryEvent) (event.Event, error) {
setEACLFieldSetters[fieldNum](&ev, op.Param())
fieldNum++
case opcode.PUSH0 <= currentOp && currentOp <= opcode.PUSH16 || currentOp == opcode.PACK:
// array packing opcodes. do nothing with it
default:
return nil, event.UnexpectedOpcode(SetEACLNotaryEvent, op.Code())
}

View file

@ -64,8 +64,6 @@ func ParsePutNotary(ne event.NotaryEvent) (event.Event, error) {
putFieldSetters[fieldNum](&ev, op.Param())
fieldNum++
case opcode.PUSH0 <= currentOp && currentOp <= opcode.PUSH16 || currentOp == opcode.PACK:
// array packing opcodes. do nothing with it
default:
return nil, event.UnexpectedOpcode(PutNotaryEvent, op.Code())
}