forked from TrueCloudLab/frostfs-node
[#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:
parent
4f3de1a9af
commit
3b9ef4f63c
4 changed files with 70 additions and 21 deletions
|
@ -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())
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue