Skip to content

Refactoring of WAX C++ code to provide common implementation layer for Python and WASM targets

Bartek Wrona requested to merge bw_emscripten_base_class into develop

This MR addresses several problems:

  • WASM/Python specific C++ implementations should be separated
  • Since JS does not support native int64, the WASM layer of WAX (exported by emscripten bindings) must offer different methods (where int64 args are splitted into 2 int32 parts). This involved a need to expose only such special overloads to JS environment
  • Solving overload problem like also providing complete interface when wasm implementations have been tied to Python implementations (protocol and proto_protocol classes) lead to exposing all 4 interfaces to JS instead of 3: protocol, proto_protocol and one being a common base of two above (holding i.e. cpp_calculate_public_key method). This, lead to exposing emscripten binding problems (probably due missing explicit base specification at: https://gitlab.syncad.com/hive/wax/-/blob/2661c9e6dcb7c20e843042156adc8e458473b6dc/wasm/src/wasm_interface.cpp#L82 ) which has been patched at commit: 2661c9e6
  • Separating a common code code is a prerequisite for creating separate directory structure in this repo for Python and TS/JS targets.
Edited by Bartek Wrona

Merge request reports