Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.09 KB

README.md

File metadata and controls

41 lines (29 loc) · 1.09 KB

CoreUtils

CoreUtils library contains standard utility functions that can be used by the A1 smart contracts.

Features

CoreUtils library currently supports only basic features:

Features Functions
Crypto - sha512
- ripemd160
String - is_utf8

Once more functionality is added, CoreUtils library will be splitted into several smaller libraries (e.g. Crypto, String, etc.).

Development

Production

Assuming that the WASI SDK toolchain is installed and on the path $WASI_SDK_PATH, one can build CoreUtils library by running following commands:

$ mkdir -p build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF \
    -DWASI_SDK_PREFIX=$WASI_SDK_PATH \
    -DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PATH/share/cmake/wasi-sdk.cmake \
    ..
$ ninja

Testing

Unfortunately, WASI SDK does not yet work well with the GTest library. Therefore, build the tests with the regular Clang/GCC toolchain:

$ mkdir -p build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ..
$ ninja