Skip to content

added pushing handler for virtual operations

Krzysztof Mochocki requested to merge km_virtual_operation_pushing_handler into develop

This fixes bug with shift of positions between pre- and post- push of virtual operations.

Note: pre-push increments virtual_op counter by one, and post-push get last value of virtual_op

Example in case of harfork_operation:

pre-push: { "type": "hardfork_operation", "virtual_op": 3 }
pre-push: { "type": "some_operation", "virtual_op": 4 }
post-push: { "type": "some_operation", "virtual_op": 4 }
pre-push: { "type": "some_operation", "virtual_op": 5 }
post-push: { "type": "some_operation", "virtual_op": 5 }
...
pre-push: { "type": "some_operation", "virtual_op": 99 }
post-push: { "type": "some_operation", "virtual_op": 99 }
post-push: { "type": "hardfork_operation", "virtual_op": 99 } <- exception: same position for diffrent operations

This fix introduces virtual_operation_pushing_handler, which keep primary notification, so situation from above is fixed into this:

pre-push: { "type": "hardfork_operation", "virtual_op": 3 }
pre-push: { "type": "some_operation", "virtual_op": 4 }
post-push: { "type": "some_operation", "virtual_op": 4 }
pre-push: { "type": "some_operation", "virtual_op": 5 }
post-push: { "type": "some_operation", "virtual_op": 5 }
...
pre-push: { "type": "some_operation", "virtual_op": 99 }
post-push: { "type": "some_operation", "virtual_op": 99 }
post-push: { "type": "hardfork_operation", "virtual_op": 3 }

@Ickiewicz @dan @bwrona

Edited by Krzysztof Mochocki

Merge request reports