diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml index e2dae281..fdaf9f27 100644 --- a/.github/workflows/guidelines_enforcer.yml +++ b/.github/workflows/guidelines_enforcer.yml @@ -21,5 +21,3 @@ jobs: guidelines_enforcer: name: Call Ledger guidelines_enforcer uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 - with: - relative_app_directory: app diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index 51f5b65a..00000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Sonarcloud - -on: - push: - branches: - - main - pull_request: - branches: - - main - types: [opened, synchronize, reopened] - -jobs: - build: - name: SonarQube analyze - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest - env: - SONAR_SCANNER_VERSION: 4.7.0.2747 - SONAR_SERVER_URL: "https://sonarcloud.io" - BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed - steps: - - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: zulu - - name: Download and set up sonar-scanner - env: - SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip - run: | - export DEBIAN_FRONTEND=noninteractive - apt-get update -y - apt-get upgrade -y - curl -sL https://deb.nodesource.com/setup_16.x | bash - - apt-get install -y gcovr nodejs unzip - mkdir -p $HOME/.sonar - curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH - - name: Download and set up build-wrapper - env: - BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip - run: | - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ - echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH - - name: Run build-wrapper - run: | - build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all - - name: Run sonar-scanner - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" diff --git a/CMakeLists.txt b/CMakeLists.txt index e1bb44d2..5dc02b49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,13 +85,6 @@ file(GLOB_RECURSE TINYCBOR_SRC ${CMAKE_CURRENT_SOURCE_DIR}/deps/tinycbor/src/cborvalidation.c ) -# static libs -file(GLOB_RECURSE TINYPB_SRC - ${CMAKE_CURRENT_SOURCE_DIR}/deps/nanopb_tiny/pb_common.c - ${CMAKE_CURRENT_SOURCE_DIR}/deps/nanopb_tiny/pb_decode.c - ${CMAKE_CURRENT_SOURCE_DIR}/deps/nanopb_tiny/pb_encode.c - ) - file(GLOB_RECURSE LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/hexutils.c ${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/src/app_mode.c @@ -108,14 +101,12 @@ file(GLOB_RECURSE LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_impl.c ${CMAKE_CURRENT_SOURCE_DIR}/app/src/crypto.c ${CMAKE_CURRENT_SOURCE_DIR}/app/src/base32.c - ${CMAKE_CURRENT_SOURCE_DIR}/app/src/protobuf/*.c ${CMAKE_CURRENT_SOURCE_DIR}/app/src/parser_print_*.c ) add_library(app_lib STATIC ${LIB_SRC} ${TINYCBOR_SRC} - ${TINYPB_SRC} ) target_include_directories(app_lib PUBLIC @@ -123,7 +114,6 @@ target_include_directories(app_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/ledger-zxlib/include ${CMAKE_CURRENT_SOURCE_DIR}/deps/tinycbor/src ${CMAKE_CURRENT_SOURCE_DIR}/deps/picohash/ - ${CMAKE_CURRENT_SOURCE_DIR}/deps/nanopb_tiny/ ${CMAKE_CURRENT_SOURCE_DIR}/app/src ${CMAKE_CURRENT_SOURCE_DIR}/app/src/candid ${CMAKE_CURRENT_SOURCE_DIR}/app/src/lib @@ -146,7 +136,6 @@ target_include_directories(unittests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/app/src/lib ${CMAKE_CURRENT_SOURCE_DIR}/deps/tinycbor/src ${CMAKE_CURRENT_SOURCE_DIR}/deps/picohash/ - ${CMAKE_CURRENT_SOURCE_DIR}/deps/nanopb_tiny/ ) @@ -166,7 +155,6 @@ set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOUR if (ENABLE_FUZZING) set(FUZZ_TARGETS parser_parse - parser_protobuf ) foreach (target ${FUZZ_TARGETS}) diff --git a/Makefile b/Makefile index 52ad7147..3470d075 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,6 @@ ifeq ($(BOLOS_SDK),) ZXLIB_COMPILE_STAX ?= 1 include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk -proto: - cd $(CURDIR)/app/src/protobuf && $(CURDIR)/deps/nanopb/generator/protoc ./base_types.proto ./types.proto ./governance.proto ./dfinity.proto --nanopb_out=. - else default: $(MAKE) -C app diff --git a/app/Makefile b/app/Makefile index 49445df7..eacf62e5 100755 --- a/app/Makefile +++ b/app/Makefile @@ -56,8 +56,7 @@ endif APP_LOAD_PARAMS = --curve secp256k1 $(COMMON_LOAD_PARAMS) --path $(APPPATH) -NANOS_STACK_SIZE := 2050 - +APP_STACK_MIN_SIZE := 3000 include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices $(info TARGET_NAME = [$(TARGET_NAME)]) @@ -72,9 +71,6 @@ CFLAGS += -Wvla -Wno-implicit-fallthrough CFLAGS += -I$(MY_DIR)/../deps/tinycbor/src APP_SOURCE_PATH += $(MY_DIR)/../deps/tinycbor-ledger -CFLAGS += -I$(MY_DIR)/../deps/nanopb/ -APP_SOURCE_PATH += $(MY_DIR)/../deps/nanopb_tiny/ - .PHONY: rust rust: @echo "No rust code" diff --git a/app/Makefile.version b/app/Makefile.version index 77eedab5..790ee0f1 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -1,6 +1,6 @@ # This is the major version of this release -APPVERSION_M=2 +APPVERSION_M=3 # This is the minor version of this release -APPVERSION_N=4 +APPVERSION_N=0 # This is the patch version of this release -APPVERSION_P=9 +APPVERSION_P=0 diff --git a/app/src/apdu_handler.c b/app/src/apdu_handler.c index 4bb05fba..792f873c 100644 --- a/app/src/apdu_handler.c +++ b/app/src/apdu_handler.c @@ -73,7 +73,7 @@ __Z_INLINE bool process_chunk(volatile uint32_t *tx, uint32_t rx) { THROW(APDU_CODE_DATA_INVALID); } - bool is_stake_tx = parser_tx_obj.special_transfer_type == neuron_stake_transaction; + const bool is_stake_tx = parser_tx_obj.special_transfer_type == neuron_stake_transaction; uint32_t added; switch (payloadType) { @@ -128,9 +128,9 @@ __Z_INLINE bool process_chunk(volatile uint32_t *tx, uint32_t rx) { __Z_INLINE void handleGetAddr(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx) { extractHDPath(rx, OFFSET_DATA); - uint8_t requireConfirmation = G_io_apdu_buffer[OFFSET_P1]; + const uint8_t requireConfirmation = G_io_apdu_buffer[OFFSET_P1]; - zxerr_t zxerr = app_fill_address(); + const zxerr_t zxerr = app_fill_address(); if (zxerr != zxerr_ok) { *tx = 0; THROW(APDU_CODE_DATA_INVALID); @@ -158,7 +158,7 @@ __Z_INLINE void handleSign(volatile uint32_t *flags, volatile uint32_t *tx, uint CHECK_APP_CANARY() if (error_msg != NULL) { - int error_msg_length = strlen(error_msg); + const uint32_t error_msg_length = strnlen(error_msg, sizeof(G_io_apdu_buffer)); MEMCPY(G_io_apdu_buffer, error_msg, error_msg_length); *tx += (error_msg_length); THROW(APDU_CODE_DATA_INVALID); @@ -181,7 +181,7 @@ __Z_INLINE void handleSignCombined(volatile uint32_t *flags, volatile uint32_t * CHECK_APP_CANARY() if (error_msg != NULL) { - int error_msg_length = strlen(error_msg); + const uint32_t error_msg_length = strnlen(error_msg, sizeof(G_io_apdu_buffer)); MEMCPY(G_io_apdu_buffer, error_msg, error_msg_length); *tx += (error_msg_length); THROW(APDU_CODE_DATA_INVALID); @@ -202,7 +202,9 @@ __Z_INLINE void handle_getversion(__Z_UNUSED volatile uint32_t *flags, volatile G_io_apdu_buffer[1] = LEDGER_MAJOR_VERSION; G_io_apdu_buffer[2] = LEDGER_MINOR_VERSION; G_io_apdu_buffer[3] = LEDGER_PATCH_VERSION; - G_io_apdu_buffer[4] = !IS_UX_ALLOWED; + // sdk won't pass the apdu message if device is locked + // keeping it for backwards compatibility + G_io_apdu_buffer[4] = 0; G_io_apdu_buffer[5] = (TARGET_ID >> 24) & 0xFF; G_io_apdu_buffer[6] = (TARGET_ID >> 16) & 0xFF; @@ -214,7 +216,7 @@ __Z_INLINE void handle_getversion(__Z_UNUSED volatile uint32_t *flags, volatile } void handleApdu(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx) { - uint16_t sw = 0; + volatile uint16_t sw = 0; BEGIN_TRY { @@ -278,7 +280,7 @@ void handleApdu(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx) { break; } G_io_apdu_buffer[*tx] = sw >> 8; - G_io_apdu_buffer[*tx + 1] = sw; + G_io_apdu_buffer[*tx + 1] = sw & 0xFF; *tx += 2; } FINALLY diff --git a/app/src/crypto.c b/app/src/crypto.c index 9238e7fb..c039715a 100644 --- a/app/src/crypto.c +++ b/app/src/crypto.c @@ -22,11 +22,6 @@ uint32_t hdPath[HDPATH_LEN_DEFAULT]; -bool isTestnet() { - return hdPath[0] == HDPATH_0_TESTNET && - hdPath[1] == HDPATH_1_TESTNET; -} - uint8_t const DER_PREFIX[] = {0x30, 0x56, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x0a, 0x03, 0x42, 0x00}; @@ -53,7 +48,7 @@ zxerr_t hash_sha224(uint8_t *input, uint16_t inputLen, uint8_t *output, uint16_t } cx_sha256_t ctx; cx_sha224_init(&ctx); - cx_hash_no_throw(&ctx.header, CX_LAST, input, inputLen, output, 224); + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, CX_LAST, input, inputLen, output, 224)); return zxerr_ok; } @@ -69,11 +64,11 @@ zxerr_t crypto_extractPublicKey(uint8_t *pubKey, uint16_t pubKeyLen) { zxerr_t err = zxerr_ledger_api_error; CATCH_CXERROR(os_derive_bip32_no_throw(CX_CURVE_256K1, hdPath, HDPATH_LEN_DEFAULT, - privateKeyData, NULL)) + privateKeyData, NULL)); - CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey)) - CATCH_CXERROR(cx_ecfp_init_public_key_no_throw(CX_CURVE_256K1, NULL, 0, &cx_publicKey)) - CATCH_CXERROR(cx_ecfp_generate_pair_no_throw(CX_CURVE_256K1, &cx_publicKey, &cx_privateKey, 1)) + CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey)); + CATCH_CXERROR(cx_ecfp_init_public_key_no_throw(CX_CURVE_256K1, NULL, 0, &cx_publicKey)); + CATCH_CXERROR(cx_ecfp_generate_pair_no_throw(CX_CURVE_256K1, &cx_publicKey, &cx_privateKey, 1)); memcpy(pubKey, cx_publicKey.W, SECP256K1_PK_LEN); err = zxerr_ok; @@ -118,36 +113,36 @@ typedef struct { #define HASH_U64(FIELDNAME, FIELDVALUE, TMPDIGEST) { \ MEMZERO(TMPDIGEST,sizeof(TMPDIGEST)); \ cx_hash_sha256((uint8_t *)FIELDNAME, sizeof(FIELDNAME) - 1, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0)); \ uint8_t ingressbuf[10]; \ uint16_t enc_size = 0; \ CHECK_ZXERR(compressLEB128(FIELDVALUE, sizeof(ingressbuf), ingressbuf, &enc_size)); \ cx_hash_sha256((uint8_t *)ingressbuf, enc_size, tmpdigest, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0)); \ } #define HASH_BYTES_INTERMEDIATE(FIELDNAME, FIELDVALUE, TMPDIGEST) { \ MEMZERO(TMPDIGEST,sizeof(TMPDIGEST)); \ cx_hash_sha256((uint8_t *)FIELDNAME, sizeof(FIELDNAME) - 1, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0)); \ cx_hash_sha256((uint8_t *)(FIELDVALUE).data, (FIELDVALUE).len, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0)); \ } #define HASH_BYTES_END(FIELDNAME, FIELDVALUE, TMPDIGEST, ENDDIGEST) { \ MEMZERO(TMPDIGEST,sizeof(TMPDIGEST)); \ cx_hash_sha256((uint8_t *)FIELDNAME, sizeof(FIELDNAME) - 1, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0)); \ cx_hash_sha256((uint8_t *)(FIELDVALUE).data, (FIELDVALUE).len, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, CX_LAST, TMPDIGEST, CX_SHA256_SIZE, ENDDIGEST, CX_SHA256_SIZE); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, CX_LAST, TMPDIGEST, CX_SHA256_SIZE, ENDDIGEST, CX_SHA256_SIZE)); \ } #define HASH_BYTES_PTR_END(FIELDNAME, FIELDVALUE, TMPDIGEST, ENDDIGEST) { \ MEMZERO(TMPDIGEST,sizeof(TMPDIGEST)); \ cx_hash_sha256((uint8_t *)FIELDNAME, sizeof(FIELDNAME) - 1, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, TMPDIGEST, CX_SHA256_SIZE, NULL, 0)); \ cx_hash_sha256((uint8_t *)(FIELDVALUE).dataPtr, (FIELDVALUE).len, TMPDIGEST, CX_SHA256_SIZE); \ - cx_hash_no_throw(&ctx.header, CX_LAST, TMPDIGEST, CX_SHA256_SIZE, ENDDIGEST, CX_SHA256_SIZE); \ + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, CX_LAST, TMPDIGEST, CX_SHA256_SIZE, ENDDIGEST, CX_SHA256_SIZE)); \ } zxerr_t crypto_getDigest(uint8_t *digest, txtype_e txtype){ @@ -178,7 +173,7 @@ zxerr_t crypto_getDigest(uint8_t *digest, txtype_e txtype){ HASH_U64("ingress_expiry",fields->ingress_expiry, tmpdigest); cx_hash_sha256((uint8_t *)"paths", 5, tmpdigest, CX_SHA256_SIZE); - cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0); + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0)); uint8_t arrayBuffer[PATH_MAX_ARRAY * CX_SHA256_SIZE]; for (size_t index = 0; index < fields->paths.arrayLen ; index++){ @@ -186,7 +181,7 @@ zxerr_t crypto_getDigest(uint8_t *digest, txtype_e txtype){ } cx_hash_sha256(arrayBuffer, fields->paths.arrayLen*CX_SHA256_SIZE, tmpdigest, CX_SHA256_SIZE); cx_hash_sha256(tmpdigest, CX_SHA256_SIZE, tmpdigest, CX_SHA256_SIZE); - cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0); + CHECK_CX_OK(cx_hash_no_throw(&ctx.header, 0, tmpdigest, CX_SHA256_SIZE, NULL, 0)); HASH_BYTES_END("request_type", parser_tx_obj.request_type, tmpdigest, digest); return zxerr_ok; @@ -205,8 +200,7 @@ zxerr_t crypto_sign(uint8_t *signatureBuffer, return zxerr_buffer_too_small; } - uint8_t message_digest[CX_SHA256_SIZE]; - MEMZERO(message_digest,sizeof(message_digest)); + uint8_t message_digest[CX_SHA256_SIZE] = {0}; signatureBuffer[0] = 0x0a; MEMCPY(&signatureBuffer[1], (uint8_t *)"ic-request",SIGN_PREFIX_SIZE - 1); @@ -228,9 +222,9 @@ zxerr_t crypto_sign(uint8_t *signatureBuffer, CATCH_CXERROR(os_derive_bip32_no_throw(CX_CURVE_SECP256K1, hdPath, HDPATH_LEN_DEFAULT, - privateKeyData, NULL)) + privateKeyData, NULL)); - CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_SECP256K1, privateKeyData, 32, &cx_privateKey)) + CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_SECP256K1, privateKeyData, 32, &cx_privateKey)); // Sign CATCH_CXERROR(cx_ecdsa_sign_no_throw(&cx_privateKey, @@ -240,7 +234,7 @@ zxerr_t crypto_sign(uint8_t *signatureBuffer, CX_SHA256_SIZE, signature->der_signature, &signatureLength, - &info)) + &info)); err_convert_e err_c = convertDERtoRSV(signature->der_signature, info, signature->r, signature->s, &signature->v); if (err_c != no_error) { @@ -309,9 +303,9 @@ zxerr_t crypto_sign_combined(uint8_t *signatureBuffer, CATCH_CXERROR(os_derive_bip32_no_throw(CX_CURVE_SECP256K1, hdPath, HDPATH_LEN_DEFAULT, - privateKeyData, NULL)) + privateKeyData, NULL)); - CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_SECP256K1, privateKeyData, 32, &cx_privateKey)) + CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_SECP256K1, privateKeyData, 32, &cx_privateKey)); // Sign request CATCH_CXERROR(cx_ecdsa_sign_no_throw(&cx_privateKey, @@ -321,7 +315,7 @@ zxerr_t crypto_sign_combined(uint8_t *signatureBuffer, CX_SHA256_SIZE, sigma.der_signature, &sigLen, - &info)) + &info)); err_convert_e err_c = convertDERtoRSV(sigma.der_signature, info, sigma.r, sigma.s, &sigma.v); if (err_c != no_error) { @@ -343,7 +337,7 @@ zxerr_t crypto_sign_combined(uint8_t *signatureBuffer, CX_SHA256_SIZE, sigma.der_signature, &sigLen, - &info)) + &info)); err_c = convertDERtoRSV(sigma.der_signature, info, sigma.r, sigma.s, &sigma.v); if (err_c != no_error) { @@ -665,9 +659,7 @@ zxerr_t crypto_fillAddress(uint8_t *buffer, uint16_t buffer_len, uint16_t *addrL CHECK_ZXERR(crypto_computePrincipal(answer->publicKey, answer->principalBytes)); //For now only defeault subaccount, maybe later grab 32 bytes from the apdu buffer. - uint8_t zero_subaccount[DFINITY_SUBACCOUNT_LEN]; - MEMZERO(zero_subaccount, DFINITY_SUBACCOUNT_LEN); - + uint8_t zero_subaccount[DFINITY_SUBACCOUNT_LEN] = {0}; CHECK_ZXERR(crypto_principalToSubaccount(answer->principalBytes, sizeof_field(answer_t, principalBytes), zero_subaccount, DFINITY_SUBACCOUNT_LEN, answer->subAccountBytes, sizeof_field(answer_t, subAccountBytes))); diff --git a/app/src/crypto.h b/app/src/crypto.h index b4759327..81306e26 100644 --- a/app/src/crypto.h +++ b/app/src/crypto.h @@ -30,8 +30,6 @@ extern "C" { extern uint32_t hdPath[HDPATH_LEN_DEFAULT]; -bool isTestnet(); - zxerr_t crypto_extractPublicKey(uint8_t *pubKey, uint16_t pubKeyLen); zxerr_t crypto_computePrincipal(const uint8_t *pubKey, uint8_t *principal); diff --git a/app/src/parser.c b/app/src/parser.c index 694cc2ab..dff40e5d 100644 --- a/app/src/parser.c +++ b/app/src/parser.c @@ -28,7 +28,6 @@ #include "timeutils.h" #include "parser_print_candid.h" #include "parser_print_helper.h" -#include "parser_print_protobuf.h" #if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) // For some reason NanoX requires this function @@ -201,16 +200,6 @@ parser_error_t parser_getItem(const parser_context_t *ctx, switch (parser_tx_obj.txtype) { case call: { switch (parser_tx_obj.tx_fields.call.method_type) { - case pb_sendrequest: - case pb_manageneuron: - case pb_listneurons: - case pb_claimneurons: { - return parser_getItemProtobuf(displayIdx, - outKey, outKeyLen, - outVal, outValLen, - pageIdx, pageCount); - } - case candid_manageneuron: case candid_listneurons: case candid_updatenodeprovider: diff --git a/app/src/parser_impl.c b/app/src/parser_impl.c index 06fb9a76..d6f023f4 100644 --- a/app/src/parser_impl.c +++ b/app/src/parser_impl.c @@ -20,9 +20,6 @@ #include "parser_txdef.h" #include "cbor.h" #include "app_mode.h" -#include "pb_decode.h" -#include "protobuf/dfinity.pb.h" -#include "protobuf/governance.pb.h" #include "candid_parser.h" parser_tx_t parser_tx_obj; @@ -245,56 +242,8 @@ parser_error_t parsePaths(CborValue *content_map, state_read_t *stateRead) { return parser_ok; } -#define GEN_PARSER_PB(OBJ) parser_error_t _parser_pb_ ## OBJ(parser_tx_t *v, uint8_t *buffer, size_t bufferLen) \ -{ \ - OBJ request = OBJ ##_init_zero; \ - pb_istream_t stream = pb_istream_from_buffer(buffer, bufferLen); \ - CHECK_APP_CANARY() \ - const bool status = pb_decode(&stream, OBJ ##_fields, &request); \ - if (!status) { return parser_unexpected_error; } \ - MEMCPY(&v->tx_fields.call.data.OBJ, &request, sizeof(OBJ)); \ - CHECK_APP_CANARY() \ - return parser_ok; \ -} \ - - -GEN_PARSER_PB(SendRequest) - -GEN_PARSER_PB(ic_nns_governance_pb_v1_ManageNeuron) - -GEN_PARSER_PB(ListNeurons) - parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type) { switch (v->tx_fields.call.method_type) { - case pb_manageneuron: { - pb_size_t command = v->tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron.which_command; - - switch (command) { - case Configure: { - pb_size_t operation = v->tx_fields.call - .data.ic_nns_governance_pb_v1_ManageNeuron - .command.configure.which_operation; - - if (1 <= operation && operation <= 7 && operation != 6) { - *mn_type = (manageNeuron_e) (2000 + operation); - return parser_ok; - } - - return parser_unexpected_type; - } - - case Disburse: - case Spawn: - case Follow: - case RegisterVote: - *mn_type = command; - return parser_ok; - - default: { - return parser_unexpected_type; - } - } - } case candid_manageneuron: { if (!v->tx_fields.call.data.candid_manageNeuron.has_command) { return parser_unexpected_value; @@ -304,10 +253,10 @@ parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type const bool isSNS = v->tx_fields.call.is_sns; switch (command->hash) { case hash_command_Spawn: - *mn_type = SpawnCandid; + *mn_type = Spawn; return parser_ok; case hash_command_StakeMaturity: - *mn_type = isSNS ? SNS_StakeMaturity : StakeMaturityCandid; + *mn_type = isSNS ? SNS_StakeMaturity : StakeMaturity; return parser_ok; case hash_command_Split: *mn_type = Split; @@ -316,10 +265,10 @@ parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type *mn_type = Merge; return parser_ok; case hash_command_RegisterVote: - *mn_type = RegisterVoteCandid; + *mn_type = RegisterVote; return parser_ok; case hash_command_Follow: - *mn_type = FollowCandid; + *mn_type = Follow; return parser_ok; case hash_command_Configure: { if (!command->configure.has_operation) { @@ -327,31 +276,31 @@ parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type } switch (command->configure.operation.hash) { case hash_operation_SetDissolvedTimestamp: - *mn_type = isSNS ? SNS_Configure_SetDissolveDelay : Configure_SetDissolvedTimestamp; + *mn_type = isSNS ? SNS_Configure_SetDissolveDelay : Configure_SetDissolvedDelay; break; case hash_operation_LeaveNeuronsFund: - *mn_type = Configure_LeaveNeuronsFundCandid; + *mn_type = Configure_LeaveNeuronsFund; break; case hash_operation_ChangeAutoStakeMaturity: *mn_type = Configure_ChangeAutoStakeMaturity; break; case hash_operation_IncreaseDissolveDelay: - *mn_type = Configure_IncreaseDissolveDelayCandid; + *mn_type = Configure_IncreaseDissolveDelay; break; case hash_operation_StartDissolving: - *mn_type = isSNS ? SNS_Configure_StartDissolving : Configure_StartDissolvingCandid; + *mn_type = isSNS ? SNS_Configure_StartDissolving : Configure_StartDissolving; break; case hash_operation_StopDissolving: - *mn_type = isSNS ? SNS_Configure_StopDissolving : Configure_StopDissolvingCandid; + *mn_type = isSNS ? SNS_Configure_StopDissolving : Configure_StopDissolving; break; case hash_operation_JoinNeuronsFund: - *mn_type = Configure_JoinNeuronsFundCandid; + *mn_type = Configure_JoinNeuronsFund; break; case hash_operation_AddHotkey: - *mn_type = Configure_AddHotkeyCandid; + *mn_type = Configure_AddHotkey; break; case hash_operation_RemoveHotkey: - *mn_type = Configure_RemoveHotkeyCandid; + *mn_type = Configure_RemoveHotkey; break; default: return parser_unexpected_value; @@ -365,7 +314,7 @@ parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type *mn_type = SNS_RemoveNeuronPermissions; return parser_ok; case sns_hash_command_Disburse: - *mn_type = isSNS ? SNS_Disburse : DisburseCandid; + *mn_type = isSNS ? SNS_Disburse : Disburse; return parser_ok; default: @@ -382,35 +331,9 @@ parser_error_t getManageNeuronType(const parser_tx_t *v, manageNeuron_e *mn_type parser_error_t readPayload(parser_tx_t *v, uint8_t *buffer, size_t bufferLen) { char *method = v->tx_fields.call.method_name.data; - manageNeuron_e mn_type; v->tx_fields.call.is_sns = 0; // we'll set this var later if is sns - // Depending on the method, we may try to read protobuf or candid - - if (strcmp(method, "send_pb") == 0) { - v->tx_fields.call.method_type = pb_sendrequest; - return _parser_pb_SendRequest(v, buffer, bufferLen); - } - - if (strcmp(method, "manage_neuron_pb") == 0) { - v->tx_fields.call.method_type = pb_manageneuron; - CHECK_PARSER_ERR(_parser_pb_ic_nns_governance_pb_v1_ManageNeuron(v, buffer, bufferLen)) - return getManageNeuronType(v, &mn_type); - } - - if (strcmp(method, "list_neurons_pb") == 0) { - v->tx_fields.call.method_type = pb_listneurons; - return _parser_pb_ListNeurons(v, buffer, bufferLen); - } - - if (strcmp(method, "claim_neurons") == 0) { - if (130 <= bufferLen && bufferLen <= 150) { - v->tx_fields.call.method_type = pb_claimneurons; - return parser_ok; - } - } - // Candid NNS + SNS if (strcmp(method, "manage_neuron") == 0) { v->tx_fields.call.method_type = candid_manageneuron; @@ -445,31 +368,6 @@ parser_error_t readPayload(parser_tx_t *v, uint8_t *buffer, size_t bufferLen) { return parser_unexpected_type; } -static bool isCandidTransaction(parser_tx_t *v) { - char *method = v->tx_fields.call.method_name.data; - if (strcmp(method, "manage_neuron") == 0) { - return true; - } - - if (strcmp(method, "update_node_provider") == 0) { - return true; - } - - if (strcmp(method, "list_neurons") == 0) { - return true; - } - - if (strcmp(method, "icrc1_transfer") == 0) { - return true; - } - - if (strcmp(method, "transfer") == 0) { - return true; - } - - return false; -} - parser_error_t readContent(CborValue *content_map, parser_tx_t *v) { CborValue content_it; zemu_log_stack("read content"); @@ -504,17 +402,11 @@ parser_error_t readContent(CborValue *content_map, parser_tx_t *v) { READ_STRING(content_map, "method_name", fields->method_name) READ_INT64(content_map, "ingress_expiry", fields->ingress_expiry) - if (isCandidTransaction(v)) { - READ_STRING_PTR_SIZE(content_map, "arg", fields->method_args.dataPtr, fields->method_args.len) - if (fields->method_args.dataPtr == NULL) { - return parser_no_data; - } - CHECK_PARSER_ERR(readPayload(v, fields->method_args.dataPtr, fields->method_args.len)) - } else { - READ_STRING(content_map, "arg", fields->method_args) - CHECK_PARSER_ERR(readPayload(v, fields->method_args.data, fields->method_args.len)) - fields->method_args.dataPtr = fields->method_args.data; + READ_STRING_PTR_SIZE(content_map, "arg", fields->method_args.dataPtr, fields->method_args.len) + if (fields->method_args.dataPtr == NULL) { + return parser_no_data; } + CHECK_PARSER_ERR(readPayload(v, fields->method_args.dataPtr, fields->method_args.len)) } else if (strcmp(v->request_type.data, "read_state") == 0) { state_read_t *fields = &v->tx_fields.stateRead; @@ -600,24 +492,16 @@ parser_error_t readEnvelope(const parser_context_t *c, parser_tx_t *v) { parser_error_t checkPossibleCanisters(const parser_tx_t *v, char *canister_textual) { switch (v->tx_fields.call.method_type) { - case candid_transfer: - case pb_sendrequest : { + case candid_transfer: { CHECK_METHOD_WITH_CANISTER("ryjl3tyaaaaaaaaaaabacai") } - case pb_listneurons : - case pb_manageneuron : case candid_updatenodeprovider: case candid_listneurons: case candid_manageneuron: { if (v->tx_fields.call.is_sns) return parser_ok; // sns has dynamic canister id CHECK_METHOD_WITH_CANISTER("rrkahfqaaaaaaaaaaaaqcai") } - - case pb_claimneurons : { - CHECK_METHOD_WITH_CANISTER("renrkeyaaaaaaaaaaadacai") - } - case candid_icrc_transfer: { return parser_ok; } @@ -644,12 +528,6 @@ parser_error_t _validateTx(__Z_UNUSED const parser_context_t *c, const parser_tx return parser_unexpected_value; } - if (v->tx_fields.call.method_type == pb_manageneuron) { - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - PARSER_ASSERT_OR_ERROR(fields->has_id ^ (fields->neuron_id_or_subaccount.neuron_id.id != 0), - parser_unexpected_error); - } - const uint8_t *canisterId = v->tx_fields.call.canister_id.data; char canister_textual[50]; uint16_t outLen = sizeof(canister_textual); @@ -728,10 +606,12 @@ parser_error_t _validateTx(__Z_UNUSED const parser_context_t *c, const parser_tx } } else { const bool is_candid = v->tx_fields.call.method_type == candid_transfer; - uint64_t memo = is_candid ? v->tx_fields.call.data.candid_transfer.memo - : v->tx_fields.call.data.SendRequest.memo.memo; - const uint8_t *to = is_candid ? v->tx_fields.call.data.candid_transfer.to - : v->tx_fields.call.data.SendRequest.to.hash; + if ( !is_candid ){ + return parser_unexpected_type; + } + uint64_t memo = v->tx_fields.call.data.candid_transfer.memo; + const uint8_t *to = v->tx_fields.call.data.candid_transfer.to; + PARSER_ASSERT_OR_ERROR( zxerr_ok == crypto_principalToStakeAccount(sender, DFINITY_PRINCIPAL_LEN, memo, to_hash, sizeof(to_hash)), @@ -752,53 +632,38 @@ uint8_t getNumItemsManageNeurons(__Z_UNUSED const parser_context_t *c, const par } switch (mn_type) { - case Configure_StopDissolving : case Configure_JoinNeuronsFund : case Configure_LeaveNeuronsFund : - case Configure_JoinNeuronsFundCandid: - case Configure_LeaveNeuronsFundCandid: - case Configure_StartDissolving : { return 2; - } - case Spawn : case Split: case Merge: - case Configure_RemoveHotKey : - case Configure_AddHotKey : - case Configure_RemoveHotkeyCandid: - case Configure_AddHotkeyCandid: + case Configure_RemoveHotkey : + case Configure_AddHotkey : case Configure_IncreaseDissolveDelay: - case Configure_IncreaseDissolveDelayCandid: case Configure_ChangeAutoStakeMaturity: - case Configure_SetDissolvedTimestamp: { + case Configure_SetDissolvedDelay: { return 3; } case SNS_Configure_SetDissolveDelay: - case RegisterVote : - case RegisterVoteCandid: - case DisburseCandid: - case Disburse : { + case RegisterVote: + case Disburse: { return 4; } - case SpawnCandid: { + case Spawn: { // 2 fields + opt(percentage_to_spawn) + controller (opt or self) + opt(nonce) return 3 + (v->tx_fields.call.data.candid_manageNeuron.command.spawn.has_percentage_to_spawn ? 1 : 0) + (v->tx_fields.call.data.candid_manageNeuron.command.spawn.has_nonce ? 1 : 0); } - case Configure_StartDissolvingCandid: - case Configure_StopDissolvingCandid: + case Configure_StartDissolving: + case Configure_StopDissolving: return 2; - case StakeMaturityCandid: + case StakeMaturity: // 2 fields + opt(percentage_to_stake) return 2 + (v->tx_fields.call.data.candid_manageNeuron.command.stake.has_percentage_to_stake ? 1 : 0); - case Follow : { - pb_size_t follow_count = v->tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron.command.follow.followees_count; - return follow_count > 0 ? 3 + follow_count : 4; - } - case FollowCandid: { + case Follow: { uint8_t followees_count = v->tx_fields.call.data.candid_manageNeuron.command.follow.followees_size; return followees_count > 0 ? 3 + followees_count : 4; } @@ -831,8 +696,7 @@ uint8_t _getNumItems(__Z_UNUSED const parser_context_t *c, const parser_tx_t *v) switch (v->txtype) { case call: { switch (v->tx_fields.call.method_type) { - case candid_transfer: - case pb_sendrequest: { + case candid_transfer: { const bool is_stake_tx = v->special_transfer_type == neuron_stake_transaction; uint8_t itemCount = 6; @@ -843,16 +707,11 @@ uint8_t _getNumItems(__Z_UNUSED const parser_context_t *c, const parser_tx_t *v) return itemCount; } - case pb_claimneurons : - case pb_listneurons : { - return 1; - } case candid_updatenodeprovider: { return 2; } - case pb_manageneuron : case candid_manageneuron: { return getNumItemsManageNeurons(c, v); } diff --git a/app/src/parser_print_candid.c b/app/src/parser_print_candid.c index 5d3ab1c8..05109710 100644 --- a/app/src/parser_print_candid.c +++ b/app/src/parser_print_candid.c @@ -1201,13 +1201,13 @@ __Z_INLINE parser_error_t parser_getItemManageNeuron(const parser_context_t *ctx CHECK_PARSER_ERR(getManageNeuronType(&parser_tx_obj, &mn_type)) switch (mn_type) { - case Configure_SetDissolvedTimestamp: { + case Configure_SetDissolvedDelay: { return parser_getItemSetDissolveTimestamp(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } case Configure_ChangeAutoStakeMaturity: { return parser_getItemChangeAutoStakeMaturity(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } - case SpawnCandid: { + case Spawn: { return parser_getItemSpawnCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } case Split: { @@ -1216,25 +1216,25 @@ __Z_INLINE parser_error_t parser_getItemManageNeuron(const parser_context_t *ctx case Merge: { return parser_getItemMerge(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } - case StakeMaturityCandid: { + case StakeMaturity: { return parser_getItemStakeMaturityCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } - case DisburseCandid: + case Disburse: return parser_getItemDisburseCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case RegisterVoteCandid: + case RegisterVote: return parser_getItemRegisterVoteCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case FollowCandid: + case Follow: return parser_getItemFollowCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case Configure_IncreaseDissolveDelayCandid: { + case Configure_IncreaseDissolveDelay: { return parser_getItemIncreaseDissolveDelayCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); } - case Configure_AddHotkeyCandid: - case Configure_RemoveHotkeyCandid: + case Configure_AddHotkey: + case Configure_RemoveHotkey: return parser_getItemConfigureAddRemoveHotkeyCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case Configure_JoinNeuronsFundCandid: - case Configure_LeaveNeuronsFundCandid: - case Configure_StartDissolvingCandid: - case Configure_StopDissolvingCandid: + case Configure_JoinNeuronsFund: + case Configure_LeaveNeuronsFund: + case Configure_StartDissolving: + case Configure_StopDissolving: return parser_getItemConfigureNoElementsCandid(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); case SNS_Configure_StartDissolving: case SNS_Configure_StopDissolving: diff --git a/app/src/parser_print_protobuf.c b/app/src/parser_print_protobuf.c deleted file mode 100644 index 5cc1235c..00000000 --- a/app/src/parser_print_protobuf.c +++ /dev/null @@ -1,831 +0,0 @@ -/******************************************************************************* -* (c) 2018 - 2023 Zondax AG -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -********************************************************************************/ -#include "parser_print_protobuf.h" -#include "parser_print_helper.h" -#include "parser_print_strings.h" -#include "parser_txdef.h" -#include -#include - -__Z_INLINE parser_error_t print_accountBytes(sender_t sender, - const SendRequest *sendrequest, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - uint8_t address[32]; - MEMZERO(address, sizeof(address)); - - zxerr_t err = crypto_principalToSubaccount(sender.data, (uint16_t) sender.len, - sendrequest->from_subaccount.sub_account, 32, - address, sizeof(address)); - if (err != zxerr_ok) { - return parser_unexpected_error; - } - - return page_hexstring_with_delimiters(address, sizeof(address), outVal, outValLen, pageIdx, pageCount); -} - -static parser_error_t parser_getItemTokenTransfer(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - MEMZERO(outKey, outKeyLen); - MEMZERO(outVal, outValLen); - snprintf(outKey, outKeyLen, "?"); - snprintf(outVal, outValLen, "?"); - *pageCount = 1; - - const call_t *fields = &parser_tx_obj.tx_fields.call; - - const bool is_stake_tx = parser_tx_obj.special_transfer_type == neuron_stake_transaction; - if (is_stake_tx) { - return parser_unexpected_error; - } - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Send ICP"); - return parser_ok; - } - - if (app_mode_expert()) { - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Sender "); - return print_principal(fields->sender.data, (uint16_t) fields->sender.len, outVal, outValLen, pageIdx, pageCount); - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Subaccount "); - if (fields->data.SendRequest.has_from_subaccount) { - return page_hexstring_with_delimiters(fields->data.SendRequest.from_subaccount.sub_account, - DFINITY_ADDR_LEN, outVal, outValLen, pageIdx, pageCount); - } - snprintf(outVal, outValLen, "Not set"); - return parser_ok; - } - displayIdx -= 2; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "From account"); - return print_accountBytes(fields->sender, &fields->data.SendRequest, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 2) { - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.has_to, parser_unexpected_number_items) - snprintf(outKey, outKeyLen, "To account "); - return page_hexstring_with_delimiters(fields->data.SendRequest.to.hash, 32, - outVal, outValLen, pageIdx, pageCount); - } - - if (displayIdx == 3) { - snprintf(outKey, outKeyLen, "Amount (ICP)"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.payment.has_receiver_gets, parser_unexpected_number_items) - return print_ICP(fields->data.SendRequest.payment.receiver_gets.e8s, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 4) { - snprintf(outKey, outKeyLen, "Maximum fee (ICP)"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.has_max_fee, parser_unexpected_number_items) - return print_ICP(fields->data.SendRequest.max_fee.e8s, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 5) { - snprintf(outKey, outKeyLen, "Memo"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.has_memo, parser_unexpected_number_items) - return print_u64(fields->data.SendRequest.memo.memo, outVal, outValLen, pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemStakeNeuron(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - MEMZERO(outKey, outKeyLen); - MEMZERO(outVal, outValLen); - snprintf(outKey, outKeyLen, "?"); - snprintf(outVal, outValLen, "?"); - *pageCount = 1; - - const call_t *fields = &parser_tx_obj.tx_fields.call; - - const bool is_stake_tx = parser_tx_obj.special_transfer_type == neuron_stake_transaction; - if (!is_stake_tx) { - return parser_unexpected_error; - } - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Stake Neuron"); - return parser_ok; - } - - if (app_mode_expert()) { - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Sender "); - return print_principal(fields->sender.data, (uint16_t) fields->sender.len, outVal, outValLen, pageIdx, pageCount); - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Subaccount "); - if (fields->data.SendRequest.has_from_subaccount) { - return page_hexstring_with_delimiters(fields->data.SendRequest.from_subaccount.sub_account, 32, - outVal, outValLen, pageIdx, pageCount); - } - snprintf(outVal, outValLen, "Not set"); - return parser_ok; - } - displayIdx -= 2; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "From account"); - return print_accountBytes(fields->sender, &fields->data.SendRequest, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Amount (ICP)"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.payment.has_receiver_gets, parser_unexpected_number_items) - return print_ICP(fields->data.SendRequest.payment.receiver_gets.e8s, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 3) { - snprintf(outKey, outKeyLen, "Maximum fee (ICP)"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.has_max_fee, parser_unexpected_number_items) - return print_ICP(fields->data.SendRequest.max_fee.e8s, - outVal, outValLen, - pageIdx, pageCount); - } - - if (displayIdx == 4) { - snprintf(outKey, outKeyLen, "Memo"); - PARSER_ASSERT_OR_ERROR(fields->data.SendRequest.has_memo, parser_unexpected_number_items) - return print_u64(fields->data.SendRequest.memo.memo, outVal, outValLen, pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemClaimNeuron(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen) { - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Claim Neurons"); - return parser_ok; - } - - return parser_no_data; -} - -static parser_error_t parser_getItemListNeurons(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen) { - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "List Own Neurons"); - return parser_ok; - } - - return parser_no_data; -} - -static parser_error_t parser_getItemIncreaseNeuronTimer(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, INCREASE_DISSOLVE_DELAY); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Additional Delay"); - - if (fields->command.configure.operation.increase_dissolve_delay.additional_dissolve_delay_seconds == 0) { - snprintf(outVal, outValLen, "0s"); - return parser_ok; - } - - char buffer[100]; - MEMZERO(buffer, sizeof(buffer)); - uint64_t value = 0; - MEMCPY(&value, - &fields->command.configure.operation.increase_dissolve_delay.additional_dissolve_delay_seconds, - 4); - - CHECK_PARSER_ERR(parser_printDelay(value, buffer, sizeof(buffer))) - pageString(outVal, outValLen, buffer, pageIdx, pageCount); - return parser_ok; - } - return parser_no_data; -} - -static parser_error_t parser_getItemJoinNeuronsFund(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Join Neurons' Fund"); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - return parser_no_data; -} - -static parser_error_t parser_getItemStartStopDissolve(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - - manageNeuron_e mn_type; - CHECK_PARSER_ERR(getManageNeuronType(&parser_tx_obj, &mn_type)) - - if (mn_type == Configure_StartDissolving) { - snprintf(outVal, outValLen, "Start Dissolving"); - } else { - snprintf(outVal, outValLen, "Stop Dissolving"); - } - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } else if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } else { - //Only accept neuron_id - return parser_unexpected_type; - } - } - - return parser_no_data; -} - -static parser_error_t parser_getItemSpawn(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Spawn Neuron"); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Controller "); - if (!fields->command.spawn.has_new_controller) { - - snprintf(outVal, outValLen, "Self"); - return parser_ok; - } - - PARSER_ASSERT_OR_ERROR(fields->command.spawn.new_controller.serialized_id.size <= 29, - parser_value_out_of_range) - - return print_principal(fields->command.spawn.new_controller.serialized_id.bytes, - DFINITY_PRINCIPAL_LEN, - outVal, outValLen, - pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemAddRemoveHotkey(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - - manageNeuron_e mn_type; - CHECK_PARSER_ERR(getManageNeuronType(&parser_tx_obj, &mn_type)) - - if (mn_type == Configure_AddHotKey) { - snprintf(outVal, outValLen, "Add Hotkey"); - } else { - snprintf(outVal, outValLen, "Remove Hotkey"); - } - - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Principal "); - manageNeuron_e mn_type; - CHECK_PARSER_ERR(getManageNeuronType(&parser_tx_obj, &mn_type)) - - if (mn_type == Configure_AddHotKey) { - PARSER_ASSERT_OR_ERROR(fields->command.configure.operation.add_hot_key.has_new_hot_key, - parser_unexpected_number_items) - PARSER_ASSERT_OR_ERROR(fields->command.configure.operation.add_hot_key.new_hot_key.serialized_id.size <= 29, - parser_value_out_of_range) - return print_principal(fields->command.configure.operation.add_hot_key.new_hot_key.serialized_id.bytes, 29, - outVal, outValLen, pageIdx, pageCount); - } - - PARSER_ASSERT_OR_ERROR(fields->command.configure.operation.remove_hot_key.has_hot_key_to_remove, - parser_unexpected_number_items) - PARSER_ASSERT_OR_ERROR( - fields->command.configure.operation.remove_hot_key.hot_key_to_remove.serialized_id.size <= 29, - parser_value_out_of_range) - - return print_principal( - fields->command.configure.operation.remove_hot_key.hot_key_to_remove.serialized_id.bytes, 29, - outVal, outValLen, pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemDisburse(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Disburse Neuron"); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Disburse To "); - - if (!fields->command.disburse.has_to_account) { - snprintf(outVal, outValLen, "Self"); - return parser_ok; - } - - PARSER_ASSERT_OR_ERROR(fields->command.disburse.to_account.hash.size == 32, parser_context_unexpected_size) - - return page_hexstring_with_delimiters(fields->command.disburse.to_account.hash.bytes, - fields->command.disburse.to_account.hash.size, - outVal, outValLen, pageIdx, pageCount); - } - - if (displayIdx == 3) { - snprintf(outKey, outKeyLen, "Amount (ICP)"); - - if (!fields->command.disburse.has_amount) { - snprintf(outVal, outValLen, "All"); - return parser_ok; - } - - return print_ICP(fields->command.disburse.amount.e8s, outVal, outValLen, pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemRegisterVote(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Register Vote"); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Proposal ID"); - char buffer[100]; - MEMZERO(buffer, sizeof(buffer)); - uint64_t value = 0; - MEMCPY(&value, &fields->command.register_vote.proposal.id, 8); - return print_u64(value, outVal, outValLen, pageIdx, pageCount); - } - - if (displayIdx == 3) { - snprintf(outKey, outKeyLen, "Vote"); - ic_nns_governance_pb_v1_Vote v = fields->command.register_vote.vote; - - if (v == 0) { - return parser_unexpected_value; - } - - snprintf(outVal, outValLen, v == 1 ? "Yes" : "No"); - return parser_ok; - } - - return parser_no_data; -} - -static parser_error_t parser_getItemFollow(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - *pageCount = 1; - - const ic_nns_governance_pb_v1_ManageNeuron *fields = &parser_tx_obj.tx_fields.call.data.ic_nns_governance_pb_v1_ManageNeuron; - - if (displayIdx == 0) { - snprintf(outKey, outKeyLen, "Transaction type"); - snprintf(outVal, outValLen, "Follow"); - return parser_ok; - } - - if (displayIdx == 1) { - snprintf(outKey, outKeyLen, "Neuron ID"); - PARSER_ASSERT_OR_ERROR(!(fields->has_id && (fields->which_neuron_id_or_subaccount == 12 || - fields->which_neuron_id_or_subaccount == 11)), - parser_unexpected_number_items) - - if (fields->has_id) { - return print_u64(fields->id.id, outVal, outValLen, pageIdx, pageCount); - } - - if (fields->which_neuron_id_or_subaccount == 12) { - return print_u64(fields->neuron_id_or_subaccount.neuron_id.id, outVal, outValLen, pageIdx, pageCount); - } - - //Only accept neuron_id - return parser_unexpected_type; - } - - if (displayIdx == 2) { - snprintf(outKey, outKeyLen, "Topic"); - ic_nns_governance_pb_v1_Topic topic = fields->command.follow.topic; - - switch (topic) { - case ic_nns_governance_pb_v1_Topic_TOPIC_UNSPECIFIED : { - snprintf(outVal, outValLen, "Default"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_NEURON_MANAGEMENT : { - snprintf(outVal, outValLen, "Neuron Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_EXCHANGE_RATE : { - snprintf(outVal, outValLen, "Exchange Rate"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_NETWORK_ECONOMICS : { - snprintf(outVal, outValLen, "Network Economics"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_GOVERNANCE : { - snprintf(outVal, outValLen, "Governance"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_NODE_ADMIN : { - snprintf(outVal, outValLen, "Node Admin"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_PARTICIPANT_MANAGEMENT : { - snprintf(outVal, outValLen, "Participant Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_SUBNET_MANAGEMENT : { - snprintf(outVal, outValLen, "Subnet Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_NETWORK_CANISTER_MANAGEMENT : { - snprintf(outVal, outValLen, "Network Canister Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_KYC : { - snprintf(outVal, outValLen, "KYC"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_NODE_PROVIDER_REWARDS : { - snprintf(outVal, outValLen, "Node Provider Rewards"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_SNS_DECENTRALIZATION_SALE : { - snprintf(outVal, outValLen, "SNS Decentralization Swap"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_SUBNET_REPLICA_VERSION_MANAGEMENT : { - snprintf(outVal, outValLen, "Subnet Replica Version Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_REPLICA_VERSION_MANAGEMENT : { - snprintf(outVal, outValLen, "Replica Version Management"); - return parser_ok; - } - case ic_nns_governance_pb_v1_Topic_TOPIC_SNS_AND_COMMUNITY_FUND : { - snprintf(outVal, outValLen, "SNS & Neurons' Fund"); - return parser_ok; - } - default: { - return parser_unexpected_type; - } - } - } - - uint8_t new_displayIdx = displayIdx - 3; - pb_size_t follow_count = fields->command.follow.followees_count; - - if (follow_count > 99) { - //check for number of chars, but the real limit is lower - return parser_unexpected_number_items; - } - - if (follow_count == 0) { - if (new_displayIdx == 0) { - snprintf(outKey, outKeyLen, "Followees"); - snprintf(outVal, outValLen, "None"); - return parser_ok; - } - - return parser_unexpected_number_items; - } - - if (new_displayIdx < follow_count) { - uint64_t id = fields->command.follow.followees[new_displayIdx].id; - new_displayIdx++; //higher by 1 - char buffer[100]; - MEMZERO(buffer, sizeof(buffer)); - uint16_t index = 0; - MEMCPY(buffer, (char *) "Followees (", 11); - index += 11; - - uint8_t tens = new_displayIdx / 10; - if (tens > 0) { - char ten = (char) ('0' + tens); - MEMCPY(buffer + index, &ten, 1); - index++; - } - - uint8_t ones = new_displayIdx % 10; - char one = (char) ('0' + ones); - MEMCPY(buffer + index, &one, 1); - index++; - MEMCPY(buffer + index, ")", 1); - snprintf(outKey, outKeyLen, "%s", buffer); - return print_u64(id, outVal, outValLen, pageIdx, pageCount); - } - - return parser_no_data; -} - -static parser_error_t parser_getItemManageNeuron(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - MEMZERO(outKey, outKeyLen); - MEMZERO(outVal, outValLen); - snprintf(outKey, outKeyLen, "?"); - snprintf(outVal, outValLen, "?"); - *pageCount = 1; - - manageNeuron_e mn_type; - CHECK_PARSER_ERR(getManageNeuronType(&parser_tx_obj, &mn_type)) - - switch (mn_type) { - case Configure_IncreaseDissolveDelay: - return parser_getItemIncreaseNeuronTimer(displayIdx, - outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case Configure_JoinNeuronsFund : - return parser_getItemJoinNeuronsFund(displayIdx, - outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - case Configure_StopDissolving : - case Configure_StartDissolving : { - return parser_getItemStartStopDissolve(displayIdx, - outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - } - case Spawn : { - return parser_getItemSpawn(displayIdx, - outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - } - case Configure_RemoveHotKey: - case Configure_AddHotKey: - return parser_getItemAddRemoveHotkey(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - - case Disburse : - return parser_getItemDisburse(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - - case RegisterVote : - return parser_getItemRegisterVote(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - - case Follow: - return parser_getItemFollow(displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount); - - default: - return parser_no_data; - } -} - -parser_error_t parser_getItemProtobuf(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount) { - - MEMZERO(outKey, outKeyLen); - MEMZERO(outVal, outValLen); - - *pageCount = 1; - switch (parser_tx_obj.tx_fields.call.method_type) { - case pb_sendrequest : { - const bool is_stake_tx = parser_tx_obj.special_transfer_type == neuron_stake_transaction; - - if (is_stake_tx) { - return parser_getItemStakeNeuron(displayIdx, - outKey, outKeyLen, - outVal, outValLen, - pageIdx, pageCount); - } - - return parser_getItemTokenTransfer( displayIdx, - outKey, outKeyLen, - outVal, outValLen, - pageIdx, pageCount); - } - - case pb_manageneuron: { - return parser_getItemManageNeuron(displayIdx, - outKey, outKeyLen, - outVal, outValLen, - pageIdx, pageCount); - } - - case pb_listneurons : { - return parser_getItemListNeurons(displayIdx, - outKey, outKeyLen, - outVal, outValLen); - } - - case pb_claimneurons : { - return parser_getItemClaimNeuron(displayIdx, - outKey, outKeyLen, - outVal, outValLen); - } - - default: - ZEMU_LOGF(50, "Protobuf type not supported\n") - break; - } - - return parser_unexpected_type; -} diff --git a/app/src/parser_print_protobuf.h b/app/src/parser_print_protobuf.h deleted file mode 100644 index 262f6bf3..00000000 --- a/app/src/parser_print_protobuf.h +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* -* (c) 2018 - 2023 Zondax AG -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -********************************************************************************/ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "candid_types.h" -#include "parser_common.h" - -parser_error_t parser_getItemProtobuf(uint8_t displayIdx, - char *outKey, uint16_t outKeyLen, - char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount); - -#ifdef __cplusplus -} -#endif diff --git a/app/src/parser_txdef.h b/app/src/parser_txdef.h index 94f390ee..a713759f 100644 --- a/app/src/parser_txdef.h +++ b/app/src/parser_txdef.h @@ -17,11 +17,7 @@ #include #include - -#define ZX_NO_CPP - -#include "protobuf/dfinity.pb.h" -#include "protobuf/governance.pb.h" +#include #ifdef __cplusplus extern "C" { @@ -38,8 +34,6 @@ extern "C" { #define METHOD_MAX_LEN 20 #define NONCE_MAX_LEN 32 -#define ARG_MAX_LEN 1000 - #define PATH_MAX_LEN 40 #define PATH_MAX_ARRAY 2 @@ -50,12 +44,6 @@ typedef enum { } txtype_e; typedef enum { - pb_unknown = 0x00, //default is not accepted - pb_sendrequest = 0x01, - pb_manageneuron = 0x02, - pb_listneurons = 0x03, - pb_claimneurons = 0x04, - candid_transfer = 0xF001, candid_manageneuron = 0xF002, candid_updatenodeprovider = 0xF003, @@ -66,47 +54,32 @@ typedef enum { typedef enum { wrong_operation = 0, //default is not accepted - Configure = 2, - Configure_IncreaseDissolveDelay = 2001, - Configure_StartDissolving = 2002, - Configure_StopDissolving = 2003, - Configure_AddHotKey = 2004, - Configure_RemoveHotKey = 2005, - Configure_SetDissolvedTimestamp = 2006, - Configure_JoinNeuronsFund = 2007, - Configure_LeaveNeuronsFund = 2008, - Configure_ChangeAutoStakeMaturity = 2009, - -//// + Merge = 1, + Spawn = 2, Disburse = 3, - Spawn = 4, - Follow = 5, - RegisterVote = 7, -// Register_Vote = 10, - Split = 11, -// DisburseToNeuron = 12, -// ClaimOrRefresh = 13, - Merge = 1000, - SpawnCandid = 1001, - StakeMaturityCandid = 1002, - Configure_IncreaseDissolveDelayCandid = 1003, - Configure_StartDissolvingCandid = 1004, - Configure_StopDissolvingCandid = 1005, - DisburseCandid = 1006, - Configure_JoinNeuronsFundCandid = 1007, - Configure_LeaveNeuronsFundCandid = 1008, - Configure_AddHotkeyCandid = 1009, - Configure_RemoveHotkeyCandid = 1010, - RegisterVoteCandid = 1011, - FollowCandid = 1012, - - SNS_AddNeuronPermissions = 3000, - SNS_RemoveNeuronPermissions = 3001, - SNS_Configure_StartDissolving = 3002, - SNS_Configure_StopDissolving = 3003, - SNS_Disburse = 3004, - SNS_StakeMaturity = 3005, - SNS_Configure_SetDissolveDelay = 3006, + StakeMaturity = 4, + RegisterVote = 5, + Follow = 6, + Split = 7, + + Configure_SetDissolvedDelay = 100, + Configure_IncreaseDissolveDelay = 101, + Configure_StartDissolving = 102, + Configure_StopDissolving = 103, + Configure_JoinNeuronsFund = 104, + Configure_LeaveNeuronsFund = 105, + Configure_AddHotkey = 106, + Configure_RemoveHotkey = 107, + Configure_ChangeAutoStakeMaturity = 108, + + SNS_AddNeuronPermissions = 200, + SNS_RemoveNeuronPermissions = 201, + SNS_Disburse = 202, + SNS_StakeMaturity = 203, + + SNS_Configure_StartDissolving = 300, + SNS_Configure_StopDissolving = 301, + SNS_Configure_SetDissolveDelay = 302, } manageNeuron_e; typedef enum { @@ -141,7 +114,6 @@ typedef struct { } nonce_t; typedef struct { - uint8_t data[ARG_MAX_LEN + 1]; uint8_t *dataPtr; size_t len; } method_arg_t; @@ -173,12 +145,9 @@ typedef struct { uint8_t is_sns; union { - ic_nns_governance_pb_v1_ManageNeuron ic_nns_governance_pb_v1_ManageNeuron; candid_ManageNeuron_t candid_manageNeuron; candid_UpdateNodeProvider_t candid_updateNodeProvider; candid_ListNeurons_t candid_listNeurons; - SendRequest SendRequest; - ListNeurons ListNeurons; sns_ManageNeuron_t sns_manageNeuron; icrc_transfer_t icrcTransfer; candid_transfer_t candid_transfer; @@ -191,9 +160,6 @@ typedef struct { pathArray_t paths; } state_read_t; -/// -/// - typedef struct { txtype_e txtype; // union selector diff --git a/app/src/protobuf/base_types.options b/app/src/protobuf/base_types.options deleted file mode 100644 index de85624b..00000000 --- a/app/src/protobuf/base_types.options +++ /dev/null @@ -1 +0,0 @@ -ic_base_types.pb.v1.PrincipalId.serialized_id max_size:30 diff --git a/app/src/protobuf/base_types.pb.c b/app/src/protobuf/base_types.pb.c deleted file mode 100644 index 84a491b9..00000000 --- a/app/src/protobuf/base_types.pb.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ - -#include "base_types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ic_base_types_pb_v1_PrincipalId, ic_base_types_pb_v1_PrincipalId, AUTO) - - -PB_BIND(ic_base_types_pb_v1_CanisterId, ic_base_types_pb_v1_CanisterId, AUTO) - - -PB_BIND(ic_base_types_pb_v1_NeuronId, ic_base_types_pb_v1_NeuronId, AUTO) - - -PB_BIND(ic_base_types_pb_v1_ProposalId, ic_base_types_pb_v1_ProposalId, AUTO) - - -PB_BIND(ic_base_types_pb_v1_MethodAuthzInfo, ic_base_types_pb_v1_MethodAuthzInfo, AUTO) - - -PB_BIND(ic_base_types_pb_v1_CanisterAuthzInfo, ic_base_types_pb_v1_CanisterAuthzInfo, AUTO) - - - - - diff --git a/app/src/protobuf/base_types.pb.h b/app/src/protobuf/base_types.pb.h deleted file mode 100644 index ef35efd2..00000000 --- a/app/src/protobuf/base_types.pb.h +++ /dev/null @@ -1,149 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ - -#ifndef PB_IC_BASE_TYPES_PB_V1_BASE_TYPES_PB_H_INCLUDED -#define PB_IC_BASE_TYPES_PB_V1_BASE_TYPES_PB_H_INCLUDED - -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* A descriptor of the authorization of all the update methods in a - canister that require authorization. - Methods that should be accessible to anyone should not appear in this list */ -typedef struct _ic_base_types_pb_v1_CanisterAuthzInfo { - pb_callback_t methods_authz; -} ic_base_types_pb_v1_CanisterAuthzInfo; - -/* A PB container for a CanisterId, which uniquely identifies - a principal. */ -typedef struct _ic_base_types_pb_v1_CanisterId { - pb_callback_t serialized_id; -} ic_base_types_pb_v1_CanisterId; - -/* A descriptor of the authorization of a single method. - Any of the principals in the list are authorized to execute - the method. */ -typedef struct _ic_base_types_pb_v1_MethodAuthzInfo { - pb_callback_t method_name; - pb_callback_t principal_ids; -} ic_base_types_pb_v1_MethodAuthzInfo; - -/* A container for a NeuronId blob, which uniquely identifies - a Neuron. */ -typedef struct _ic_base_types_pb_v1_NeuronId { - uint64_t id; -} ic_base_types_pb_v1_NeuronId; - -typedef PB_BYTES_ARRAY_T(30) ic_base_types_pb_v1_PrincipalId_serialized_id_t; -/* A PB container for a PrincipalId, which uniquely identifies - a principal. */ -typedef struct _ic_base_types_pb_v1_PrincipalId { - ic_base_types_pb_v1_PrincipalId_serialized_id_t serialized_id; -} ic_base_types_pb_v1_PrincipalId; - -/* The id of a specific proposal. */ -typedef struct _ic_base_types_pb_v1_ProposalId { - uint64_t id; -} ic_base_types_pb_v1_ProposalId; - - -/* Extensions */ -/* Extension field ic_base_types_pb_v1_tui_signed_message was skipped because only "optional" - type of extension fields is currently supported. */ -/* Extension field ic_base_types_pb_v1_tui_signed_display_q2_2021 was skipped because only "optional" - type of extension fields is currently supported. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ic_base_types_pb_v1_PrincipalId_init_default {{0, {0}}} -#define ic_base_types_pb_v1_CanisterId_init_default {{{NULL}, NULL}} -#define ic_base_types_pb_v1_NeuronId_init_default {0} -#define ic_base_types_pb_v1_ProposalId_init_default {0} -#define ic_base_types_pb_v1_MethodAuthzInfo_init_default {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_base_types_pb_v1_CanisterAuthzInfo_init_default {{{NULL}, NULL}} -#define ic_base_types_pb_v1_PrincipalId_init_zero {{0, {0}}} -#define ic_base_types_pb_v1_CanisterId_init_zero {{{NULL}, NULL}} -#define ic_base_types_pb_v1_NeuronId_init_zero {0} -#define ic_base_types_pb_v1_ProposalId_init_zero {0} -#define ic_base_types_pb_v1_MethodAuthzInfo_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_base_types_pb_v1_CanisterAuthzInfo_init_zero {{{NULL}, NULL}} - -/* Field tags (for use in manual encoding/decoding) */ -#define ic_base_types_pb_v1_CanisterAuthzInfo_methods_authz_tag 1 -#define ic_base_types_pb_v1_CanisterId_serialized_id_tag 1 -#define ic_base_types_pb_v1_MethodAuthzInfo_method_name_tag 1 -#define ic_base_types_pb_v1_MethodAuthzInfo_principal_ids_tag 2 -#define ic_base_types_pb_v1_NeuronId_id_tag 2 -#define ic_base_types_pb_v1_PrincipalId_serialized_id_tag 1 -#define ic_base_types_pb_v1_ProposalId_id_tag 1 -#define ic_base_types_pb_v1_tui_signed_message_tag 20000 -#define ic_base_types_pb_v1_tui_signed_display_q2_2021_tag 20001 - -/* Struct field encoding specification for nanopb */ -#define ic_base_types_pb_v1_PrincipalId_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BYTES, serialized_id, 1) -#define ic_base_types_pb_v1_PrincipalId_CALLBACK NULL -#define ic_base_types_pb_v1_PrincipalId_DEFAULT NULL - -#define ic_base_types_pb_v1_CanisterId_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, serialized_id, 1) -#define ic_base_types_pb_v1_CanisterId_CALLBACK pb_default_field_callback -#define ic_base_types_pb_v1_CanisterId_DEFAULT NULL - -#define ic_base_types_pb_v1_NeuronId_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, id, 2) -#define ic_base_types_pb_v1_NeuronId_CALLBACK NULL -#define ic_base_types_pb_v1_NeuronId_DEFAULT NULL - -#define ic_base_types_pb_v1_ProposalId_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, id, 1) -#define ic_base_types_pb_v1_ProposalId_CALLBACK NULL -#define ic_base_types_pb_v1_ProposalId_DEFAULT NULL - -#define ic_base_types_pb_v1_MethodAuthzInfo_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, method_name, 1) \ -X(a, CALLBACK, REPEATED, BYTES, principal_ids, 2) -#define ic_base_types_pb_v1_MethodAuthzInfo_CALLBACK pb_default_field_callback -#define ic_base_types_pb_v1_MethodAuthzInfo_DEFAULT NULL - -#define ic_base_types_pb_v1_CanisterAuthzInfo_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, methods_authz, 1) -#define ic_base_types_pb_v1_CanisterAuthzInfo_CALLBACK pb_default_field_callback -#define ic_base_types_pb_v1_CanisterAuthzInfo_DEFAULT NULL -#define ic_base_types_pb_v1_CanisterAuthzInfo_methods_authz_MSGTYPE ic_base_types_pb_v1_MethodAuthzInfo - -extern const pb_msgdesc_t ic_base_types_pb_v1_PrincipalId_msg; -extern const pb_msgdesc_t ic_base_types_pb_v1_CanisterId_msg; -extern const pb_msgdesc_t ic_base_types_pb_v1_NeuronId_msg; -extern const pb_msgdesc_t ic_base_types_pb_v1_ProposalId_msg; -extern const pb_msgdesc_t ic_base_types_pb_v1_MethodAuthzInfo_msg; -extern const pb_msgdesc_t ic_base_types_pb_v1_CanisterAuthzInfo_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ic_base_types_pb_v1_PrincipalId_fields &ic_base_types_pb_v1_PrincipalId_msg -#define ic_base_types_pb_v1_CanisterId_fields &ic_base_types_pb_v1_CanisterId_msg -#define ic_base_types_pb_v1_NeuronId_fields &ic_base_types_pb_v1_NeuronId_msg -#define ic_base_types_pb_v1_ProposalId_fields &ic_base_types_pb_v1_ProposalId_msg -#define ic_base_types_pb_v1_MethodAuthzInfo_fields &ic_base_types_pb_v1_MethodAuthzInfo_msg -#define ic_base_types_pb_v1_CanisterAuthzInfo_fields &ic_base_types_pb_v1_CanisterAuthzInfo_msg - -/* Maximum encoded size of messages (where known) */ -/* ic_base_types_pb_v1_CanisterId_size depends on runtime parameters */ -/* ic_base_types_pb_v1_MethodAuthzInfo_size depends on runtime parameters */ -/* ic_base_types_pb_v1_CanisterAuthzInfo_size depends on runtime parameters */ -#define ic_base_types_pb_v1_NeuronId_size 11 -#define ic_base_types_pb_v1_PrincipalId_size 32 -#define ic_base_types_pb_v1_ProposalId_size 11 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/app/src/protobuf/base_types.proto b/app/src/protobuf/base_types.proto deleted file mode 100644 index 72631aa8..00000000 --- a/app/src/protobuf/base_types.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; - -package ic_base_types.pb.v1; - -import "google/protobuf/descriptor.proto"; - -// The annotated message is supported by hardware wallet signing. -// The numbering was chosen as the range 19000-19999 is anyway reserved in protobuf. -extend google.protobuf.MessageOptions { - bool tui_signed_message = 20000; -} - -// The annotated field is displayed on the hardware wallet in the specification -// used by launch of the Internet Computer. -extend google.protobuf.FieldOptions { - bool tui_signed_display_q2_2021 = 20001; -} - -// A PB container for a PrincipalId, which uniquely identifies -// a principal. -message PrincipalId { - option (tui_signed_message) = true; - bytes serialized_id = 1 [(tui_signed_display_q2_2021) = true]; -} - -// A PB container for a CanisterId, which uniquely identifies -// a principal. -message CanisterId { - bytes serialized_id = 1; -} - -// A container for a NeuronId blob, which uniquely identifies -// a Neuron. -message NeuronId { - option (ic_base_types.pb.v1.tui_signed_message) = true; - // bytes serialized_id = 1; - reserved 1; - reserved 'serialized_id'; - uint64 id = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING];; -} - -// The id of a specific proposal. -message ProposalId { - uint64 id = 1 [jstype = JS_STRING]; -} - -// A descriptor of the authorization of a single method. -// Any of the principals in the list are authorized to execute -// the method. -message MethodAuthzInfo { - string method_name = 1; - repeated bytes principal_ids = 2; -} - -// A descriptor of the authorization of all the update methods in a -// canister that require authorization. -// Methods that should be accessible to anyone should not appear in this list -message CanisterAuthzInfo { - repeated MethodAuthzInfo methods_authz = 1; -} \ No newline at end of file diff --git a/app/src/protobuf/common_types.pb.c b/app/src/protobuf/common_types.pb.c deleted file mode 100644 index 3000053e..00000000 --- a/app/src/protobuf/common_types.pb.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ - -#include "common_types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ic_nns_common_pb_v1_CanisterId, ic_nns_common_pb_v1_CanisterId, AUTO) - - -PB_BIND(ic_nns_common_pb_v1_NeuronId, ic_nns_common_pb_v1_NeuronId, AUTO) - - -PB_BIND(ic_nns_common_pb_v1_ProposalId, ic_nns_common_pb_v1_ProposalId, AUTO) - - -PB_BIND(ic_nns_common_pb_v1_MethodAuthzInfo, ic_nns_common_pb_v1_MethodAuthzInfo, AUTO) - - -PB_BIND(ic_nns_common_pb_v1_CanisterAuthzInfo, ic_nns_common_pb_v1_CanisterAuthzInfo, AUTO) - - - diff --git a/app/src/protobuf/common_types.pb.h b/app/src/protobuf/common_types.pb.h deleted file mode 100644 index 5f65a2f2..00000000 --- a/app/src/protobuf/common_types.pb.h +++ /dev/null @@ -1,124 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ - -#ifndef PB_IC_NNS_COMMON_PB_V1_COMMON_TYPES_PB_H_INCLUDED -#define PB_IC_NNS_COMMON_PB_V1_COMMON_TYPES_PB_H_INCLUDED - -#include -#include "base_types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* A descriptor of the authorization of all the update methods in a - canister that require authorization. - Methods that should be accessible to anyone should not appear in this list */ -typedef struct _ic_nns_common_pb_v1_CanisterAuthzInfo { - pb_callback_t methods_authz; -} ic_nns_common_pb_v1_CanisterAuthzInfo; - -/* A PB container for a CanisterId, which uniquely identifies - a principal. */ -typedef struct _ic_nns_common_pb_v1_CanisterId { - pb_callback_t serialized_id; -} ic_nns_common_pb_v1_CanisterId; - -/* A descriptor of the authorization of a single method. - Any of the principals in the list are authorized to execute - the method. */ -typedef struct _ic_nns_common_pb_v1_MethodAuthzInfo { - pb_callback_t method_name; - pb_callback_t principal_ids; -} ic_nns_common_pb_v1_MethodAuthzInfo; - -/* A container for a NeuronId blob, which uniquely identifies - a Neuron. */ -typedef struct _ic_nns_common_pb_v1_NeuronId { - uint64_t id; -} ic_nns_common_pb_v1_NeuronId; - -/* The id of a specific proposal. */ -typedef struct _ic_nns_common_pb_v1_ProposalId { - uint64_t id; -} ic_nns_common_pb_v1_ProposalId; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ic_nns_common_pb_v1_CanisterId_init_default {{{NULL}, NULL}} -#define ic_nns_common_pb_v1_NeuronId_init_default {0} -#define ic_nns_common_pb_v1_ProposalId_init_default {0} -#define ic_nns_common_pb_v1_MethodAuthzInfo_init_default {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_nns_common_pb_v1_CanisterAuthzInfo_init_default {{{NULL}, NULL}} -#define ic_nns_common_pb_v1_CanisterId_init_zero {{{NULL}, NULL}} -#define ic_nns_common_pb_v1_NeuronId_init_zero {0} -#define ic_nns_common_pb_v1_ProposalId_init_zero {0} -#define ic_nns_common_pb_v1_MethodAuthzInfo_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_nns_common_pb_v1_CanisterAuthzInfo_init_zero {{{NULL}, NULL}} - -/* Field tags (for use in manual encoding/decoding) */ -#define ic_nns_common_pb_v1_CanisterAuthzInfo_methods_authz_tag 1 -#define ic_nns_common_pb_v1_CanisterId_serialized_id_tag 1 -#define ic_nns_common_pb_v1_MethodAuthzInfo_method_name_tag 1 -#define ic_nns_common_pb_v1_MethodAuthzInfo_principal_ids_tag 2 -#define ic_nns_common_pb_v1_NeuronId_id_tag 2 -#define ic_nns_common_pb_v1_ProposalId_id_tag 1 - -/* Struct field encoding specification for nanopb */ -#define ic_nns_common_pb_v1_CanisterId_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, serialized_id, 1) -#define ic_nns_common_pb_v1_CanisterId_CALLBACK pb_default_field_callback -#define ic_nns_common_pb_v1_CanisterId_DEFAULT NULL - -#define ic_nns_common_pb_v1_NeuronId_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, id, 2) -#define ic_nns_common_pb_v1_NeuronId_CALLBACK NULL -#define ic_nns_common_pb_v1_NeuronId_DEFAULT NULL - -#define ic_nns_common_pb_v1_ProposalId_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, id, 1) -#define ic_nns_common_pb_v1_ProposalId_CALLBACK NULL -#define ic_nns_common_pb_v1_ProposalId_DEFAULT NULL - -#define ic_nns_common_pb_v1_MethodAuthzInfo_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, method_name, 1) \ -X(a, CALLBACK, REPEATED, BYTES, principal_ids, 2) -#define ic_nns_common_pb_v1_MethodAuthzInfo_CALLBACK pb_default_field_callback -#define ic_nns_common_pb_v1_MethodAuthzInfo_DEFAULT NULL - -#define ic_nns_common_pb_v1_CanisterAuthzInfo_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, methods_authz, 1) -#define ic_nns_common_pb_v1_CanisterAuthzInfo_CALLBACK pb_default_field_callback -#define ic_nns_common_pb_v1_CanisterAuthzInfo_DEFAULT NULL -#define ic_nns_common_pb_v1_CanisterAuthzInfo_methods_authz_MSGTYPE ic_nns_common_pb_v1_MethodAuthzInfo - -extern const pb_msgdesc_t ic_nns_common_pb_v1_CanisterId_msg; -extern const pb_msgdesc_t ic_nns_common_pb_v1_NeuronId_msg; -extern const pb_msgdesc_t ic_nns_common_pb_v1_ProposalId_msg; -extern const pb_msgdesc_t ic_nns_common_pb_v1_MethodAuthzInfo_msg; -extern const pb_msgdesc_t ic_nns_common_pb_v1_CanisterAuthzInfo_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ic_nns_common_pb_v1_CanisterId_fields &ic_nns_common_pb_v1_CanisterId_msg -#define ic_nns_common_pb_v1_NeuronId_fields &ic_nns_common_pb_v1_NeuronId_msg -#define ic_nns_common_pb_v1_ProposalId_fields &ic_nns_common_pb_v1_ProposalId_msg -#define ic_nns_common_pb_v1_MethodAuthzInfo_fields &ic_nns_common_pb_v1_MethodAuthzInfo_msg -#define ic_nns_common_pb_v1_CanisterAuthzInfo_fields &ic_nns_common_pb_v1_CanisterAuthzInfo_msg - -/* Maximum encoded size of messages (where known) */ -/* ic_nns_common_pb_v1_CanisterId_size depends on runtime parameters */ -/* ic_nns_common_pb_v1_MethodAuthzInfo_size depends on runtime parameters */ -/* ic_nns_common_pb_v1_CanisterAuthzInfo_size depends on runtime parameters */ -#define ic_nns_common_pb_v1_NeuronId_size 11 -#define ic_nns_common_pb_v1_ProposalId_size 11 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/app/src/protobuf/common_types.proto b/app/src/protobuf/common_types.proto deleted file mode 100644 index c1ca6cd6..00000000 --- a/app/src/protobuf/common_types.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package ic_nns_common.pb.v1; - -import "base_types.proto"; - -// A PB container for a CanisterId, which uniquely identifies -// a principal. -message CanisterId { - bytes serialized_id = 1; -} - -// A container for a NeuronId blob, which uniquely identifies -// a Neuron. -message NeuronId { - option (ic_base_types.pb.v1.tui_signed_message) = true; - // bytes serialized_id = 1; - reserved 1; - reserved 'serialized_id'; - uint64 id = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; -} - -// The id of a specific proposal. -message ProposalId { - uint64 id = 1; -} - -// A descriptor of the authorization of a single method. -// Any of the principals in the list are authorized to execute -// the method. -message MethodAuthzInfo { - string method_name = 1; - repeated bytes principal_ids = 2; -} - -// A descriptor of the authorization of all the update methods in a -// canister that require authorization. -// Methods that should be accessible to anyone should not appear in this list -message CanisterAuthzInfo { - repeated MethodAuthzInfo methods_authz = 1; -} diff --git a/app/src/protobuf/dfinity.pb.c b/app/src/protobuf/dfinity.pb.c deleted file mode 100644 index 6f6689d2..00000000 --- a/app/src/protobuf/dfinity.pb.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ - -#include "dfinity.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(TimeStamp, TimeStamp, AUTO) - - -PB_BIND(Memo, Memo, AUTO) - - -PB_BIND(ICPTs, ICPTs, AUTO) - - -PB_BIND(Payment, Payment, AUTO) - - -PB_BIND(Subaccount, Subaccount, AUTO) - - -PB_BIND(AccountIdentifier, AccountIdentifier, AUTO) - - -PB_BIND(BlockHeight, BlockHeight, AUTO) - - -PB_BIND(SendRequest, SendRequest, AUTO) - - -PB_BIND(ManageNeuronPb, ManageNeuronPb, AUTO) - - -PB_BIND(ListNeurons, ListNeurons, AUTO) - - - diff --git a/app/src/protobuf/dfinity.pb.h b/app/src/protobuf/dfinity.pb.h deleted file mode 100644 index 4e356ad1..00000000 --- a/app/src/protobuf/dfinity.pb.h +++ /dev/null @@ -1,224 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ - -#ifndef PB_DFINITY_PB_H_INCLUDED -#define PB_DFINITY_PB_H_INCLUDED - -#include -#include "base_types.pb.h" -#include "governance.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -typedef struct _AccountIdentifier { - pb_byte_t hash[32]; /* always 32 bytes, starts with CRC32 */ -} AccountIdentifier; - -typedef struct _BlockHeight { - uint64_t height; -} BlockHeight; - -typedef struct _ICPTs { - uint64_t e8s; -} ICPTs; - -typedef struct _ListNeurons { - pb_callback_t neuron_ids; - bool caller_neuron_ids; -} ListNeurons; - -typedef struct _ManageNeuronPb { - bool has_manage_neuron; - ic_nns_governance_pb_v1_ManageNeuron manage_neuron; -} ManageNeuronPb; - -typedef struct _Memo { - uint64_t memo; -} Memo; - -typedef struct _Subaccount { - pb_byte_t sub_account[32]; /* always 32 bytes */ -} Subaccount; - -typedef struct _TimeStamp { - uint64_t timestamp_nanos; -} TimeStamp; - -typedef struct _Payment { - bool has_receiver_gets; - ICPTs receiver_gets; -} Payment; - -typedef struct _SendRequest { - bool has_memo; - Memo memo; /* required */ - bool has_payment; - Payment payment; /* required */ - bool has_max_fee; - ICPTs max_fee; /* required */ - bool has_from_subaccount; - Subaccount from_subaccount; /* optional */ - bool has_to; - AccountIdentifier to; /* required */ - bool has_created_at; - BlockHeight created_at; /* optional */ - bool has_created_at_time; - TimeStamp created_at_time; /* optional */ -} SendRequest; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define TimeStamp_init_default {0} -#define Memo_init_default {0} -#define ICPTs_init_default {0} -#define Payment_init_default {false, ICPTs_init_default} -#define Subaccount_init_default {{0}} -#define AccountIdentifier_init_default {{0}} -#define BlockHeight_init_default {0} -#define SendRequest_init_default {false, Memo_init_default, false, Payment_init_default, false, ICPTs_init_default, false, Subaccount_init_default, false, AccountIdentifier_init_default, false, BlockHeight_init_default, false, TimeStamp_init_default} -#define ManageNeuronPb_init_default {false, ic_nns_governance_pb_v1_ManageNeuron_init_default} -#define ListNeurons_init_default {{{NULL}, NULL}, 0} -#define TimeStamp_init_zero {0} -#define Memo_init_zero {0} -#define ICPTs_init_zero {0} -#define Payment_init_zero {false, ICPTs_init_zero} -#define Subaccount_init_zero {{0}} -#define AccountIdentifier_init_zero {{0}} -#define BlockHeight_init_zero {0} -#define SendRequest_init_zero {false, Memo_init_zero, false, Payment_init_zero, false, ICPTs_init_zero, false, Subaccount_init_zero, false, AccountIdentifier_init_zero, false, BlockHeight_init_zero, false, TimeStamp_init_zero} -#define ManageNeuronPb_init_zero {false, ic_nns_governance_pb_v1_ManageNeuron_init_zero} -#define ListNeurons_init_zero {{{NULL}, NULL}, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define AccountIdentifier_hash_tag 1 -#define BlockHeight_height_tag 1 -#define ICPTs_e8s_tag 1 -#define ListNeurons_neuron_ids_tag 1 -#define ListNeurons_caller_neuron_ids_tag 2 -#define ManageNeuronPb_manage_neuron_tag 1 -#define Memo_memo_tag 1 -#define Subaccount_sub_account_tag 1 -#define TimeStamp_timestamp_nanos_tag 1 -#define Payment_receiver_gets_tag 1 -#define SendRequest_memo_tag 1 -#define SendRequest_payment_tag 2 -#define SendRequest_max_fee_tag 3 -#define SendRequest_from_subaccount_tag 4 -#define SendRequest_to_tag 5 -#define SendRequest_created_at_tag 6 -#define SendRequest_created_at_time_tag 7 - -/* Struct field encoding specification for nanopb */ -#define TimeStamp_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, timestamp_nanos, 1) -#define TimeStamp_CALLBACK NULL -#define TimeStamp_DEFAULT NULL - -#define Memo_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, memo, 1) -#define Memo_CALLBACK NULL -#define Memo_DEFAULT NULL - -#define ICPTs_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, e8s, 1) -#define ICPTs_CALLBACK NULL -#define ICPTs_DEFAULT NULL - -#define Payment_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, receiver_gets, 1) -#define Payment_CALLBACK NULL -#define Payment_DEFAULT NULL -#define Payment_receiver_gets_MSGTYPE ICPTs - -#define Subaccount_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, sub_account, 1) -#define Subaccount_CALLBACK NULL -#define Subaccount_DEFAULT NULL - -#define AccountIdentifier_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, hash, 1) -#define AccountIdentifier_CALLBACK NULL -#define AccountIdentifier_DEFAULT NULL - -#define BlockHeight_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, height, 1) -#define BlockHeight_CALLBACK NULL -#define BlockHeight_DEFAULT NULL - -#define SendRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, memo, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, payment, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, max_fee, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, from_subaccount, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, to, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at_time, 7) -#define SendRequest_CALLBACK NULL -#define SendRequest_DEFAULT NULL -#define SendRequest_memo_MSGTYPE Memo -#define SendRequest_payment_MSGTYPE Payment -#define SendRequest_max_fee_MSGTYPE ICPTs -#define SendRequest_from_subaccount_MSGTYPE Subaccount -#define SendRequest_to_MSGTYPE AccountIdentifier -#define SendRequest_created_at_MSGTYPE BlockHeight -#define SendRequest_created_at_time_MSGTYPE TimeStamp - -#define ManageNeuronPb_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, manage_neuron, 1) -#define ManageNeuronPb_CALLBACK NULL -#define ManageNeuronPb_DEFAULT NULL -#define ManageNeuronPb_manage_neuron_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron - -#define ListNeurons_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, FIXED64, neuron_ids, 1) \ -X(a, STATIC, SINGULAR, BOOL, caller_neuron_ids, 2) -#define ListNeurons_CALLBACK pb_default_field_callback -#define ListNeurons_DEFAULT NULL - -extern const pb_msgdesc_t TimeStamp_msg; -extern const pb_msgdesc_t Memo_msg; -extern const pb_msgdesc_t ICPTs_msg; -extern const pb_msgdesc_t Payment_msg; -extern const pb_msgdesc_t Subaccount_msg; -extern const pb_msgdesc_t AccountIdentifier_msg; -extern const pb_msgdesc_t BlockHeight_msg; -extern const pb_msgdesc_t SendRequest_msg; -extern const pb_msgdesc_t ManageNeuronPb_msg; -extern const pb_msgdesc_t ListNeurons_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define TimeStamp_fields &TimeStamp_msg -#define Memo_fields &Memo_msg -#define ICPTs_fields &ICPTs_msg -#define Payment_fields &Payment_msg -#define Subaccount_fields &Subaccount_msg -#define AccountIdentifier_fields &AccountIdentifier_msg -#define BlockHeight_fields &BlockHeight_msg -#define SendRequest_fields &SendRequest_msg -#define ManageNeuronPb_fields &ManageNeuronPb_msg -#define ListNeurons_fields &ListNeurons_msg - -/* Maximum encoded size of messages (where known) */ -/* ListNeurons_size depends on runtime parameters */ -#define AccountIdentifier_size 34 -#define BlockHeight_size 11 -#define ICPTs_size 11 -#define ManageNeuronPb_size 250 -#define Memo_size 11 -#define Payment_size 13 -#define SendRequest_size 139 -#define Subaccount_size 34 -#define TimeStamp_size 11 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/app/src/protobuf/dfinity.proto b/app/src/protobuf/dfinity.proto deleted file mode 100644 index 867bb80f..00000000 --- a/app/src/protobuf/dfinity.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; -import "nanopb.proto"; - -import "base_types.proto"; -import "governance.proto"; - -message TimeStamp { - uint64 timestamp_nanos = 1; -} - -message Memo { - uint64 memo = 1; -} -message ICPTs { - uint64 e8s = 1; -} - -message Payment { - ICPTs receiver_gets = 1; -} - -message Subaccount { - bytes sub_account = 1 [(nanopb).max_size = 32, (nanopb).fixed_length = true]; // always 32 bytes -} -message AccountIdentifier { - bytes hash = 1 [(nanopb).max_size = 32, (nanopb).fixed_length = true]; // always 32 bytes, starts with CRC32 -} - -message BlockHeight { - uint64 height = 1; -} - -message SendRequest { - Memo memo = 1; // required - Payment payment = 2; // required - ICPTs max_fee = 3; // required - Subaccount from_subaccount = 4; // optional - AccountIdentifier to = 5; // required - BlockHeight created_at = 6; // optional - TimeStamp created_at_time = 7; // optional -} - -message ManageNeuronPb { - ic_nns_governance.pb.v1.ManageNeuron manage_neuron = 1; -} - -message ListNeurons { - repeated fixed64 neuron_ids = 1; - bool caller_neuron_ids = 2; -} diff --git a/app/src/protobuf/governance.options b/app/src/protobuf/governance.options deleted file mode 100644 index 98ad952f..00000000 --- a/app/src/protobuf/governance.options +++ /dev/null @@ -1 +0,0 @@ -ic_nns_governance.pb.v1.ManageNeuron.subaccount max_size:32 \ No newline at end of file diff --git a/app/src/protobuf/governance.pb.c b/app/src/protobuf/governance.pb.c deleted file mode 100644 index c15879cc..00000000 --- a/app/src/protobuf/governance.pb.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ - -#include "governance.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron, ic_nns_governance_pb_v1_ManageNeuron, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay, - ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_StartDissolving, ic_nns_governance_pb_v1_ManageNeuron_StartDissolving, - AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_StopDissolving, ic_nns_governance_pb_v1_ManageNeuron_StopDissolving, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_AddHotKey, ic_nns_governance_pb_v1_ManageNeuron_AddHotKey, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey, ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund, ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund, - AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_Configure, ic_nns_governance_pb_v1_ManageNeuron_Configure, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_Spawn, ic_nns_governance_pb_v1_ManageNeuron_Spawn, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_Disburse, ic_nns_governance_pb_v1_ManageNeuron_Disburse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount, ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount, - AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_Follow, ic_nns_governance_pb_v1_ManageNeuron_Follow, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_RegisterVote, ic_nns_governance_pb_v1_ManageNeuron_RegisterVote, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity, ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse, ic_nns_governance_pb_v1_ManageNeuronResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse, - ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_GovernanceError, ic_nns_governance_pb_v1_GovernanceError, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ListNeurons, ic_nns_governance_pb_v1_ListNeurons, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ListNeuronsResponse, ic_nns_governance_pb_v1_ListNeuronsResponse, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry, - ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_BallotInfo, ic_nns_governance_pb_v1_BallotInfo, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_NeuronInfo, ic_nns_governance_pb_v1_NeuronInfo, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_Neuron, ic_nns_governance_pb_v1_Neuron, 2) - - -PB_BIND(ic_nns_governance_pb_v1_Neuron_Followees, ic_nns_governance_pb_v1_Neuron_Followees, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_Neuron_FolloweesEntry, ic_nns_governance_pb_v1_Neuron_FolloweesEntry, AUTO) - - -PB_BIND(ic_nns_governance_pb_v1_NeuronStakeTransfer, ic_nns_governance_pb_v1_NeuronStakeTransfer, AUTO) - - - - - - diff --git a/app/src/protobuf/governance.pb.h b/app/src/protobuf/governance.pb.h deleted file mode 100644 index 862c5c86..00000000 --- a/app/src/protobuf/governance.pb.h +++ /dev/null @@ -1,806 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ - -#ifndef PB_IC_NNS_GOVERNANCE_PB_V1_GOVERNANCE_PB_H_INCLUDED -#define PB_IC_NNS_GOVERNANCE_PB_V1_GOVERNANCE_PB_H_INCLUDED - -#include -#include "types.pb.h" -#include "base_types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -typedef enum _ic_nns_governance_pb_v1_Vote { - ic_nns_governance_pb_v1_Vote_VOTE_UNSPECIFIED = 0, - ic_nns_governance_pb_v1_Vote_VOTE_YES = 1, - ic_nns_governance_pb_v1_Vote_VOTE_NO = 2 -} ic_nns_governance_pb_v1_Vote; - -typedef enum _ic_nns_governance_pb_v1_Topic { - ic_nns_governance_pb_v1_Topic_TOPIC_UNSPECIFIED = 0, - ic_nns_governance_pb_v1_Topic_TOPIC_NEURON_MANAGEMENT = 1, - ic_nns_governance_pb_v1_Topic_TOPIC_EXCHANGE_RATE = 2, - ic_nns_governance_pb_v1_Topic_TOPIC_NETWORK_ECONOMICS = 3, - ic_nns_governance_pb_v1_Topic_TOPIC_GOVERNANCE = 4, - ic_nns_governance_pb_v1_Topic_TOPIC_NODE_ADMIN = 5, - ic_nns_governance_pb_v1_Topic_TOPIC_PARTICIPANT_MANAGEMENT = 6, - ic_nns_governance_pb_v1_Topic_TOPIC_SUBNET_MANAGEMENT = 7, - ic_nns_governance_pb_v1_Topic_TOPIC_NETWORK_CANISTER_MANAGEMENT = 8, - ic_nns_governance_pb_v1_Topic_TOPIC_KYC = 9, - ic_nns_governance_pb_v1_Topic_TOPIC_NODE_PROVIDER_REWARDS = 10, - ic_nns_governance_pb_v1_Topic_TOPIC_SNS_DECENTRALIZATION_SALE = 11, - ic_nns_governance_pb_v1_Topic_TOPIC_SUBNET_REPLICA_VERSION_MANAGEMENT = 12, - ic_nns_governance_pb_v1_Topic_TOPIC_REPLICA_VERSION_MANAGEMENT = 13, - ic_nns_governance_pb_v1_Topic_TOPIC_SNS_AND_COMMUNITY_FUND = 14, -} ic_nns_governance_pb_v1_Topic; - -typedef enum _ic_nns_governance_pb_v1_GovernanceError_ErrorType { - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_UNSPECIFIED = 0, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_OK = 1, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_UNAVAILABLE = 2, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_NOT_AUTHORIZED = 3, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_NOT_FOUND = 4, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INVALID_COMMAND = 5, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_REQUIRES_NOT_DISSOLVING = 6, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_REQUIRES_DISSOLVING = 7, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_REQUIRES_DISSOLVED = 8, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_HOT_KEY = 9, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_RESOURCE_EXHAUSTED = 10, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_PRECONDITION_FAILED = 11, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_EXTERNAL = 12, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_LEDGER_UPDATE_ONGOING = 13, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INSUFFICIENT_FUNDS = 14, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INVALID_PRINCIPAL = 15, - ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INVALID_PROPOSAL = 16 -} ic_nns_governance_pb_v1_GovernanceError_ErrorType; - -/* Struct definitions */ -typedef struct _ic_nns_governance_pb_v1_ListNeuronsResponse { - pb_callback_t neuron_ids; - pb_callback_t full_neurons; -} ic_nns_governance_pb_v1_ListNeuronsResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_StartDissolving { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuron_StartDissolving; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_StopDissolving { - char dummy_field; -} ic_nns_governance_pb_v1_ManageNeuron_StopDissolving; - -typedef struct _ic_nns_governance_pb_v1_Neuron_Followees { - pb_callback_t followees; -} ic_nns_governance_pb_v1_Neuron_Followees; - -typedef struct _ic_nns_governance_pb_v1_BallotInfo { - bool has_proposal_id; - ic_base_types_pb_v1_ProposalId proposal_id; - ic_nns_governance_pb_v1_Vote vote; -} ic_nns_governance_pb_v1_BallotInfo; - -typedef struct _ic_nns_governance_pb_v1_GovernanceError { - ic_nns_governance_pb_v1_GovernanceError_ErrorType error_type; - pb_callback_t error_message; -} ic_nns_governance_pb_v1_GovernanceError; - -typedef struct _ic_nns_governance_pb_v1_ListNeurons { - pb_callback_t neuron_ids; - bool include_neurons_readable_by_caller; -} ic_nns_governance_pb_v1_ListNeurons; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse { - uint64_t transfer_block_height; -} ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse { - uint64_t merged_maturity_e8s; - uint64_t new_stake_e8s; -} ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse { - bool has_created_neuron_id; - ic_base_types_pb_v1_NeuronId created_neuron_id; -} ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_AddHotKey { - /* Was originally `map neuron_infos = 1` - It had to be modified to this form to annotate the key with js_type. */ - bool has_new_hot_key; - ic_base_types_pb_v1_PrincipalId new_hot_key; -} ic_nns_governance_pb_v1_ManageNeuron_AddHotKey; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount { - uint64_t e8s; -} ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_Follow { - ic_nns_governance_pb_v1_Topic topic; - pb_size_t followees_count; - ic_base_types_pb_v1_NeuronId followees[15]; -} ic_nns_governance_pb_v1_ManageNeuron_Follow; - -/* The response of the ManageNeuron command - - There is a dedicated response type for each `ManageNeuron.command` field */ -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay { - uint32_t additional_dissolve_delay_seconds; -} ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity { - uint32_t percentage_to_merge; -} ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_RegisterVote { - bool has_proposal; - ic_base_types_pb_v1_ProposalId proposal; - ic_nns_governance_pb_v1_Vote vote; -} ic_nns_governance_pb_v1_ManageNeuron_RegisterVote; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey { - bool has_hot_key_to_remove; - ic_base_types_pb_v1_PrincipalId hot_key_to_remove; -} ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_Spawn { - bool has_new_controller; - ic_base_types_pb_v1_PrincipalId new_controller; -} ic_nns_governance_pb_v1_ManageNeuron_Spawn; - -typedef struct _ic_nns_governance_pb_v1_NeuronInfo { - uint64_t retrieved_at_timestamp_seconds; - uint64_t age_seconds; - uint64_t dissolve_delay_seconds; - pb_callback_t recent_ballots; - uint64_t voting_power; - uint64_t created_timestamp_seconds; -} ic_nns_governance_pb_v1_NeuronInfo; - -typedef struct _ic_nns_governance_pb_v1_NeuronStakeTransfer { - uint64_t transfer_timestamp; - bool has_from; - ic_base_types_pb_v1_PrincipalId from; - pb_callback_t from_subaccount; - pb_callback_t to_subaccount; - uint64_t neuron_stake_e8s; - uint64_t block_height; - uint64_t memo; -} ic_nns_governance_pb_v1_NeuronStakeTransfer; - -typedef struct _ic_nns_governance_pb_v1_Neuron_FolloweesEntry { - int32_t key; - bool has_value; - ic_nns_governance_pb_v1_Neuron_Followees value; -} ic_nns_governance_pb_v1_Neuron_FolloweesEntry; - -typedef struct _ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry { - uint64_t key; - bool has_value; - ic_nns_governance_pb_v1_NeuronInfo value; -} ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuronResponse { - pb_size_t which_command; - union { - ic_nns_governance_pb_v1_GovernanceError error; - ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse configure; - ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse disburse; - ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse spawn; - ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse follow; - ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse register_vote; - ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse merge_maturity; - } command; -} ic_nns_governance_pb_v1_ManageNeuronResponse; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_Configure { - pb_size_t which_operation; - union { - ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay increase_dissolve_delay; - ic_nns_governance_pb_v1_ManageNeuron_StartDissolving start_dissolving; - ic_nns_governance_pb_v1_ManageNeuron_StopDissolving stop_dissolving; - ic_nns_governance_pb_v1_ManageNeuron_AddHotKey add_hot_key; - ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey remove_hot_key; - ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund join_community_fund; - } operation; -} ic_nns_governance_pb_v1_ManageNeuron_Configure; - -typedef struct _ic_nns_governance_pb_v1_ManageNeuron_Disburse { - bool has_amount; - ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount amount; - bool has_to_account; - ic_ledger_pb_v1_AccountIdentifier to_account; -} ic_nns_governance_pb_v1_ManageNeuron_Disburse; - -typedef struct _ic_nns_governance_pb_v1_Neuron { - bool has_id; - ic_base_types_pb_v1_NeuronId id; - pb_callback_t account; - bool has_controller; - ic_base_types_pb_v1_PrincipalId controller; - pb_callback_t hot_keys; - uint64_t cached_neuron_stake_e8s; - uint64_t neuron_fees_e8s; - uint64_t created_timestamp_seconds; - uint64_t aging_since_timestamp_seconds; - pb_size_t which_dissolve_state; - union { - uint64_t when_dissolved_timestamp_seconds; - uint64_t dissolve_delay_seconds; - } dissolve_state; - pb_callback_t followees; - pb_callback_t recent_ballots; - bool kyc_verified; - bool has_transfer; - ic_nns_governance_pb_v1_NeuronStakeTransfer transfer; - uint64_t maturity_e8s_equivalent; - bool not_for_profit; -} ic_nns_governance_pb_v1_Neuron; - -typedef PB_BYTES_ARRAY_T(32) ic_nns_governance_pb_v1_ManageNeuron_subaccount_t; -/* All operations that modify the state of an existing neuron are - represented by instances of `ManageNeuron`. - - All commands are available to the `controller` of the neuron. In - addition, commands related to voting, i.g., [manage_neuron::Follow] - and [manage_neuron::RegisterVote], are also available to the - registered hot keys of the neuron. */ -typedef struct _ic_nns_governance_pb_v1_ManageNeuron { - /* This is the legacy way to specify neuron IDs that is now discouraged. */ - bool has_id; - ic_base_types_pb_v1_NeuronId id; - pb_size_t which_command; - union { - ic_nns_governance_pb_v1_ManageNeuron_Configure configure; - ic_nns_governance_pb_v1_ManageNeuron_Disburse disburse; - ic_nns_governance_pb_v1_ManageNeuron_Spawn spawn; - ic_nns_governance_pb_v1_ManageNeuron_Follow follow; - ic_nns_governance_pb_v1_ManageNeuron_RegisterVote register_vote; - ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity merge_maturity; - } command; - pb_size_t which_neuron_id_or_subaccount; - union { - ic_nns_governance_pb_v1_ManageNeuron_subaccount_t subaccount; - ic_base_types_pb_v1_NeuronId neuron_id; - } neuron_id_or_subaccount; -} ic_nns_governance_pb_v1_ManageNeuron; - - -/* Helper constants for enums */ -#define _ic_nns_governance_pb_v1_Vote_MIN ic_nns_governance_pb_v1_Vote_VOTE_UNSPECIFIED -#define _ic_nns_governance_pb_v1_Vote_MAX ic_nns_governance_pb_v1_Vote_VOTE_NO -#define _ic_nns_governance_pb_v1_Vote_ARRAYSIZE ((ic_nns_governance_pb_v1_Vote)(ic_nns_governance_pb_v1_Vote_VOTE_NO+1)) - -#define _ic_nns_governance_pb_v1_Topic_MIN ic_nns_governance_pb_v1_Topic_TOPIC_UNSPECIFIED -#define _ic_nns_governance_pb_v1_Topic_MAX ic_nns_governance_pb_v1_Topic_TOPIC_NODE_PROVIDER_REWARDS -#define _ic_nns_governance_pb_v1_Topic_ARRAYSIZE ((ic_nns_governance_pb_v1_Topic)(ic_nns_governance_pb_v1_Topic_TOPIC_NODE_PROVIDER_REWARDS+1)) - -#define _ic_nns_governance_pb_v1_GovernanceError_ErrorType_MIN ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_UNSPECIFIED -#define _ic_nns_governance_pb_v1_GovernanceError_ErrorType_MAX ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INVALID_PROPOSAL -#define _ic_nns_governance_pb_v1_GovernanceError_ErrorType_ARRAYSIZE ((ic_nns_governance_pb_v1_GovernanceError_ErrorType)(ic_nns_governance_pb_v1_GovernanceError_ErrorType_ERROR_TYPE_INVALID_PROPOSAL+1)) - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ic_nns_governance_pb_v1_ManageNeuron_init_default {false, ic_base_types_pb_v1_NeuronId_init_default, 0, {ic_nns_governance_pb_v1_ManageNeuron_Configure_init_default}, 0, {{0, {0}}}} -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_init_default {false, ic_base_types_pb_v1_PrincipalId_init_default} -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_init_default {false, ic_base_types_pb_v1_PrincipalId_init_default} -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_init_default {0, {ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_init_default}} -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_init_default {false, ic_base_types_pb_v1_PrincipalId_init_default} -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_init_default {false, ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_init_default, false, ic_ledger_pb_v1_AccountIdentifier_init_default} -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_init_default {_ic_nns_governance_pb_v1_Topic_MIN, 0, {ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default, ic_base_types_pb_v1_NeuronId_init_default}} -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_init_default {false, ic_base_types_pb_v1_ProposalId_init_default, _ic_nns_governance_pb_v1_Vote_MIN} -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_init_default {0, {ic_nns_governance_pb_v1_GovernanceError_init_default}} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_init_default {false, ic_base_types_pb_v1_NeuronId_init_default} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_init_default {0, 0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_init_default {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_init_default {0} -#define ic_nns_governance_pb_v1_GovernanceError_init_default {_ic_nns_governance_pb_v1_GovernanceError_ErrorType_MIN, {{NULL}, NULL}} -#define ic_nns_governance_pb_v1_ListNeurons_init_default {{{NULL}, NULL}, 0} -#define ic_nns_governance_pb_v1_ListNeuronsResponse_init_default {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_init_default {0, false, ic_nns_governance_pb_v1_NeuronInfo_init_default} -#define ic_nns_governance_pb_v1_BallotInfo_init_default {false, ic_base_types_pb_v1_ProposalId_init_default, _ic_nns_governance_pb_v1_Vote_MIN} -#define ic_nns_governance_pb_v1_NeuronInfo_init_default {0, 0, 0, {{NULL}, NULL}, 0, 0} -#define ic_nns_governance_pb_v1_Neuron_init_default {false, ic_base_types_pb_v1_NeuronId_init_default, {{NULL}, NULL}, false, ic_base_types_pb_v1_PrincipalId_init_default, {{NULL}, NULL}, 0, 0, 0, 0, 0, {0}, {{NULL}, NULL}, {{NULL}, NULL}, 0, false, ic_nns_governance_pb_v1_NeuronStakeTransfer_init_default, 0, 0} -#define ic_nns_governance_pb_v1_Neuron_Followees_init_default {{{NULL}, NULL}} -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_init_default {0, false, ic_nns_governance_pb_v1_Neuron_Followees_init_default} -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_init_default {0, false, ic_base_types_pb_v1_PrincipalId_init_default, {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0} -#define ic_nns_governance_pb_v1_ManageNeuron_init_zero {false, ic_base_types_pb_v1_NeuronId_init_zero, 0, {ic_nns_governance_pb_v1_ManageNeuron_Configure_init_zero}, 0, {{0, {0}}}} -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_init_zero {false, ic_base_types_pb_v1_PrincipalId_init_zero} -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_init_zero {false, ic_base_types_pb_v1_PrincipalId_init_zero} -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_init_zero {0, {ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_init_zero}} -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_init_zero {false, ic_base_types_pb_v1_PrincipalId_init_zero} -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_init_zero {false, ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_init_zero, false, ic_ledger_pb_v1_AccountIdentifier_init_zero} -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_init_zero {_ic_nns_governance_pb_v1_Topic_MIN, 0, {ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero, ic_base_types_pb_v1_NeuronId_init_zero}} -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_init_zero {false, ic_base_types_pb_v1_ProposalId_init_zero, _ic_nns_governance_pb_v1_Vote_MIN} -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_init_zero {0, {ic_nns_governance_pb_v1_GovernanceError_init_zero}} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_init_zero {false, ic_base_types_pb_v1_NeuronId_init_zero} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_init_zero {0, 0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_init_zero {0} -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_init_zero {0} -#define ic_nns_governance_pb_v1_GovernanceError_init_zero {_ic_nns_governance_pb_v1_GovernanceError_ErrorType_MIN, {{NULL}, NULL}} -#define ic_nns_governance_pb_v1_ListNeurons_init_zero {{{NULL}, NULL}, 0} -#define ic_nns_governance_pb_v1_ListNeuronsResponse_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_init_zero {0, false, ic_nns_governance_pb_v1_NeuronInfo_init_zero} -#define ic_nns_governance_pb_v1_BallotInfo_init_zero {false, ic_base_types_pb_v1_ProposalId_init_zero, _ic_nns_governance_pb_v1_Vote_MIN} -#define ic_nns_governance_pb_v1_NeuronInfo_init_zero {0, 0, 0, {{NULL}, NULL}, 0, 0} -#define ic_nns_governance_pb_v1_Neuron_init_zero {false, ic_base_types_pb_v1_NeuronId_init_zero, {{NULL}, NULL}, false, ic_base_types_pb_v1_PrincipalId_init_zero, {{NULL}, NULL}, 0, 0, 0, 0, 0, {0}, {{NULL}, NULL}, {{NULL}, NULL}, 0, false, ic_nns_governance_pb_v1_NeuronStakeTransfer_init_zero, 0, 0} -#define ic_nns_governance_pb_v1_Neuron_Followees_init_zero {{{NULL}, NULL}} -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_init_zero {0, false, ic_nns_governance_pb_v1_Neuron_Followees_init_zero} -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_init_zero {0, false, ic_base_types_pb_v1_PrincipalId_init_zero, {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define ic_nns_governance_pb_v1_ListNeuronsResponse_neuron_ids_tag 1 -#define ic_nns_governance_pb_v1_ListNeuronsResponse_full_neurons_tag 2 -#define ic_nns_governance_pb_v1_Neuron_Followees_followees_tag 1 -#define ic_nns_governance_pb_v1_BallotInfo_proposal_id_tag 1 -#define ic_nns_governance_pb_v1_BallotInfo_vote_tag 2 -#define ic_nns_governance_pb_v1_GovernanceError_error_type_tag 1 -#define ic_nns_governance_pb_v1_GovernanceError_error_message_tag 2 -#define ic_nns_governance_pb_v1_ListNeurons_neuron_ids_tag 1 -#define ic_nns_governance_pb_v1_ListNeurons_include_neurons_readable_by_caller_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_transfer_block_height_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_merged_maturity_e8s_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_new_stake_e8s_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_created_neuron_id_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_new_hot_key_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_e8s_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_topic_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_followees_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_additional_dissolve_delay_seconds_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_percentage_to_merge_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_proposal_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_vote_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_hot_key_to_remove_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_new_controller_tag 1 -#define ic_nns_governance_pb_v1_NeuronInfo_retrieved_at_timestamp_seconds_tag 1 -#define ic_nns_governance_pb_v1_NeuronInfo_age_seconds_tag 3 -#define ic_nns_governance_pb_v1_NeuronInfo_dissolve_delay_seconds_tag 4 -#define ic_nns_governance_pb_v1_NeuronInfo_recent_ballots_tag 5 -#define ic_nns_governance_pb_v1_NeuronInfo_voting_power_tag 6 -#define ic_nns_governance_pb_v1_NeuronInfo_created_timestamp_seconds_tag 7 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_transfer_timestamp_tag 1 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_from_tag 2 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_from_subaccount_tag 3 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_to_subaccount_tag 4 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_neuron_stake_e8s_tag 5 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_block_height_tag 6 -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_memo_tag 7 -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_key_tag 1 -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_value_tag 2 -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_key_tag 1 -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_value_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_error_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_configure_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_disburse_tag 3 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_spawn_tag 4 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_follow_tag 5 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_register_vote_tag 7 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_merge_maturity_tag 11 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_increase_dissolve_delay_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_start_dissolving_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_stop_dissolving_tag 3 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_add_hot_key_tag 4 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_remove_hot_key_tag 5 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_join_community_fund_tag 7 -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_amount_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_to_account_tag 2 -#define ic_nns_governance_pb_v1_Neuron_id_tag 1 -#define ic_nns_governance_pb_v1_Neuron_account_tag 2 -#define ic_nns_governance_pb_v1_Neuron_controller_tag 3 -#define ic_nns_governance_pb_v1_Neuron_hot_keys_tag 4 -#define ic_nns_governance_pb_v1_Neuron_cached_neuron_stake_e8s_tag 5 -#define ic_nns_governance_pb_v1_Neuron_neuron_fees_e8s_tag 6 -#define ic_nns_governance_pb_v1_Neuron_created_timestamp_seconds_tag 7 -#define ic_nns_governance_pb_v1_Neuron_aging_since_timestamp_seconds_tag 8 -#define ic_nns_governance_pb_v1_Neuron_when_dissolved_timestamp_seconds_tag 9 -#define ic_nns_governance_pb_v1_Neuron_dissolve_delay_seconds_tag 10 -#define ic_nns_governance_pb_v1_Neuron_followees_tag 11 -#define ic_nns_governance_pb_v1_Neuron_recent_ballots_tag 12 -#define ic_nns_governance_pb_v1_Neuron_kyc_verified_tag 13 -#define ic_nns_governance_pb_v1_Neuron_transfer_tag 14 -#define ic_nns_governance_pb_v1_Neuron_maturity_e8s_equivalent_tag 15 -#define ic_nns_governance_pb_v1_Neuron_not_for_profit_tag 16 -#define ic_nns_governance_pb_v1_ManageNeuron_id_tag 1 -#define ic_nns_governance_pb_v1_ManageNeuron_configure_tag 2 -#define ic_nns_governance_pb_v1_ManageNeuron_disburse_tag 3 -#define ic_nns_governance_pb_v1_ManageNeuron_spawn_tag 4 -#define ic_nns_governance_pb_v1_ManageNeuron_follow_tag 5 -#define ic_nns_governance_pb_v1_ManageNeuron_register_vote_tag 7 -#define ic_nns_governance_pb_v1_ManageNeuron_merge_maturity_tag 13 -#define ic_nns_governance_pb_v1_ManageNeuron_subaccount_tag 11 -#define ic_nns_governance_pb_v1_ManageNeuron_neuron_id_tag 12 - -/* Struct field encoding specification for nanopb */ -#define ic_nns_governance_pb_v1_ManageNeuron_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, id, 1) \ -X(a, STATIC, ONEOF, MESSAGE, (command,configure,command.configure), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (command,disburse,command.disburse), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (command,spawn,command.spawn), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (command,follow,command.follow), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (command,register_vote,command.register_vote), 7) \ -X(a, STATIC, ONEOF, BYTES, (neuron_id_or_subaccount,subaccount,neuron_id_or_subaccount.subaccount), 11) \ -X(a, STATIC, ONEOF, MESSAGE, (neuron_id_or_subaccount,neuron_id,neuron_id_or_subaccount.neuron_id), 12) \ -X(a, STATIC, ONEOF, MESSAGE, (command,merge_maturity,command.merge_maturity), 13) -#define ic_nns_governance_pb_v1_ManageNeuron_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_id_MSGTYPE ic_base_types_pb_v1_NeuronId -#define ic_nns_governance_pb_v1_ManageNeuron_command_configure_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_Configure -#define ic_nns_governance_pb_v1_ManageNeuron_command_disburse_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_Disburse -#define ic_nns_governance_pb_v1_ManageNeuron_command_spawn_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_Spawn -#define ic_nns_governance_pb_v1_ManageNeuron_command_follow_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_Follow -#define ic_nns_governance_pb_v1_ManageNeuron_command_register_vote_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_RegisterVote -#define ic_nns_governance_pb_v1_ManageNeuron_neuron_id_or_subaccount_neuron_id_MSGTYPE ic_base_types_pb_v1_NeuronId -#define ic_nns_governance_pb_v1_ManageNeuron_command_merge_maturity_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity - -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, additional_dissolve_delay_seconds, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, new_hot_key, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_new_hot_key_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, hot_key_to_remove, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_hot_key_to_remove_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,increase_dissolve_delay,operation.increase_dissolve_delay), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,start_dissolving,operation.start_dissolving), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,stop_dissolving,operation.stop_dissolving), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,add_hot_key,operation.add_hot_key), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,remove_hot_key,operation.remove_hot_key), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (operation,join_community_fund,operation.join_community_fund), 7) -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_increase_dissolve_delay_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_start_dissolving_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_StartDissolving -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_stop_dissolving_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_StopDissolving -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_add_hot_key_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_AddHotKey -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_remove_hot_key_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_operation_join_community_fund_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund - -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, new_controller, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_new_controller_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, amount, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, to_account, 2) -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_amount_MSGTYPE ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_to_account_MSGTYPE ic_ledger_pb_v1_AccountIdentifier - -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, e8s, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, topic, 1) \ -X(a, STATIC, REPEATED, MESSAGE, followees, 2) -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_followees_MSGTYPE ic_base_types_pb_v1_NeuronId - -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, proposal, 1) \ -X(a, STATIC, SINGULAR, UENUM, vote, 2) -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_proposal_MSGTYPE ic_base_types_pb_v1_ProposalId - -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, percentage_to_merge, 1) -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (command,error,command.error), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (command,configure,command.configure), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (command,disburse,command.disburse), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (command,spawn,command.spawn), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (command,follow,command.follow), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (command,register_vote,command.register_vote), 7) \ -X(a, STATIC, ONEOF, MESSAGE, (command,merge_maturity,command.merge_maturity), 11) -#define ic_nns_governance_pb_v1_ManageNeuronResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_error_MSGTYPE ic_nns_governance_pb_v1_GovernanceError -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_configure_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_disburse_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_spawn_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_follow_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_register_vote_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse -#define ic_nns_governance_pb_v1_ManageNeuronResponse_command_merge_maturity_MSGTYPE ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, transfer_block_height, 1) -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_neuron_id, 1) -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_DEFAULT NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_created_neuron_id_MSGTYPE ic_base_types_pb_v1_NeuronId - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, merged_maturity_e8s, 1) \ -X(a, STATIC, SINGULAR, UINT64, new_stake_e8s, 2) -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_FIELDLIST(X, a) \ - -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_CALLBACK NULL -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_DEFAULT NULL - -#define ic_nns_governance_pb_v1_GovernanceError_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, error_type, 1) \ -X(a, CALLBACK, SINGULAR, STRING, error_message, 2) -#define ic_nns_governance_pb_v1_GovernanceError_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_GovernanceError_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ListNeurons_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, FIXED64, neuron_ids, 1) \ -X(a, STATIC, SINGULAR, BOOL, include_neurons_readable_by_caller, 2) -#define ic_nns_governance_pb_v1_ListNeurons_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_ListNeurons_DEFAULT NULL - -#define ic_nns_governance_pb_v1_ListNeuronsResponse_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, neuron_ids, 1) \ -X(a, CALLBACK, REPEATED, MESSAGE, full_neurons, 2) -#define ic_nns_governance_pb_v1_ListNeuronsResponse_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_ListNeuronsResponse_DEFAULT NULL -#define ic_nns_governance_pb_v1_ListNeuronsResponse_neuron_ids_MSGTYPE ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry -#define ic_nns_governance_pb_v1_ListNeuronsResponse_full_neurons_MSGTYPE ic_nns_governance_pb_v1_Neuron - -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FIXED64, key, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, value, 2) -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_CALLBACK NULL -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_DEFAULT NULL -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_value_MSGTYPE ic_nns_governance_pb_v1_NeuronInfo - -#define ic_nns_governance_pb_v1_BallotInfo_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, proposal_id, 1) \ -X(a, STATIC, SINGULAR, UENUM, vote, 2) -#define ic_nns_governance_pb_v1_BallotInfo_CALLBACK NULL -#define ic_nns_governance_pb_v1_BallotInfo_DEFAULT NULL -#define ic_nns_governance_pb_v1_BallotInfo_proposal_id_MSGTYPE ic_base_types_pb_v1_ProposalId - -#define ic_nns_governance_pb_v1_NeuronInfo_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, retrieved_at_timestamp_seconds, 1) \ -X(a, STATIC, SINGULAR, UINT64, age_seconds, 3) \ -X(a, STATIC, SINGULAR, UINT64, dissolve_delay_seconds, 4) \ -X(a, CALLBACK, REPEATED, MESSAGE, recent_ballots, 5) \ -X(a, STATIC, SINGULAR, UINT64, voting_power, 6) \ -X(a, STATIC, SINGULAR, UINT64, created_timestamp_seconds, 7) -#define ic_nns_governance_pb_v1_NeuronInfo_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_NeuronInfo_DEFAULT NULL -#define ic_nns_governance_pb_v1_NeuronInfo_recent_ballots_MSGTYPE ic_nns_governance_pb_v1_BallotInfo - -#define ic_nns_governance_pb_v1_Neuron_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, id, 1) \ -X(a, CALLBACK, SINGULAR, BYTES, account, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, controller, 3) \ -X(a, CALLBACK, REPEATED, MESSAGE, hot_keys, 4) \ -X(a, STATIC, SINGULAR, UINT64, cached_neuron_stake_e8s, 5) \ -X(a, STATIC, SINGULAR, UINT64, neuron_fees_e8s, 6) \ -X(a, STATIC, SINGULAR, UINT64, created_timestamp_seconds, 7) \ -X(a, STATIC, SINGULAR, UINT64, aging_since_timestamp_seconds, 8) \ -X(a, STATIC, ONEOF, UINT64, (dissolve_state,when_dissolved_timestamp_seconds,dissolve_state.when_dissolved_timestamp_seconds), 9) \ -X(a, STATIC, ONEOF, UINT64, (dissolve_state,dissolve_delay_seconds,dissolve_state.dissolve_delay_seconds), 10) \ -X(a, CALLBACK, REPEATED, MESSAGE, followees, 11) \ -X(a, CALLBACK, REPEATED, MESSAGE, recent_ballots, 12) \ -X(a, STATIC, SINGULAR, BOOL, kyc_verified, 13) \ -X(a, STATIC, OPTIONAL, MESSAGE, transfer, 14) \ -X(a, STATIC, SINGULAR, UINT64, maturity_e8s_equivalent, 15) \ -X(a, STATIC, SINGULAR, BOOL, not_for_profit, 16) -#define ic_nns_governance_pb_v1_Neuron_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_Neuron_DEFAULT NULL -#define ic_nns_governance_pb_v1_Neuron_id_MSGTYPE ic_base_types_pb_v1_NeuronId -#define ic_nns_governance_pb_v1_Neuron_controller_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_nns_governance_pb_v1_Neuron_hot_keys_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_nns_governance_pb_v1_Neuron_followees_MSGTYPE ic_nns_governance_pb_v1_Neuron_FolloweesEntry -#define ic_nns_governance_pb_v1_Neuron_recent_ballots_MSGTYPE ic_nns_governance_pb_v1_BallotInfo -#define ic_nns_governance_pb_v1_Neuron_transfer_MSGTYPE ic_nns_governance_pb_v1_NeuronStakeTransfer - -#define ic_nns_governance_pb_v1_Neuron_Followees_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, followees, 1) -#define ic_nns_governance_pb_v1_Neuron_Followees_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_Neuron_Followees_DEFAULT NULL -#define ic_nns_governance_pb_v1_Neuron_Followees_followees_MSGTYPE ic_base_types_pb_v1_NeuronId - -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, key, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, value, 2) -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_CALLBACK NULL -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_DEFAULT NULL -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_value_MSGTYPE ic_nns_governance_pb_v1_Neuron_Followees - -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, transfer_timestamp, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, from, 2) \ -X(a, CALLBACK, SINGULAR, BYTES, from_subaccount, 3) \ -X(a, CALLBACK, SINGULAR, BYTES, to_subaccount, 4) \ -X(a, STATIC, SINGULAR, UINT64, neuron_stake_e8s, 5) \ -X(a, STATIC, SINGULAR, UINT64, block_height, 6) \ -X(a, STATIC, SINGULAR, UINT64, memo, 7) -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_CALLBACK pb_default_field_callback -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_DEFAULT NULL -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_from_MSGTYPE ic_base_types_pb_v1_PrincipalId - -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_Configure_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_Spawn_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_Disburse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_Follow_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_GovernanceError_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ListNeurons_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ListNeuronsResponse_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_BallotInfo_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_NeuronInfo_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_Neuron_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_Neuron_Followees_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_Neuron_FolloweesEntry_msg; -extern const pb_msgdesc_t ic_nns_governance_pb_v1_NeuronStakeTransfer_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ic_nns_governance_pb_v1_ManageNeuron_fields &ic_nns_governance_pb_v1_ManageNeuron_msg -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_fields &ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_msg -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_fields &ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_msg -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_fields &ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_msg -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_fields &ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_msg -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_fields &ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_msg -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_fields &ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_msg -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_fields &ic_nns_governance_pb_v1_ManageNeuron_Configure_msg -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_fields &ic_nns_governance_pb_v1_ManageNeuron_Spawn_msg -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_fields &ic_nns_governance_pb_v1_ManageNeuron_Disburse_msg -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_fields &ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_msg -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_fields &ic_nns_governance_pb_v1_ManageNeuron_Follow_msg -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_fields &ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_msg -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_fields &ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_msg -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_fields &ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_msg -#define ic_nns_governance_pb_v1_GovernanceError_fields &ic_nns_governance_pb_v1_GovernanceError_msg -#define ic_nns_governance_pb_v1_ListNeurons_fields &ic_nns_governance_pb_v1_ListNeurons_msg -#define ic_nns_governance_pb_v1_ListNeuronsResponse_fields &ic_nns_governance_pb_v1_ListNeuronsResponse_msg -#define ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_fields &ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_msg -#define ic_nns_governance_pb_v1_BallotInfo_fields &ic_nns_governance_pb_v1_BallotInfo_msg -#define ic_nns_governance_pb_v1_NeuronInfo_fields &ic_nns_governance_pb_v1_NeuronInfo_msg -#define ic_nns_governance_pb_v1_Neuron_fields &ic_nns_governance_pb_v1_Neuron_msg -#define ic_nns_governance_pb_v1_Neuron_Followees_fields &ic_nns_governance_pb_v1_Neuron_Followees_msg -#define ic_nns_governance_pb_v1_Neuron_FolloweesEntry_fields &ic_nns_governance_pb_v1_Neuron_FolloweesEntry_msg -#define ic_nns_governance_pb_v1_NeuronStakeTransfer_fields &ic_nns_governance_pb_v1_NeuronStakeTransfer_msg - -/* Maximum encoded size of messages (where known) */ -/* ic_nns_governance_pb_v1_ManageNeuronResponse_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_GovernanceError_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_ListNeurons_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_ListNeuronsResponse_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_ListNeuronsResponse_NeuronMapEntry_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_NeuronInfo_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_Neuron_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_Neuron_Followees_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_Neuron_FolloweesEntry_size depends on runtime parameters */ -/* ic_nns_governance_pb_v1_NeuronStakeTransfer_size depends on runtime parameters */ -#define ic_nns_governance_pb_v1_BallotInfo_size 15 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_ConfigureResponse_size 0 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_DisburseResponse_size 11 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_FollowResponse_size 0 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_MergeMaturityResponse_size 22 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_RegisterVoteResponse_size 0 -#define ic_nns_governance_pb_v1_ManageNeuronResponse_SpawnResponse_size 13 -#define ic_nns_governance_pb_v1_ManageNeuron_AddHotKey_size 34 -#define ic_nns_governance_pb_v1_ManageNeuron_Configure_size 36 -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_Amount_size 11 -#define ic_nns_governance_pb_v1_ManageNeuron_Disburse_size 50 -#define ic_nns_governance_pb_v1_ManageNeuron_Follow_size 197 -#define ic_nns_governance_pb_v1_ManageNeuron_IncreaseDissolveDelay_size 6 -#define ic_nns_governance_pb_v1_ManageNeuron_JoinCommunityFund_size 0 -#define ic_nns_governance_pb_v1_ManageNeuron_MergeMaturity_size 6 -#define ic_nns_governance_pb_v1_ManageNeuron_RegisterVote_size 15 -#define ic_nns_governance_pb_v1_ManageNeuron_RemoveHotKey_size 34 -#define ic_nns_governance_pb_v1_ManageNeuron_Spawn_size 34 -#define ic_nns_governance_pb_v1_ManageNeuron_StartDissolving_size 0 -#define ic_nns_governance_pb_v1_ManageNeuron_StopDissolving_size 0 -#define ic_nns_governance_pb_v1_ManageNeuron_size 247 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/app/src/protobuf/governance.proto b/app/src/protobuf/governance.proto deleted file mode 100644 index 1dc57f24..00000000 --- a/app/src/protobuf/governance.proto +++ /dev/null @@ -1,268 +0,0 @@ -syntax = "proto3"; -import "nanopb.proto"; -package ic_nns_governance.pb.v1; - -import "types.proto"; -import "base_types.proto"; - -// All operations that modify the state of an existing neuron are -// represented by instances of `ManageNeuron`. -// -// All commands are available to the `controller` of the neuron. In -// addition, commands related to voting, i.g., [manage_neuron::Follow] -// and [manage_neuron::RegisterVote], are also available to the -// registered hot keys of the neuron. -message ManageNeuron { - option (ic_base_types.pb.v1.tui_signed_message) = true; - - // This is the legacy way to specify neuron IDs that is now discouraged. - ic_base_types.pb.v1.NeuronId id = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - - // The ID of the neuron to manage. This can either be a subaccount or a neuron ID. - oneof neuron_id_or_subaccount { - bytes subaccount = 11 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - ic_base_types.pb.v1.NeuronId neuron_id = 12 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - message IncreaseDissolveDelay { - uint32 additional_dissolve_delay_seconds = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - message StartDissolving {} - message StopDissolving {} - - message AddHotKey { - ic_base_types.pb.v1.PrincipalId new_hot_key = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - message RemoveHotKey { - ic_base_types.pb.v1.PrincipalId hot_key_to_remove = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - // Join the Internet Computer's community fund with this neuron's - // entire stake. Caution: this operation is not reversible. - message JoinCommunityFund {} - - // Commands that only configure a given neuron, but do not interact - // with the outside world. They all require the caller to be the - // controller of the neuron. - message Configure { - oneof operation { - IncreaseDissolveDelay increase_dissolve_delay = 1; - StartDissolving start_dissolving = 2; - StopDissolving stop_dissolving = 3; - AddHotKey add_hot_key = 4; - RemoveHotKey remove_hot_key = 5; - JoinCommunityFund join_community_fund = 7; - } - } - - message Spawn { - ic_base_types.pb.v1.PrincipalId new_controller = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - message Disburse { - option (ic_base_types.pb.v1.tui_signed_message) = true; - message Amount { - option (ic_base_types.pb.v1.tui_signed_message) = true; - uint64 e8s = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING]; - } - Amount amount = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - ic_ledger.pb.v1.AccountIdentifier to_account = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - } - - message Follow { - Topic topic = 1; - repeated ic_base_types.pb.v1.NeuronId followees = 2 [(nanopb).max_count = 15]; - } - - message RegisterVote { - ic_base_types.pb.v1.ProposalId proposal = 1; - Vote vote = 2; - } - - message MergeMaturity { - uint32 percentage_to_merge = 1; - } - - oneof command { - Configure configure = 2; - Disburse disburse = 3; - Spawn spawn = 4; - Follow follow = 5; - RegisterVote register_vote = 7; - MergeMaturity merge_maturity = 13; - } -} - - -// The response of the ManageNeuron command -// -// There is a dedicated response type for each `ManageNeuron.command` field -message ManageNeuronResponse { - message ConfigureResponse {} - - message DisburseResponse { - uint64 transfer_block_height = 1 [jstype = JS_STRING]; - } - - message SpawnResponse { - ic_base_types.pb.v1.NeuronId created_neuron_id = 1; - } - - message MergeMaturityResponse { - uint64 merged_maturity_e8s = 1 [jstype = JS_STRING]; - uint64 new_stake_e8s = 2 [jstype = JS_STRING]; - } - - message FollowResponse {} - - message RegisterVoteResponse {} - - oneof command { - GovernanceError error = 1; - ConfigureResponse configure = 2; - DisburseResponse disburse = 3; - SpawnResponse spawn = 4; - FollowResponse follow = 5; - RegisterVoteResponse register_vote = 7; - MergeMaturityResponse merge_maturity = 11; - } -} - -message GovernanceError { - enum ErrorType { - ERROR_TYPE_UNSPECIFIED = 0; - // The operation was successfully completed. - ERROR_TYPE_OK = 1; - // This operation is not available, e.g., not implemented. - ERROR_TYPE_UNAVAILABLE = 2; - // The caller is not authorized to perform this operation. - ERROR_TYPE_NOT_AUTHORIZED = 3; - // Some entity required for the operation (for example, a neuron) was not found. - ERROR_TYPE_NOT_FOUND = 4; - // The command was missing or invalid. This is a permanent error. - ERROR_TYPE_INVALID_COMMAND = 5; - // The neuron is dissolving or dissolved and the operation requires it to - // be not dissolving (that is, having a non-zero dissolve delay that is - // accumulating age). - ERROR_TYPE_REQUIRES_NOT_DISSOLVING = 6; - // The neuron is not dissolving or dissolved and the operation requires - // it to be dissolving (that is, having a non-zero dissolve delay with - // zero age that is not accumulating). - ERROR_TYPE_REQUIRES_DISSOLVING = 7; - // The neuron is not dissolving and not dissolved and the operation - // requires it to be dissolved (that is, having a dissolve delay of zero - // and an age of zero). - ERROR_TYPE_REQUIRES_DISSOLVED = 8; - // When adding or removing a hot key: the key to add was already - // present or the key to remove was not present or the key to add - // was invalid or adding another hot key would bring the total - // number of the maximum number of allowed hot keys per neuron. - ERROR_TYPE_HOT_KEY = 9; - // Some canister side resource is exhausted, so this operation cannot be - // performed. - ERROR_TYPE_RESOURCE_EXHAUSTED = 10; - // Some precondition for executing this method was not met. - ERROR_TYPE_PRECONDITION_FAILED = 11; - // Executing this method failed for some reason external to the - // governance canister. - ERROR_TYPE_EXTERNAL = 12; - // A neuron has an ongoing ledger update and thus can't be - // changed. - ERROR_TYPE_LEDGER_UPDATE_ONGOING = 13; - // There wasn't enough funds to perform the operation. - ERROR_TYPE_INSUFFICIENT_FUNDS = 14; - // The principal provided was invalid. - ERROR_TYPE_INVALID_PRINCIPAL = 15; - // The proposal's parameters violate size restrictions. - ERROR_TYPE_INVALID_PROPOSAL = 16; - } - - ErrorType error_type = 1; - string error_message = 2; -} - -message ListNeurons { - option (ic_base_types.pb.v1.tui_signed_message) = true; - repeated fixed64 neuron_ids = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING]; - bool include_neurons_readable_by_caller = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; -} - -message ListNeuronsResponse { - message NeuronMapEntry { - fixed64 key = 1 [jstype = JS_STRING]; - NeuronInfo value = 2; - } - - // Was originally `map neuron_infos = 1` - // It had to be modified to this form to annotate the key with js_type. - repeated NeuronMapEntry neuron_ids = 1; - repeated Neuron full_neurons = 2; -} - -message BallotInfo { - ic_base_types.pb.v1.ProposalId proposal_id = 1; - Vote vote = 2; -} - -message NeuronInfo { - uint64 retrieved_at_timestamp_seconds = 1 [jstype = JS_STRING];; - uint64 age_seconds = 3 [jstype = JS_STRING]; - uint64 dissolve_delay_seconds = 4 [jstype = JS_STRING]; - repeated BallotInfo recent_ballots = 5; - uint64 voting_power = 6 [jstype = JS_STRING]; - uint64 created_timestamp_seconds = 7 [jstype = JS_STRING]; -} - -message Neuron { - ic_base_types.pb.v1.NeuronId id = 1; - bytes account = 2; - ic_base_types.pb.v1.PrincipalId controller = 3; - repeated ic_base_types.pb.v1.PrincipalId hot_keys = 4; - uint64 cached_neuron_stake_e8s = 5 [jstype = JS_STRING]; - uint64 neuron_fees_e8s = 6 [jstype = JS_STRING]; - uint64 created_timestamp_seconds = 7 [jstype = JS_STRING]; - uint64 aging_since_timestamp_seconds = 8 [jstype = JS_STRING]; - oneof dissolve_state { - uint64 when_dissolved_timestamp_seconds = 9 [jstype = JS_STRING]; - uint64 dissolve_delay_seconds = 10 [jstype = JS_STRING]; - } - message Followees {repeated ic_base_types.pb.v1.NeuronId followees = 1;} - map followees = 11; - repeated BallotInfo recent_ballots = 12; - bool kyc_verified = 13; - NeuronStakeTransfer transfer = 14; - uint64 maturity_e8s_equivalent = 15 [jstype = JS_STRING]; - bool not_for_profit = 16; -} - -enum Vote { - VOTE_UNSPECIFIED = 0; - VOTE_YES = 1; - VOTE_NO = 2; -} - -message NeuronStakeTransfer { - uint64 transfer_timestamp = 1 [jstype = JS_STRING]; - ic_base_types.pb.v1.PrincipalId from = 2; - bytes from_subaccount = 3; - bytes to_subaccount = 4; - uint64 neuron_stake_e8s = 5 [jstype = JS_STRING]; - uint64 block_height = 6 [jstype = JS_STRING]; - uint64 memo = 7 [jstype = JS_STRING]; -} - -enum Topic { - TOPIC_UNSPECIFIED = 0; - TOPIC_NEURON_MANAGEMENT = 1; - TOPIC_EXCHANGE_RATE = 2; - TOPIC_NETWORK_ECONOMICS = 3; - TOPIC_GOVERNANCE = 4; - TOPIC_NODE_ADMIN = 5; - TOPIC_PARTICIPANT_MANAGEMENT = 6; - TOPIC_SUBNET_MANAGEMENT = 7; - TOPIC_NETWORK_CANISTER_MANAGEMENT = 8; - TOPIC_KYC = 9; - TOPIC_NODE_PROVIDER_REWARDS = 10; -} diff --git a/app/src/protobuf/types.options b/app/src/protobuf/types.options deleted file mode 100644 index 00158178..00000000 --- a/app/src/protobuf/types.options +++ /dev/null @@ -1 +0,0 @@ -ic_ledger.pb.v1.AccountIdentifier max_size:33 diff --git a/app/src/protobuf/types.pb.c b/app/src/protobuf/types.pb.c deleted file mode 100644 index 9bd634ac..00000000 --- a/app/src/protobuf/types.pb.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ - -#include "types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ic_ledger_pb_v1_LedgerInit, ic_ledger_pb_v1_LedgerInit, AUTO) - - -PB_BIND(ic_ledger_pb_v1_LedgerUpgrade, ic_ledger_pb_v1_LedgerUpgrade, AUTO) - - -PB_BIND(ic_ledger_pb_v1_SendRequest, ic_ledger_pb_v1_SendRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_SendResponse, ic_ledger_pb_v1_SendResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_NotifyRequest, ic_ledger_pb_v1_NotifyRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_NotifyResponse, ic_ledger_pb_v1_NotifyResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TransactionNotificationRequest, ic_ledger_pb_v1_TransactionNotificationRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TransactionNotificationResponse, ic_ledger_pb_v1_TransactionNotificationResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_CyclesNotificationResponse, ic_ledger_pb_v1_CyclesNotificationResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_AccountBalanceRequest, ic_ledger_pb_v1_AccountBalanceRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_AccountBalanceResponse, ic_ledger_pb_v1_AccountBalanceResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TipOfChainRequest, ic_ledger_pb_v1_TipOfChainRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TipOfChainResponse, ic_ledger_pb_v1_TipOfChainResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TotalSupplyRequest, ic_ledger_pb_v1_TotalSupplyRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TotalSupplyResponse, ic_ledger_pb_v1_TotalSupplyResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_LedgerArchiveRequest, ic_ledger_pb_v1_LedgerArchiveRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_BlockRequest, ic_ledger_pb_v1_BlockRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_EncodedBlock, ic_ledger_pb_v1_EncodedBlock, AUTO) - - -PB_BIND(ic_ledger_pb_v1_BlockResponse, ic_ledger_pb_v1_BlockResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_GetBlocksRequest, ic_ledger_pb_v1_GetBlocksRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Refund, ic_ledger_pb_v1_Refund, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ToppedUp, ic_ledger_pb_v1_ToppedUp, AUTO) - - -PB_BIND(ic_ledger_pb_v1_EncodedBlocks, ic_ledger_pb_v1_EncodedBlocks, AUTO) - - -PB_BIND(ic_ledger_pb_v1_GetBlocksResponse, ic_ledger_pb_v1_GetBlocksResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_IterBlocksRequest, ic_ledger_pb_v1_IterBlocksRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_IterBlocksResponse, ic_ledger_pb_v1_IterBlocksResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ArchiveIndexEntry, ic_ledger_pb_v1_ArchiveIndexEntry, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ArchiveIndexResponse, ic_ledger_pb_v1_ArchiveIndexResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ArchiveInit, ic_ledger_pb_v1_ArchiveInit, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ArchiveAddRequest, ic_ledger_pb_v1_ArchiveAddRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ArchiveAddResponse, ic_ledger_pb_v1_ArchiveAddResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_GetNodesRequest, ic_ledger_pb_v1_GetNodesRequest, AUTO) - - -PB_BIND(ic_ledger_pb_v1_GetNodesResponse, ic_ledger_pb_v1_GetNodesResponse, AUTO) - - -PB_BIND(ic_ledger_pb_v1_ICPTs, ic_ledger_pb_v1_ICPTs, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Payment, ic_ledger_pb_v1_Payment, AUTO) - - -PB_BIND(ic_ledger_pb_v1_BlockHeight, ic_ledger_pb_v1_BlockHeight, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Block, ic_ledger_pb_v1_Block, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Hash, ic_ledger_pb_v1_Hash, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Account, ic_ledger_pb_v1_Account, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Transaction, ic_ledger_pb_v1_Transaction, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Send, ic_ledger_pb_v1_Send, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Mint, ic_ledger_pb_v1_Mint, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Burn, ic_ledger_pb_v1_Burn, AUTO) - - -PB_BIND(ic_ledger_pb_v1_AccountIdentifier, ic_ledger_pb_v1_AccountIdentifier, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Subaccount, ic_ledger_pb_v1_Subaccount, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Memo, ic_ledger_pb_v1_Memo, AUTO) - - -PB_BIND(ic_ledger_pb_v1_TimeStamp, ic_ledger_pb_v1_TimeStamp, AUTO) - - -PB_BIND(ic_ledger_pb_v1_Certification, ic_ledger_pb_v1_Certification, AUTO) - - - diff --git a/app/src/protobuf/types.pb.h b/app/src/protobuf/types.pb.h deleted file mode 100644 index c5f96cc9..00000000 --- a/app/src/protobuf/types.pb.h +++ /dev/null @@ -1,1015 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ - -#ifndef PB_IC_LEDGER_PB_V1_TYPES_PB_H_INCLUDED -#define PB_IC_LEDGER_PB_V1_TYPES_PB_H_INCLUDED - -#include -#include "base_types.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* Add blocks to the archive canister */ -typedef struct _ic_ledger_pb_v1_ArchiveAddRequest { - pb_callback_t blocks; -} ic_ledger_pb_v1_ArchiveAddRequest; - -typedef struct _ic_ledger_pb_v1_ArchiveAddResponse { - char dummy_field; -} ic_ledger_pb_v1_ArchiveAddResponse; - -typedef struct _ic_ledger_pb_v1_ArchiveIndexResponse { - pb_callback_t entries; -} ic_ledger_pb_v1_ArchiveIndexResponse; - -typedef struct _ic_ledger_pb_v1_Certification { - pb_callback_t certification; -} ic_ledger_pb_v1_Certification; - -typedef struct _ic_ledger_pb_v1_EncodedBlock { - pb_callback_t block; -} ic_ledger_pb_v1_EncodedBlock; - -typedef struct _ic_ledger_pb_v1_EncodedBlocks { - pb_callback_t blocks; -} ic_ledger_pb_v1_EncodedBlocks; - -/* Fetch a list of all of the archive nodes */ -typedef struct _ic_ledger_pb_v1_GetNodesRequest { - char dummy_field; -} ic_ledger_pb_v1_GetNodesRequest; - -typedef struct _ic_ledger_pb_v1_GetNodesResponse { - pb_callback_t nodes; -} ic_ledger_pb_v1_GetNodesResponse; - -typedef struct _ic_ledger_pb_v1_Hash { - pb_callback_t hash; -} ic_ledger_pb_v1_Hash; - -typedef struct _ic_ledger_pb_v1_IterBlocksResponse { - pb_callback_t blocks; -} ic_ledger_pb_v1_IterBlocksResponse; - -/* The format of values serialized to/from the stable memory during and upgrade */ -typedef struct _ic_ledger_pb_v1_LedgerUpgrade { - char dummy_field; -} ic_ledger_pb_v1_LedgerUpgrade; - -typedef struct _ic_ledger_pb_v1_NotifyResponse { - char dummy_field; -} ic_ledger_pb_v1_NotifyResponse; - -typedef struct _ic_ledger_pb_v1_Subaccount { - pb_callback_t sub_account; -} ic_ledger_pb_v1_Subaccount; - -/* Get the length of the chain with a certification */ -typedef struct _ic_ledger_pb_v1_TipOfChainRequest { - char dummy_field; -} ic_ledger_pb_v1_TipOfChainRequest; - -typedef struct _ic_ledger_pb_v1_ToppedUp { - char dummy_field; -} ic_ledger_pb_v1_ToppedUp; - -/* How many ICPTs are there not in the minting account */ -typedef struct _ic_ledger_pb_v1_TotalSupplyRequest { - char dummy_field; -} ic_ledger_pb_v1_TotalSupplyRequest; - -typedef struct _ic_ledger_pb_v1_TransactionNotificationResponse { - pb_callback_t response; -} ic_ledger_pb_v1_TransactionNotificationResponse; - -typedef PB_BYTES_ARRAY_T(33) ic_ledger_pb_v1_AccountIdentifier_hash_t; -typedef struct _ic_ledger_pb_v1_AccountIdentifier { - ic_ledger_pb_v1_AccountIdentifier_hash_t hash; -} ic_ledger_pb_v1_AccountIdentifier; - -typedef struct _ic_ledger_pb_v1_ArchiveIndexEntry { - uint64_t height_from; - uint64_t height_to; - bool has_canister_id; - ic_base_types_pb_v1_PrincipalId canister_id; -} ic_ledger_pb_v1_ArchiveIndexEntry; - -/* * Archive canister * - Init the archive canister */ -typedef struct _ic_ledger_pb_v1_ArchiveInit { - uint32_t node_max_memory_size_bytes; - uint32_t max_message_size_bytes; -} ic_ledger_pb_v1_ArchiveInit; - -typedef struct _ic_ledger_pb_v1_BlockHeight { - uint64_t height; -} ic_ledger_pb_v1_BlockHeight; - -/* Get a single block */ -typedef struct _ic_ledger_pb_v1_BlockRequest { - uint64_t block_height; -} ic_ledger_pb_v1_BlockRequest; - -typedef struct _ic_ledger_pb_v1_BlockResponse { - pb_size_t which_block_content; - union { - ic_ledger_pb_v1_EncodedBlock block; - ic_base_types_pb_v1_PrincipalId canister_id; - } block_content; -} ic_ledger_pb_v1_BlockResponse; - -/* Get a set of blocks */ -typedef struct _ic_ledger_pb_v1_GetBlocksRequest { - uint64_t start; - uint64_t length; -} ic_ledger_pb_v1_GetBlocksRequest; - -typedef struct _ic_ledger_pb_v1_GetBlocksResponse { - pb_size_t which_get_blocks_content; - union { - ic_ledger_pb_v1_EncodedBlocks blocks; - pb_callback_t error; - } get_blocks_content; -} ic_ledger_pb_v1_GetBlocksResponse; - -/* ** BASIC TYPES ** */ -typedef struct _ic_ledger_pb_v1_ICPTs { - uint64_t e8s; -} ic_ledger_pb_v1_ICPTs; - -/* Iterate through blocks */ -typedef struct _ic_ledger_pb_v1_IterBlocksRequest { - uint64_t start; - uint64_t length; -} ic_ledger_pb_v1_IterBlocksRequest; - -typedef struct _ic_ledger_pb_v1_Memo { - uint64_t memo; -} ic_ledger_pb_v1_Memo; - -typedef struct _ic_ledger_pb_v1_TimeStamp { - uint64_t timestamp_nanos; -} ic_ledger_pb_v1_TimeStamp; - -typedef struct _ic_ledger_pb_v1_Account { - bool has_identifier; - ic_ledger_pb_v1_AccountIdentifier identifier; - bool has_balance; - ic_ledger_pb_v1_ICPTs balance; -} ic_ledger_pb_v1_Account; - -/* Get the balance of an account */ -typedef struct _ic_ledger_pb_v1_AccountBalanceRequest { - bool has_account; - ic_ledger_pb_v1_AccountIdentifier account; -} ic_ledger_pb_v1_AccountBalanceRequest; - -typedef struct _ic_ledger_pb_v1_AccountBalanceResponse { - bool has_balance; - ic_ledger_pb_v1_ICPTs balance; -} ic_ledger_pb_v1_AccountBalanceResponse; - -typedef struct _ic_ledger_pb_v1_Burn { - bool has_from; - ic_ledger_pb_v1_AccountIdentifier from; - bool has_amount; - ic_ledger_pb_v1_ICPTs amount; -} ic_ledger_pb_v1_Burn; - -/* Archive any blocks older than this */ -typedef struct _ic_ledger_pb_v1_LedgerArchiveRequest { - bool has_timestamp; - ic_ledger_pb_v1_TimeStamp timestamp; -} ic_ledger_pb_v1_LedgerArchiveRequest; - -/* Initialise the ledger canister */ -typedef struct _ic_ledger_pb_v1_LedgerInit { - bool has_minting_account; - ic_ledger_pb_v1_AccountIdentifier minting_account; - pb_callback_t initial_values; - bool has_archive_canister; - ic_base_types_pb_v1_PrincipalId archive_canister; - uint32_t max_message_size_bytes; -} ic_ledger_pb_v1_LedgerInit; - -typedef struct _ic_ledger_pb_v1_Mint { - bool has_to; - ic_ledger_pb_v1_AccountIdentifier to; - bool has_amount; - ic_ledger_pb_v1_ICPTs amount; -} ic_ledger_pb_v1_Mint; - -/* Notify a canister that it has received a payment */ -typedef struct _ic_ledger_pb_v1_NotifyRequest { - bool has_block_height; - ic_ledger_pb_v1_BlockHeight block_height; - bool has_max_fee; - ic_ledger_pb_v1_ICPTs max_fee; - bool has_from_subaccount; - ic_ledger_pb_v1_Subaccount from_subaccount; - bool has_to_canister; - ic_base_types_pb_v1_PrincipalId to_canister; - bool has_to_subaccount; - ic_ledger_pb_v1_Subaccount to_subaccount; -} ic_ledger_pb_v1_NotifyRequest; - -typedef struct _ic_ledger_pb_v1_Payment { - bool has_receiver_gets; - ic_ledger_pb_v1_ICPTs receiver_gets; -} ic_ledger_pb_v1_Payment; - -typedef struct _ic_ledger_pb_v1_Refund { - bool has_refund; - ic_ledger_pb_v1_BlockHeight refund; - pb_callback_t error; -} ic_ledger_pb_v1_Refund; - -typedef struct _ic_ledger_pb_v1_Send { - bool has_from; - ic_ledger_pb_v1_AccountIdentifier from; - bool has_to; - ic_ledger_pb_v1_AccountIdentifier to; - bool has_amount; - ic_ledger_pb_v1_ICPTs amount; - bool has_max_fee; - ic_ledger_pb_v1_ICPTs max_fee; -} ic_ledger_pb_v1_Send; - -typedef struct _ic_ledger_pb_v1_SendResponse { - bool has_resulting_height; - ic_ledger_pb_v1_BlockHeight resulting_height; -} ic_ledger_pb_v1_SendResponse; - -typedef struct _ic_ledger_pb_v1_TipOfChainResponse { - bool has_certification; - ic_ledger_pb_v1_Certification certification; - bool has_chain_length; - ic_ledger_pb_v1_BlockHeight chain_length; -} ic_ledger_pb_v1_TipOfChainResponse; - -typedef struct _ic_ledger_pb_v1_TotalSupplyResponse { - bool has_total_supply; - ic_ledger_pb_v1_ICPTs total_supply; -} ic_ledger_pb_v1_TotalSupplyResponse; - -typedef struct _ic_ledger_pb_v1_TransactionNotificationRequest { - bool has_from; - ic_base_types_pb_v1_PrincipalId from; - bool has_from_subaccount; - ic_ledger_pb_v1_Subaccount from_subaccount; - bool has_to; - ic_base_types_pb_v1_PrincipalId to; - bool has_to_subaccount; - ic_ledger_pb_v1_Subaccount to_subaccount; - bool has_block_height; - ic_ledger_pb_v1_BlockHeight block_height; - bool has_amount; - ic_ledger_pb_v1_ICPTs amount; - bool has_memo; - ic_ledger_pb_v1_Memo memo; -} ic_ledger_pb_v1_TransactionNotificationRequest; - -typedef struct _ic_ledger_pb_v1_CyclesNotificationResponse { - pb_size_t which_response; - union { - ic_base_types_pb_v1_PrincipalId created_canister_id; - ic_ledger_pb_v1_Refund refund; - ic_ledger_pb_v1_ToppedUp topped_up; - } response; -} ic_ledger_pb_v1_CyclesNotificationResponse; - -/* Make a payment */ -typedef struct _ic_ledger_pb_v1_SendRequest { - bool has_memo; - ic_ledger_pb_v1_Memo memo; - bool has_payment; - ic_ledger_pb_v1_Payment payment; - bool has_max_fee; - ic_ledger_pb_v1_ICPTs max_fee; - bool has_from_subaccount; - ic_ledger_pb_v1_Subaccount from_subaccount; - bool has_to; - ic_ledger_pb_v1_AccountIdentifier to; - bool has_created_at; - ic_ledger_pb_v1_BlockHeight created_at; - bool has_created_at_time; - ic_ledger_pb_v1_TimeStamp created_at_time; -} ic_ledger_pb_v1_SendRequest; - -typedef struct _ic_ledger_pb_v1_Transaction { - pb_size_t which_transfer; - union { - ic_ledger_pb_v1_Burn burn; - ic_ledger_pb_v1_Mint mint; - ic_ledger_pb_v1_Send send; - } transfer; - bool has_memo; - ic_ledger_pb_v1_Memo memo; - bool has_created_at; - ic_ledger_pb_v1_BlockHeight created_at; - bool has_created_at_time; - ic_ledger_pb_v1_TimeStamp created_at_time; -} ic_ledger_pb_v1_Transaction; - -/* This is the */ -typedef struct _ic_ledger_pb_v1_Block { - bool has_parent_hash; - ic_ledger_pb_v1_Hash parent_hash; - bool has_timestamp; - ic_ledger_pb_v1_TimeStamp timestamp; - bool has_transaction; - ic_ledger_pb_v1_Transaction transaction; -} ic_ledger_pb_v1_Block; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ic_ledger_pb_v1_LedgerInit_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default, {{NULL}, NULL}, false, ic_base_types_pb_v1_PrincipalId_init_default, 0} -#define ic_ledger_pb_v1_LedgerUpgrade_init_default {0} -#define ic_ledger_pb_v1_SendRequest_init_default {false, ic_ledger_pb_v1_Memo_init_default, false, ic_ledger_pb_v1_Payment_init_default, false, ic_ledger_pb_v1_ICPTs_init_default, false, ic_ledger_pb_v1_Subaccount_init_default, false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_BlockHeight_init_default, false, ic_ledger_pb_v1_TimeStamp_init_default} -#define ic_ledger_pb_v1_SendResponse_init_default {false, ic_ledger_pb_v1_BlockHeight_init_default} -#define ic_ledger_pb_v1_NotifyRequest_init_default {false, ic_ledger_pb_v1_BlockHeight_init_default, false, ic_ledger_pb_v1_ICPTs_init_default, false, ic_ledger_pb_v1_Subaccount_init_default, false, ic_base_types_pb_v1_PrincipalId_init_default, false, ic_ledger_pb_v1_Subaccount_init_default} -#define ic_ledger_pb_v1_NotifyResponse_init_default {0} -#define ic_ledger_pb_v1_TransactionNotificationRequest_init_default {false, ic_base_types_pb_v1_PrincipalId_init_default, false, ic_ledger_pb_v1_Subaccount_init_default, false, ic_base_types_pb_v1_PrincipalId_init_default, false, ic_ledger_pb_v1_Subaccount_init_default, false, ic_ledger_pb_v1_BlockHeight_init_default, false, ic_ledger_pb_v1_ICPTs_init_default, false, ic_ledger_pb_v1_Memo_init_default} -#define ic_ledger_pb_v1_TransactionNotificationResponse_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_CyclesNotificationResponse_init_default {0, {ic_base_types_pb_v1_PrincipalId_init_default}} -#define ic_ledger_pb_v1_AccountBalanceRequest_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default} -#define ic_ledger_pb_v1_AccountBalanceResponse_init_default {false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_TipOfChainRequest_init_default {0} -#define ic_ledger_pb_v1_TipOfChainResponse_init_default {false, ic_ledger_pb_v1_Certification_init_default, false, ic_ledger_pb_v1_BlockHeight_init_default} -#define ic_ledger_pb_v1_TotalSupplyRequest_init_default {0} -#define ic_ledger_pb_v1_TotalSupplyResponse_init_default {false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_LedgerArchiveRequest_init_default {false, ic_ledger_pb_v1_TimeStamp_init_default} -#define ic_ledger_pb_v1_BlockRequest_init_default {0} -#define ic_ledger_pb_v1_EncodedBlock_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_BlockResponse_init_default {0, {ic_ledger_pb_v1_EncodedBlock_init_default}} -#define ic_ledger_pb_v1_GetBlocksRequest_init_default {0, 0} -#define ic_ledger_pb_v1_Refund_init_default {false, ic_ledger_pb_v1_BlockHeight_init_default, {{NULL}, NULL}} -#define ic_ledger_pb_v1_ToppedUp_init_default {0} -#define ic_ledger_pb_v1_EncodedBlocks_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_GetBlocksResponse_init_default {0, {ic_ledger_pb_v1_EncodedBlocks_init_default}} -#define ic_ledger_pb_v1_IterBlocksRequest_init_default {0, 0} -#define ic_ledger_pb_v1_IterBlocksResponse_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveIndexEntry_init_default {0, 0, false, ic_base_types_pb_v1_PrincipalId_init_default} -#define ic_ledger_pb_v1_ArchiveIndexResponse_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveInit_init_default {0, 0} -#define ic_ledger_pb_v1_ArchiveAddRequest_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveAddResponse_init_default {0} -#define ic_ledger_pb_v1_GetNodesRequest_init_default {0} -#define ic_ledger_pb_v1_GetNodesResponse_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ICPTs_init_default {0} -#define ic_ledger_pb_v1_Payment_init_default {false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_BlockHeight_init_default {0} -#define ic_ledger_pb_v1_Block_init_default {false, ic_ledger_pb_v1_Hash_init_default, false, ic_ledger_pb_v1_TimeStamp_init_default, false, ic_ledger_pb_v1_Transaction_init_default} -#define ic_ledger_pb_v1_Hash_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_Account_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_Transaction_init_default {0, {ic_ledger_pb_v1_Burn_init_default}, false, ic_ledger_pb_v1_Memo_init_default, false, ic_ledger_pb_v1_BlockHeight_init_default, false, ic_ledger_pb_v1_TimeStamp_init_default} -#define ic_ledger_pb_v1_Send_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_ICPTs_init_default, false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_Mint_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_Burn_init_default {false, ic_ledger_pb_v1_AccountIdentifier_init_default, false, ic_ledger_pb_v1_ICPTs_init_default} -#define ic_ledger_pb_v1_AccountIdentifier_init_default {{0, {0}}} -#define ic_ledger_pb_v1_Subaccount_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_Memo_init_default {0} -#define ic_ledger_pb_v1_TimeStamp_init_default {0} -#define ic_ledger_pb_v1_Certification_init_default {{{NULL}, NULL}} -#define ic_ledger_pb_v1_LedgerInit_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero, {{NULL}, NULL}, false, ic_base_types_pb_v1_PrincipalId_init_zero, 0} -#define ic_ledger_pb_v1_LedgerUpgrade_init_zero {0} -#define ic_ledger_pb_v1_SendRequest_init_zero {false, ic_ledger_pb_v1_Memo_init_zero, false, ic_ledger_pb_v1_Payment_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero, false, ic_ledger_pb_v1_Subaccount_init_zero, false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_BlockHeight_init_zero, false, ic_ledger_pb_v1_TimeStamp_init_zero} -#define ic_ledger_pb_v1_SendResponse_init_zero {false, ic_ledger_pb_v1_BlockHeight_init_zero} -#define ic_ledger_pb_v1_NotifyRequest_init_zero {false, ic_ledger_pb_v1_BlockHeight_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero, false, ic_ledger_pb_v1_Subaccount_init_zero, false, ic_base_types_pb_v1_PrincipalId_init_zero, false, ic_ledger_pb_v1_Subaccount_init_zero} -#define ic_ledger_pb_v1_NotifyResponse_init_zero {0} -#define ic_ledger_pb_v1_TransactionNotificationRequest_init_zero {false, ic_base_types_pb_v1_PrincipalId_init_zero, false, ic_ledger_pb_v1_Subaccount_init_zero, false, ic_base_types_pb_v1_PrincipalId_init_zero, false, ic_ledger_pb_v1_Subaccount_init_zero, false, ic_ledger_pb_v1_BlockHeight_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero, false, ic_ledger_pb_v1_Memo_init_zero} -#define ic_ledger_pb_v1_TransactionNotificationResponse_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_CyclesNotificationResponse_init_zero {0, {ic_base_types_pb_v1_PrincipalId_init_zero}} -#define ic_ledger_pb_v1_AccountBalanceRequest_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero} -#define ic_ledger_pb_v1_AccountBalanceResponse_init_zero {false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_TipOfChainRequest_init_zero {0} -#define ic_ledger_pb_v1_TipOfChainResponse_init_zero {false, ic_ledger_pb_v1_Certification_init_zero, false, ic_ledger_pb_v1_BlockHeight_init_zero} -#define ic_ledger_pb_v1_TotalSupplyRequest_init_zero {0} -#define ic_ledger_pb_v1_TotalSupplyResponse_init_zero {false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_LedgerArchiveRequest_init_zero {false, ic_ledger_pb_v1_TimeStamp_init_zero} -#define ic_ledger_pb_v1_BlockRequest_init_zero {0} -#define ic_ledger_pb_v1_EncodedBlock_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_BlockResponse_init_zero {0, {ic_ledger_pb_v1_EncodedBlock_init_zero}} -#define ic_ledger_pb_v1_GetBlocksRequest_init_zero {0, 0} -#define ic_ledger_pb_v1_Refund_init_zero {false, ic_ledger_pb_v1_BlockHeight_init_zero, {{NULL}, NULL}} -#define ic_ledger_pb_v1_ToppedUp_init_zero {0} -#define ic_ledger_pb_v1_EncodedBlocks_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_GetBlocksResponse_init_zero {0, {ic_ledger_pb_v1_EncodedBlocks_init_zero}} -#define ic_ledger_pb_v1_IterBlocksRequest_init_zero {0, 0} -#define ic_ledger_pb_v1_IterBlocksResponse_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveIndexEntry_init_zero {0, 0, false, ic_base_types_pb_v1_PrincipalId_init_zero} -#define ic_ledger_pb_v1_ArchiveIndexResponse_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveInit_init_zero {0, 0} -#define ic_ledger_pb_v1_ArchiveAddRequest_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ArchiveAddResponse_init_zero {0} -#define ic_ledger_pb_v1_GetNodesRequest_init_zero {0} -#define ic_ledger_pb_v1_GetNodesResponse_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_ICPTs_init_zero {0} -#define ic_ledger_pb_v1_Payment_init_zero {false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_BlockHeight_init_zero {0} -#define ic_ledger_pb_v1_Block_init_zero {false, ic_ledger_pb_v1_Hash_init_zero, false, ic_ledger_pb_v1_TimeStamp_init_zero, false, ic_ledger_pb_v1_Transaction_init_zero} -#define ic_ledger_pb_v1_Hash_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_Account_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_Transaction_init_zero {0, {ic_ledger_pb_v1_Burn_init_zero}, false, ic_ledger_pb_v1_Memo_init_zero, false, ic_ledger_pb_v1_BlockHeight_init_zero, false, ic_ledger_pb_v1_TimeStamp_init_zero} -#define ic_ledger_pb_v1_Send_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_Mint_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_Burn_init_zero {false, ic_ledger_pb_v1_AccountIdentifier_init_zero, false, ic_ledger_pb_v1_ICPTs_init_zero} -#define ic_ledger_pb_v1_AccountIdentifier_init_zero {{0, {0}}} -#define ic_ledger_pb_v1_Subaccount_init_zero {{{NULL}, NULL}} -#define ic_ledger_pb_v1_Memo_init_zero {0} -#define ic_ledger_pb_v1_TimeStamp_init_zero {0} -#define ic_ledger_pb_v1_Certification_init_zero {{{NULL}, NULL}} - -/* Field tags (for use in manual encoding/decoding) */ -#define ic_ledger_pb_v1_ArchiveAddRequest_blocks_tag 1 -#define ic_ledger_pb_v1_ArchiveIndexResponse_entries_tag 1 -#define ic_ledger_pb_v1_Certification_certification_tag 1 -#define ic_ledger_pb_v1_EncodedBlock_block_tag 1 -#define ic_ledger_pb_v1_EncodedBlocks_blocks_tag 1 -#define ic_ledger_pb_v1_GetNodesResponse_nodes_tag 1 -#define ic_ledger_pb_v1_Hash_hash_tag 1 -#define ic_ledger_pb_v1_IterBlocksResponse_blocks_tag 1 -#define ic_ledger_pb_v1_Subaccount_sub_account_tag 1 -#define ic_ledger_pb_v1_TransactionNotificationResponse_response_tag 1 -#define ic_ledger_pb_v1_AccountIdentifier_hash_tag 1 -#define ic_ledger_pb_v1_ArchiveIndexEntry_height_from_tag 1 -#define ic_ledger_pb_v1_ArchiveIndexEntry_height_to_tag 2 -#define ic_ledger_pb_v1_ArchiveIndexEntry_canister_id_tag 3 -#define ic_ledger_pb_v1_ArchiveInit_node_max_memory_size_bytes_tag 1 -#define ic_ledger_pb_v1_ArchiveInit_max_message_size_bytes_tag 2 -#define ic_ledger_pb_v1_BlockHeight_height_tag 1 -#define ic_ledger_pb_v1_BlockRequest_block_height_tag 1 -#define ic_ledger_pb_v1_BlockResponse_block_tag 1 -#define ic_ledger_pb_v1_BlockResponse_canister_id_tag 2 -#define ic_ledger_pb_v1_GetBlocksRequest_start_tag 1 -#define ic_ledger_pb_v1_GetBlocksRequest_length_tag 2 -#define ic_ledger_pb_v1_GetBlocksResponse_blocks_tag 1 -#define ic_ledger_pb_v1_GetBlocksResponse_error_tag 2 -#define ic_ledger_pb_v1_ICPTs_e8s_tag 1 -#define ic_ledger_pb_v1_IterBlocksRequest_start_tag 1 -#define ic_ledger_pb_v1_IterBlocksRequest_length_tag 2 -#define ic_ledger_pb_v1_Memo_memo_tag 1 -#define ic_ledger_pb_v1_TimeStamp_timestamp_nanos_tag 1 -#define ic_ledger_pb_v1_Account_identifier_tag 1 -#define ic_ledger_pb_v1_Account_balance_tag 2 -#define ic_ledger_pb_v1_AccountBalanceRequest_account_tag 1 -#define ic_ledger_pb_v1_AccountBalanceResponse_balance_tag 1 -#define ic_ledger_pb_v1_Burn_from_tag 1 -#define ic_ledger_pb_v1_Burn_amount_tag 3 -#define ic_ledger_pb_v1_LedgerArchiveRequest_timestamp_tag 1 -#define ic_ledger_pb_v1_LedgerInit_minting_account_tag 1 -#define ic_ledger_pb_v1_LedgerInit_initial_values_tag 2 -#define ic_ledger_pb_v1_LedgerInit_archive_canister_tag 3 -#define ic_ledger_pb_v1_LedgerInit_max_message_size_bytes_tag 4 -#define ic_ledger_pb_v1_Mint_to_tag 2 -#define ic_ledger_pb_v1_Mint_amount_tag 3 -#define ic_ledger_pb_v1_NotifyRequest_block_height_tag 1 -#define ic_ledger_pb_v1_NotifyRequest_max_fee_tag 2 -#define ic_ledger_pb_v1_NotifyRequest_from_subaccount_tag 3 -#define ic_ledger_pb_v1_NotifyRequest_to_canister_tag 4 -#define ic_ledger_pb_v1_NotifyRequest_to_subaccount_tag 5 -#define ic_ledger_pb_v1_Payment_receiver_gets_tag 1 -#define ic_ledger_pb_v1_Refund_refund_tag 2 -#define ic_ledger_pb_v1_Refund_error_tag 3 -#define ic_ledger_pb_v1_Send_from_tag 1 -#define ic_ledger_pb_v1_Send_to_tag 2 -#define ic_ledger_pb_v1_Send_amount_tag 3 -#define ic_ledger_pb_v1_Send_max_fee_tag 4 -#define ic_ledger_pb_v1_SendResponse_resulting_height_tag 1 -#define ic_ledger_pb_v1_TipOfChainResponse_certification_tag 1 -#define ic_ledger_pb_v1_TipOfChainResponse_chain_length_tag 2 -#define ic_ledger_pb_v1_TotalSupplyResponse_total_supply_tag 1 -#define ic_ledger_pb_v1_TransactionNotificationRequest_from_tag 1 -#define ic_ledger_pb_v1_TransactionNotificationRequest_from_subaccount_tag 2 -#define ic_ledger_pb_v1_TransactionNotificationRequest_to_tag 3 -#define ic_ledger_pb_v1_TransactionNotificationRequest_to_subaccount_tag 4 -#define ic_ledger_pb_v1_TransactionNotificationRequest_block_height_tag 5 -#define ic_ledger_pb_v1_TransactionNotificationRequest_amount_tag 6 -#define ic_ledger_pb_v1_TransactionNotificationRequest_memo_tag 7 -#define ic_ledger_pb_v1_CyclesNotificationResponse_created_canister_id_tag 1 -#define ic_ledger_pb_v1_CyclesNotificationResponse_refund_tag 2 -#define ic_ledger_pb_v1_CyclesNotificationResponse_topped_up_tag 3 -#define ic_ledger_pb_v1_SendRequest_memo_tag 1 -#define ic_ledger_pb_v1_SendRequest_payment_tag 2 -#define ic_ledger_pb_v1_SendRequest_max_fee_tag 3 -#define ic_ledger_pb_v1_SendRequest_from_subaccount_tag 4 -#define ic_ledger_pb_v1_SendRequest_to_tag 5 -#define ic_ledger_pb_v1_SendRequest_created_at_tag 6 -#define ic_ledger_pb_v1_SendRequest_created_at_time_tag 7 -#define ic_ledger_pb_v1_Transaction_burn_tag 1 -#define ic_ledger_pb_v1_Transaction_mint_tag 2 -#define ic_ledger_pb_v1_Transaction_send_tag 3 -#define ic_ledger_pb_v1_Transaction_memo_tag 4 -#define ic_ledger_pb_v1_Transaction_created_at_tag 5 -#define ic_ledger_pb_v1_Transaction_created_at_time_tag 6 -#define ic_ledger_pb_v1_Block_parent_hash_tag 1 -#define ic_ledger_pb_v1_Block_timestamp_tag 2 -#define ic_ledger_pb_v1_Block_transaction_tag 3 - -/* Struct field encoding specification for nanopb */ -#define ic_ledger_pb_v1_LedgerInit_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, minting_account, 1) \ -X(a, CALLBACK, REPEATED, MESSAGE, initial_values, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, archive_canister, 3) \ -X(a, STATIC, SINGULAR, UINT32, max_message_size_bytes, 4) -#define ic_ledger_pb_v1_LedgerInit_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_LedgerInit_DEFAULT NULL -#define ic_ledger_pb_v1_LedgerInit_minting_account_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_LedgerInit_initial_values_MSGTYPE ic_ledger_pb_v1_Account -#define ic_ledger_pb_v1_LedgerInit_archive_canister_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_ledger_pb_v1_LedgerUpgrade_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_LedgerUpgrade_CALLBACK NULL -#define ic_ledger_pb_v1_LedgerUpgrade_DEFAULT NULL - -#define ic_ledger_pb_v1_SendRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, memo, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, payment, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, max_fee, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, from_subaccount, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, to, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at_time, 7) -#define ic_ledger_pb_v1_SendRequest_CALLBACK NULL -#define ic_ledger_pb_v1_SendRequest_DEFAULT NULL -#define ic_ledger_pb_v1_SendRequest_memo_MSGTYPE ic_ledger_pb_v1_Memo -#define ic_ledger_pb_v1_SendRequest_payment_MSGTYPE ic_ledger_pb_v1_Payment -#define ic_ledger_pb_v1_SendRequest_max_fee_MSGTYPE ic_ledger_pb_v1_ICPTs -#define ic_ledger_pb_v1_SendRequest_from_subaccount_MSGTYPE ic_ledger_pb_v1_Subaccount -#define ic_ledger_pb_v1_SendRequest_to_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_SendRequest_created_at_MSGTYPE ic_ledger_pb_v1_BlockHeight -#define ic_ledger_pb_v1_SendRequest_created_at_time_MSGTYPE ic_ledger_pb_v1_TimeStamp - -#define ic_ledger_pb_v1_SendResponse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, resulting_height, 1) -#define ic_ledger_pb_v1_SendResponse_CALLBACK NULL -#define ic_ledger_pb_v1_SendResponse_DEFAULT NULL -#define ic_ledger_pb_v1_SendResponse_resulting_height_MSGTYPE ic_ledger_pb_v1_BlockHeight - -#define ic_ledger_pb_v1_NotifyRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, block_height, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, max_fee, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, from_subaccount, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, to_canister, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, to_subaccount, 5) -#define ic_ledger_pb_v1_NotifyRequest_CALLBACK NULL -#define ic_ledger_pb_v1_NotifyRequest_DEFAULT NULL -#define ic_ledger_pb_v1_NotifyRequest_block_height_MSGTYPE ic_ledger_pb_v1_BlockHeight -#define ic_ledger_pb_v1_NotifyRequest_max_fee_MSGTYPE ic_ledger_pb_v1_ICPTs -#define ic_ledger_pb_v1_NotifyRequest_from_subaccount_MSGTYPE ic_ledger_pb_v1_Subaccount -#define ic_ledger_pb_v1_NotifyRequest_to_canister_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_ledger_pb_v1_NotifyRequest_to_subaccount_MSGTYPE ic_ledger_pb_v1_Subaccount - -#define ic_ledger_pb_v1_NotifyResponse_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_NotifyResponse_CALLBACK NULL -#define ic_ledger_pb_v1_NotifyResponse_DEFAULT NULL - -#define ic_ledger_pb_v1_TransactionNotificationRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, from, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, from_subaccount, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, to, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, to_subaccount, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, block_height, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, amount, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, memo, 7) -#define ic_ledger_pb_v1_TransactionNotificationRequest_CALLBACK NULL -#define ic_ledger_pb_v1_TransactionNotificationRequest_DEFAULT NULL -#define ic_ledger_pb_v1_TransactionNotificationRequest_from_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_ledger_pb_v1_TransactionNotificationRequest_from_subaccount_MSGTYPE ic_ledger_pb_v1_Subaccount -#define ic_ledger_pb_v1_TransactionNotificationRequest_to_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_ledger_pb_v1_TransactionNotificationRequest_to_subaccount_MSGTYPE ic_ledger_pb_v1_Subaccount -#define ic_ledger_pb_v1_TransactionNotificationRequest_block_height_MSGTYPE ic_ledger_pb_v1_BlockHeight -#define ic_ledger_pb_v1_TransactionNotificationRequest_amount_MSGTYPE ic_ledger_pb_v1_ICPTs -#define ic_ledger_pb_v1_TransactionNotificationRequest_memo_MSGTYPE ic_ledger_pb_v1_Memo - -#define ic_ledger_pb_v1_TransactionNotificationResponse_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, response, 1) -#define ic_ledger_pb_v1_TransactionNotificationResponse_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_TransactionNotificationResponse_DEFAULT NULL - -#define ic_ledger_pb_v1_CyclesNotificationResponse_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (response,created_canister_id,response.created_canister_id), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (response,refund,response.refund), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (response,topped_up,response.topped_up), 3) -#define ic_ledger_pb_v1_CyclesNotificationResponse_CALLBACK NULL -#define ic_ledger_pb_v1_CyclesNotificationResponse_DEFAULT NULL -#define ic_ledger_pb_v1_CyclesNotificationResponse_response_created_canister_id_MSGTYPE ic_base_types_pb_v1_PrincipalId -#define ic_ledger_pb_v1_CyclesNotificationResponse_response_refund_MSGTYPE ic_ledger_pb_v1_Refund -#define ic_ledger_pb_v1_CyclesNotificationResponse_response_topped_up_MSGTYPE ic_ledger_pb_v1_ToppedUp - -#define ic_ledger_pb_v1_AccountBalanceRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, account, 1) -#define ic_ledger_pb_v1_AccountBalanceRequest_CALLBACK NULL -#define ic_ledger_pb_v1_AccountBalanceRequest_DEFAULT NULL -#define ic_ledger_pb_v1_AccountBalanceRequest_account_MSGTYPE ic_ledger_pb_v1_AccountIdentifier - -#define ic_ledger_pb_v1_AccountBalanceResponse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, balance, 1) -#define ic_ledger_pb_v1_AccountBalanceResponse_CALLBACK NULL -#define ic_ledger_pb_v1_AccountBalanceResponse_DEFAULT NULL -#define ic_ledger_pb_v1_AccountBalanceResponse_balance_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_TipOfChainRequest_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_TipOfChainRequest_CALLBACK NULL -#define ic_ledger_pb_v1_TipOfChainRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_TipOfChainResponse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, certification, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, chain_length, 2) -#define ic_ledger_pb_v1_TipOfChainResponse_CALLBACK NULL -#define ic_ledger_pb_v1_TipOfChainResponse_DEFAULT NULL -#define ic_ledger_pb_v1_TipOfChainResponse_certification_MSGTYPE ic_ledger_pb_v1_Certification -#define ic_ledger_pb_v1_TipOfChainResponse_chain_length_MSGTYPE ic_ledger_pb_v1_BlockHeight - -#define ic_ledger_pb_v1_TotalSupplyRequest_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_TotalSupplyRequest_CALLBACK NULL -#define ic_ledger_pb_v1_TotalSupplyRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_TotalSupplyResponse_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, total_supply, 1) -#define ic_ledger_pb_v1_TotalSupplyResponse_CALLBACK NULL -#define ic_ledger_pb_v1_TotalSupplyResponse_DEFAULT NULL -#define ic_ledger_pb_v1_TotalSupplyResponse_total_supply_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_LedgerArchiveRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, timestamp, 1) -#define ic_ledger_pb_v1_LedgerArchiveRequest_CALLBACK NULL -#define ic_ledger_pb_v1_LedgerArchiveRequest_DEFAULT NULL -#define ic_ledger_pb_v1_LedgerArchiveRequest_timestamp_MSGTYPE ic_ledger_pb_v1_TimeStamp - -#define ic_ledger_pb_v1_BlockRequest_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, block_height, 1) -#define ic_ledger_pb_v1_BlockRequest_CALLBACK NULL -#define ic_ledger_pb_v1_BlockRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_EncodedBlock_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, block, 1) -#define ic_ledger_pb_v1_EncodedBlock_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_EncodedBlock_DEFAULT NULL - -#define ic_ledger_pb_v1_BlockResponse_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (block_content,block,block_content.block), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (block_content,canister_id,block_content.canister_id), 2) -#define ic_ledger_pb_v1_BlockResponse_CALLBACK NULL -#define ic_ledger_pb_v1_BlockResponse_DEFAULT NULL -#define ic_ledger_pb_v1_BlockResponse_block_content_block_MSGTYPE ic_ledger_pb_v1_EncodedBlock -#define ic_ledger_pb_v1_BlockResponse_block_content_canister_id_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_ledger_pb_v1_GetBlocksRequest_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, start, 1) \ -X(a, STATIC, SINGULAR, UINT64, length, 2) -#define ic_ledger_pb_v1_GetBlocksRequest_CALLBACK NULL -#define ic_ledger_pb_v1_GetBlocksRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_Refund_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, refund, 2) \ -X(a, CALLBACK, SINGULAR, STRING, error, 3) -#define ic_ledger_pb_v1_Refund_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_Refund_DEFAULT NULL -#define ic_ledger_pb_v1_Refund_refund_MSGTYPE ic_ledger_pb_v1_BlockHeight - -#define ic_ledger_pb_v1_ToppedUp_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_ToppedUp_CALLBACK NULL -#define ic_ledger_pb_v1_ToppedUp_DEFAULT NULL - -#define ic_ledger_pb_v1_EncodedBlocks_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, blocks, 1) -#define ic_ledger_pb_v1_EncodedBlocks_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_EncodedBlocks_DEFAULT NULL -#define ic_ledger_pb_v1_EncodedBlocks_blocks_MSGTYPE ic_ledger_pb_v1_EncodedBlock - -#define ic_ledger_pb_v1_GetBlocksResponse_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (get_blocks_content,blocks,get_blocks_content.blocks), 1) \ -X(a, CALLBACK, ONEOF, STRING, (get_blocks_content,error,get_blocks_content.error), 2) -#define ic_ledger_pb_v1_GetBlocksResponse_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_GetBlocksResponse_DEFAULT NULL -#define ic_ledger_pb_v1_GetBlocksResponse_get_blocks_content_blocks_MSGTYPE ic_ledger_pb_v1_EncodedBlocks - -#define ic_ledger_pb_v1_IterBlocksRequest_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, start, 1) \ -X(a, STATIC, SINGULAR, UINT64, length, 2) -#define ic_ledger_pb_v1_IterBlocksRequest_CALLBACK NULL -#define ic_ledger_pb_v1_IterBlocksRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_IterBlocksResponse_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, blocks, 1) -#define ic_ledger_pb_v1_IterBlocksResponse_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_IterBlocksResponse_DEFAULT NULL -#define ic_ledger_pb_v1_IterBlocksResponse_blocks_MSGTYPE ic_ledger_pb_v1_EncodedBlock - -#define ic_ledger_pb_v1_ArchiveIndexEntry_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, height_from, 1) \ -X(a, STATIC, SINGULAR, UINT64, height_to, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, canister_id, 3) -#define ic_ledger_pb_v1_ArchiveIndexEntry_CALLBACK NULL -#define ic_ledger_pb_v1_ArchiveIndexEntry_DEFAULT NULL -#define ic_ledger_pb_v1_ArchiveIndexEntry_canister_id_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_ledger_pb_v1_ArchiveIndexResponse_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, entries, 1) -#define ic_ledger_pb_v1_ArchiveIndexResponse_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_ArchiveIndexResponse_DEFAULT NULL -#define ic_ledger_pb_v1_ArchiveIndexResponse_entries_MSGTYPE ic_ledger_pb_v1_ArchiveIndexEntry - -#define ic_ledger_pb_v1_ArchiveInit_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, node_max_memory_size_bytes, 1) \ -X(a, STATIC, SINGULAR, UINT32, max_message_size_bytes, 2) -#define ic_ledger_pb_v1_ArchiveInit_CALLBACK NULL -#define ic_ledger_pb_v1_ArchiveInit_DEFAULT NULL - -#define ic_ledger_pb_v1_ArchiveAddRequest_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, blocks, 1) -#define ic_ledger_pb_v1_ArchiveAddRequest_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_ArchiveAddRequest_DEFAULT NULL -#define ic_ledger_pb_v1_ArchiveAddRequest_blocks_MSGTYPE ic_ledger_pb_v1_Block - -#define ic_ledger_pb_v1_ArchiveAddResponse_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_ArchiveAddResponse_CALLBACK NULL -#define ic_ledger_pb_v1_ArchiveAddResponse_DEFAULT NULL - -#define ic_ledger_pb_v1_GetNodesRequest_FIELDLIST(X, a) \ - -#define ic_ledger_pb_v1_GetNodesRequest_CALLBACK NULL -#define ic_ledger_pb_v1_GetNodesRequest_DEFAULT NULL - -#define ic_ledger_pb_v1_GetNodesResponse_FIELDLIST(X, a) \ -X(a, CALLBACK, REPEATED, MESSAGE, nodes, 1) -#define ic_ledger_pb_v1_GetNodesResponse_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_GetNodesResponse_DEFAULT NULL -#define ic_ledger_pb_v1_GetNodesResponse_nodes_MSGTYPE ic_base_types_pb_v1_PrincipalId - -#define ic_ledger_pb_v1_ICPTs_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, e8s, 1) -#define ic_ledger_pb_v1_ICPTs_CALLBACK NULL -#define ic_ledger_pb_v1_ICPTs_DEFAULT NULL - -#define ic_ledger_pb_v1_Payment_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, receiver_gets, 1) -#define ic_ledger_pb_v1_Payment_CALLBACK NULL -#define ic_ledger_pb_v1_Payment_DEFAULT NULL -#define ic_ledger_pb_v1_Payment_receiver_gets_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_BlockHeight_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, height, 1) -#define ic_ledger_pb_v1_BlockHeight_CALLBACK NULL -#define ic_ledger_pb_v1_BlockHeight_DEFAULT NULL - -#define ic_ledger_pb_v1_Block_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, parent_hash, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, timestamp, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, transaction, 3) -#define ic_ledger_pb_v1_Block_CALLBACK NULL -#define ic_ledger_pb_v1_Block_DEFAULT NULL -#define ic_ledger_pb_v1_Block_parent_hash_MSGTYPE ic_ledger_pb_v1_Hash -#define ic_ledger_pb_v1_Block_timestamp_MSGTYPE ic_ledger_pb_v1_TimeStamp -#define ic_ledger_pb_v1_Block_transaction_MSGTYPE ic_ledger_pb_v1_Transaction - -#define ic_ledger_pb_v1_Hash_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, hash, 1) -#define ic_ledger_pb_v1_Hash_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_Hash_DEFAULT NULL - -#define ic_ledger_pb_v1_Account_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, identifier, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, balance, 2) -#define ic_ledger_pb_v1_Account_CALLBACK NULL -#define ic_ledger_pb_v1_Account_DEFAULT NULL -#define ic_ledger_pb_v1_Account_identifier_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_Account_balance_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_Transaction_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (transfer,burn,transfer.burn), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (transfer,mint,transfer.mint), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (transfer,send,transfer.send), 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, memo, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, created_at_time, 6) -#define ic_ledger_pb_v1_Transaction_CALLBACK NULL -#define ic_ledger_pb_v1_Transaction_DEFAULT NULL -#define ic_ledger_pb_v1_Transaction_transfer_burn_MSGTYPE ic_ledger_pb_v1_Burn -#define ic_ledger_pb_v1_Transaction_transfer_mint_MSGTYPE ic_ledger_pb_v1_Mint -#define ic_ledger_pb_v1_Transaction_transfer_send_MSGTYPE ic_ledger_pb_v1_Send -#define ic_ledger_pb_v1_Transaction_memo_MSGTYPE ic_ledger_pb_v1_Memo -#define ic_ledger_pb_v1_Transaction_created_at_MSGTYPE ic_ledger_pb_v1_BlockHeight -#define ic_ledger_pb_v1_Transaction_created_at_time_MSGTYPE ic_ledger_pb_v1_TimeStamp - -#define ic_ledger_pb_v1_Send_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, from, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, to, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, amount, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, max_fee, 4) -#define ic_ledger_pb_v1_Send_CALLBACK NULL -#define ic_ledger_pb_v1_Send_DEFAULT NULL -#define ic_ledger_pb_v1_Send_from_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_Send_to_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_Send_amount_MSGTYPE ic_ledger_pb_v1_ICPTs -#define ic_ledger_pb_v1_Send_max_fee_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_Mint_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, to, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, amount, 3) -#define ic_ledger_pb_v1_Mint_CALLBACK NULL -#define ic_ledger_pb_v1_Mint_DEFAULT NULL -#define ic_ledger_pb_v1_Mint_to_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_Mint_amount_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_Burn_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, from, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, amount, 3) -#define ic_ledger_pb_v1_Burn_CALLBACK NULL -#define ic_ledger_pb_v1_Burn_DEFAULT NULL -#define ic_ledger_pb_v1_Burn_from_MSGTYPE ic_ledger_pb_v1_AccountIdentifier -#define ic_ledger_pb_v1_Burn_amount_MSGTYPE ic_ledger_pb_v1_ICPTs - -#define ic_ledger_pb_v1_AccountIdentifier_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BYTES, hash, 1) -#define ic_ledger_pb_v1_AccountIdentifier_CALLBACK NULL -#define ic_ledger_pb_v1_AccountIdentifier_DEFAULT NULL - -#define ic_ledger_pb_v1_Subaccount_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, sub_account, 1) -#define ic_ledger_pb_v1_Subaccount_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_Subaccount_DEFAULT NULL - -#define ic_ledger_pb_v1_Memo_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, memo, 1) -#define ic_ledger_pb_v1_Memo_CALLBACK NULL -#define ic_ledger_pb_v1_Memo_DEFAULT NULL - -#define ic_ledger_pb_v1_TimeStamp_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT64, timestamp_nanos, 1) -#define ic_ledger_pb_v1_TimeStamp_CALLBACK NULL -#define ic_ledger_pb_v1_TimeStamp_DEFAULT NULL - -#define ic_ledger_pb_v1_Certification_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, BYTES, certification, 1) -#define ic_ledger_pb_v1_Certification_CALLBACK pb_default_field_callback -#define ic_ledger_pb_v1_Certification_DEFAULT NULL - -extern const pb_msgdesc_t ic_ledger_pb_v1_LedgerInit_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_LedgerUpgrade_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_SendRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_SendResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_NotifyRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_NotifyResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TransactionNotificationRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TransactionNotificationResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_CyclesNotificationResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_AccountBalanceRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_AccountBalanceResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TipOfChainRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TipOfChainResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TotalSupplyRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TotalSupplyResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_LedgerArchiveRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_BlockRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_EncodedBlock_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_BlockResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_GetBlocksRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Refund_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ToppedUp_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_EncodedBlocks_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_GetBlocksResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_IterBlocksRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_IterBlocksResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ArchiveIndexEntry_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ArchiveIndexResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ArchiveInit_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ArchiveAddRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ArchiveAddResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_GetNodesRequest_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_GetNodesResponse_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_ICPTs_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Payment_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_BlockHeight_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Block_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Hash_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Account_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Transaction_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Send_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Mint_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Burn_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_AccountIdentifier_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Subaccount_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Memo_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_TimeStamp_msg; -extern const pb_msgdesc_t ic_ledger_pb_v1_Certification_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ic_ledger_pb_v1_LedgerInit_fields &ic_ledger_pb_v1_LedgerInit_msg -#define ic_ledger_pb_v1_LedgerUpgrade_fields &ic_ledger_pb_v1_LedgerUpgrade_msg -#define ic_ledger_pb_v1_SendRequest_fields &ic_ledger_pb_v1_SendRequest_msg -#define ic_ledger_pb_v1_SendResponse_fields &ic_ledger_pb_v1_SendResponse_msg -#define ic_ledger_pb_v1_NotifyRequest_fields &ic_ledger_pb_v1_NotifyRequest_msg -#define ic_ledger_pb_v1_NotifyResponse_fields &ic_ledger_pb_v1_NotifyResponse_msg -#define ic_ledger_pb_v1_TransactionNotificationRequest_fields &ic_ledger_pb_v1_TransactionNotificationRequest_msg -#define ic_ledger_pb_v1_TransactionNotificationResponse_fields &ic_ledger_pb_v1_TransactionNotificationResponse_msg -#define ic_ledger_pb_v1_CyclesNotificationResponse_fields &ic_ledger_pb_v1_CyclesNotificationResponse_msg -#define ic_ledger_pb_v1_AccountBalanceRequest_fields &ic_ledger_pb_v1_AccountBalanceRequest_msg -#define ic_ledger_pb_v1_AccountBalanceResponse_fields &ic_ledger_pb_v1_AccountBalanceResponse_msg -#define ic_ledger_pb_v1_TipOfChainRequest_fields &ic_ledger_pb_v1_TipOfChainRequest_msg -#define ic_ledger_pb_v1_TipOfChainResponse_fields &ic_ledger_pb_v1_TipOfChainResponse_msg -#define ic_ledger_pb_v1_TotalSupplyRequest_fields &ic_ledger_pb_v1_TotalSupplyRequest_msg -#define ic_ledger_pb_v1_TotalSupplyResponse_fields &ic_ledger_pb_v1_TotalSupplyResponse_msg -#define ic_ledger_pb_v1_LedgerArchiveRequest_fields &ic_ledger_pb_v1_LedgerArchiveRequest_msg -#define ic_ledger_pb_v1_BlockRequest_fields &ic_ledger_pb_v1_BlockRequest_msg -#define ic_ledger_pb_v1_EncodedBlock_fields &ic_ledger_pb_v1_EncodedBlock_msg -#define ic_ledger_pb_v1_BlockResponse_fields &ic_ledger_pb_v1_BlockResponse_msg -#define ic_ledger_pb_v1_GetBlocksRequest_fields &ic_ledger_pb_v1_GetBlocksRequest_msg -#define ic_ledger_pb_v1_Refund_fields &ic_ledger_pb_v1_Refund_msg -#define ic_ledger_pb_v1_ToppedUp_fields &ic_ledger_pb_v1_ToppedUp_msg -#define ic_ledger_pb_v1_EncodedBlocks_fields &ic_ledger_pb_v1_EncodedBlocks_msg -#define ic_ledger_pb_v1_GetBlocksResponse_fields &ic_ledger_pb_v1_GetBlocksResponse_msg -#define ic_ledger_pb_v1_IterBlocksRequest_fields &ic_ledger_pb_v1_IterBlocksRequest_msg -#define ic_ledger_pb_v1_IterBlocksResponse_fields &ic_ledger_pb_v1_IterBlocksResponse_msg -#define ic_ledger_pb_v1_ArchiveIndexEntry_fields &ic_ledger_pb_v1_ArchiveIndexEntry_msg -#define ic_ledger_pb_v1_ArchiveIndexResponse_fields &ic_ledger_pb_v1_ArchiveIndexResponse_msg -#define ic_ledger_pb_v1_ArchiveInit_fields &ic_ledger_pb_v1_ArchiveInit_msg -#define ic_ledger_pb_v1_ArchiveAddRequest_fields &ic_ledger_pb_v1_ArchiveAddRequest_msg -#define ic_ledger_pb_v1_ArchiveAddResponse_fields &ic_ledger_pb_v1_ArchiveAddResponse_msg -#define ic_ledger_pb_v1_GetNodesRequest_fields &ic_ledger_pb_v1_GetNodesRequest_msg -#define ic_ledger_pb_v1_GetNodesResponse_fields &ic_ledger_pb_v1_GetNodesResponse_msg -#define ic_ledger_pb_v1_ICPTs_fields &ic_ledger_pb_v1_ICPTs_msg -#define ic_ledger_pb_v1_Payment_fields &ic_ledger_pb_v1_Payment_msg -#define ic_ledger_pb_v1_BlockHeight_fields &ic_ledger_pb_v1_BlockHeight_msg -#define ic_ledger_pb_v1_Block_fields &ic_ledger_pb_v1_Block_msg -#define ic_ledger_pb_v1_Hash_fields &ic_ledger_pb_v1_Hash_msg -#define ic_ledger_pb_v1_Account_fields &ic_ledger_pb_v1_Account_msg -#define ic_ledger_pb_v1_Transaction_fields &ic_ledger_pb_v1_Transaction_msg -#define ic_ledger_pb_v1_Send_fields &ic_ledger_pb_v1_Send_msg -#define ic_ledger_pb_v1_Mint_fields &ic_ledger_pb_v1_Mint_msg -#define ic_ledger_pb_v1_Burn_fields &ic_ledger_pb_v1_Burn_msg -#define ic_ledger_pb_v1_AccountIdentifier_fields &ic_ledger_pb_v1_AccountIdentifier_msg -#define ic_ledger_pb_v1_Subaccount_fields &ic_ledger_pb_v1_Subaccount_msg -#define ic_ledger_pb_v1_Memo_fields &ic_ledger_pb_v1_Memo_msg -#define ic_ledger_pb_v1_TimeStamp_fields &ic_ledger_pb_v1_TimeStamp_msg -#define ic_ledger_pb_v1_Certification_fields &ic_ledger_pb_v1_Certification_msg - -/* Maximum encoded size of messages (where known) */ -/* ic_ledger_pb_v1_LedgerInit_size depends on runtime parameters */ -/* ic_ledger_pb_v1_SendRequest_size depends on runtime parameters */ -/* ic_ledger_pb_v1_NotifyRequest_size depends on runtime parameters */ -/* ic_ledger_pb_v1_TransactionNotificationRequest_size depends on runtime parameters */ -/* ic_ledger_pb_v1_TransactionNotificationResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_CyclesNotificationResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_TipOfChainResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_EncodedBlock_size depends on runtime parameters */ -/* ic_ledger_pb_v1_BlockResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_Refund_size depends on runtime parameters */ -/* ic_ledger_pb_v1_EncodedBlocks_size depends on runtime parameters */ -/* ic_ledger_pb_v1_GetBlocksResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_IterBlocksResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_ArchiveIndexResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_ArchiveAddRequest_size depends on runtime parameters */ -/* ic_ledger_pb_v1_GetNodesResponse_size depends on runtime parameters */ -/* ic_ledger_pb_v1_Block_size depends on runtime parameters */ -/* ic_ledger_pb_v1_Hash_size depends on runtime parameters */ -/* ic_ledger_pb_v1_Subaccount_size depends on runtime parameters */ -/* ic_ledger_pb_v1_Certification_size depends on runtime parameters */ -#define ic_ledger_pb_v1_AccountBalanceRequest_size 37 -#define ic_ledger_pb_v1_AccountBalanceResponse_size 13 -#define ic_ledger_pb_v1_AccountIdentifier_size 35 -#define ic_ledger_pb_v1_Account_size 50 -#define ic_ledger_pb_v1_ArchiveAddResponse_size 0 -#define ic_ledger_pb_v1_ArchiveIndexEntry_size 56 -#define ic_ledger_pb_v1_ArchiveInit_size 12 -#define ic_ledger_pb_v1_BlockHeight_size 11 -#define ic_ledger_pb_v1_BlockRequest_size 11 -#define ic_ledger_pb_v1_Burn_size 50 -#define ic_ledger_pb_v1_GetBlocksRequest_size 22 -#define ic_ledger_pb_v1_GetNodesRequest_size 0 -#define ic_ledger_pb_v1_ICPTs_size 11 -#define ic_ledger_pb_v1_IterBlocksRequest_size 22 -#define ic_ledger_pb_v1_LedgerArchiveRequest_size 13 -#define ic_ledger_pb_v1_LedgerUpgrade_size 0 -#define ic_ledger_pb_v1_Memo_size 11 -#define ic_ledger_pb_v1_Mint_size 50 -#define ic_ledger_pb_v1_NotifyResponse_size 0 -#define ic_ledger_pb_v1_Payment_size 13 -#define ic_ledger_pb_v1_SendResponse_size 13 -#define ic_ledger_pb_v1_Send_size 100 -#define ic_ledger_pb_v1_TimeStamp_size 11 -#define ic_ledger_pb_v1_TipOfChainRequest_size 0 -#define ic_ledger_pb_v1_ToppedUp_size 0 -#define ic_ledger_pb_v1_TotalSupplyRequest_size 0 -#define ic_ledger_pb_v1_TotalSupplyResponse_size 13 -#define ic_ledger_pb_v1_Transaction_size 141 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/app/src/protobuf/types.proto b/app/src/protobuf/types.proto deleted file mode 100644 index 1f951e7a..00000000 --- a/app/src/protobuf/types.proto +++ /dev/null @@ -1,292 +0,0 @@ -syntax = "proto3"; - -package ic_ledger.pb.v1; - -import "base_types.proto"; - -// Annotations related to the use of hardware wallets. The annotated messages are -// parsed on hardware wallets and marked fields are displayed in a trusted user -// interface (TUI). We must not, for instance, add fields that would change the -// semantics of the message such that old hardware wallets would not display -// appropriate information to users. - -// ** LEDGER CANISTER ENDPOINTS - -// Initialise the ledger canister -message LedgerInit { - AccountIdentifier minting_account = 1; - repeated Account initial_values = 2; - ic_base_types.pb.v1.PrincipalId archive_canister = 3; - uint32 max_message_size_bytes = 4; -} - - -// The format of values serialized to/from the stable memory during and upgrade -message LedgerUpgrade { -} - - -// Make a payment -message SendRequest { - option (ic_base_types.pb.v1.tui_signed_message) = true; - Memo memo = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - Payment payment = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - ICPTs max_fee = 3 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - Subaccount from_subaccount = 4 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - AccountIdentifier to = 5 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - BlockHeight created_at = 6; - TimeStamp created_at_time = 7; -} - -message SendResponse { - BlockHeight resulting_height = 1; -} - -// Notify a canister that it has received a payment -message NotifyRequest { - option (ic_base_types.pb.v1.tui_signed_message) = true; - BlockHeight block_height = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - ICPTs max_fee = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - Subaccount from_subaccount = 3 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - ic_base_types.pb.v1.PrincipalId to_canister = 4 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - Subaccount to_subaccount = 5 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; -} - -message NotifyResponse { -} - -message TransactionNotificationRequest { - ic_base_types.pb.v1.PrincipalId from = 1; - Subaccount from_subaccount = 2; - ic_base_types.pb.v1.PrincipalId to = 3; - Subaccount to_subaccount = 4; - BlockHeight block_height = 5; - ICPTs amount = 6; - Memo memo = 7; -} - -message TransactionNotificationResponse { - bytes response = 1; -} - -message CyclesNotificationResponse { - oneof response { - ic_base_types.pb.v1.PrincipalId created_canister_id = 1; - Refund refund = 2; - ToppedUp topped_up = 3; - } -} - -// Get the balance of an account -message AccountBalanceRequest { - AccountIdentifier account = 1; -} - -message AccountBalanceResponse { - ICPTs balance = 1; -} - -// Get the length of the chain with a certification -message TipOfChainRequest { -} - -message TipOfChainResponse { - Certification certification = 1; - BlockHeight chain_length = 2; -} - -// How many ICPTs are there not in the minting account -message TotalSupplyRequest { -} - -message TotalSupplyResponse { - ICPTs total_supply = 1; -} - -// Archive any blocks older than this -message LedgerArchiveRequest { - TimeStamp timestamp = 1; -} - -// * Shared Endpoints * - -// Get a single block -message BlockRequest { - uint64 block_height = 1; -} - -message EncodedBlock { - bytes block = 1; -} - -message BlockResponse { - oneof block_content { - EncodedBlock block = 1; - ic_base_types.pb.v1.PrincipalId canister_id = 2; - } -} - -// Get a set of blocks -message GetBlocksRequest { - uint64 start = 1; - uint64 length = 2; -} - -message Refund { - BlockHeight refund = 2; - string error = 3; -} - -message ToppedUp { -} - -message EncodedBlocks { - repeated EncodedBlock blocks = 1; -} - -message GetBlocksResponse { - oneof get_blocks_content { - EncodedBlocks blocks = 1; - string error = 2; - } -} - -// Iterate through blocks -message IterBlocksRequest { - uint64 start = 1; - uint64 length = 2; -} - -message IterBlocksResponse { - repeated EncodedBlock blocks = 1; -} - -message ArchiveIndexEntry { - uint64 height_from = 1; - uint64 height_to = 2; - ic_base_types.pb.v1.PrincipalId canister_id = 3; -} - -message ArchiveIndexResponse { - repeated ArchiveIndexEntry entries = 1; -} - - -// ** ARCHIVE CANISTER ENDPOINTS ** - -// * Archive canister * -// Init the archive canister -message ArchiveInit { - uint32 node_max_memory_size_bytes = 1; - uint32 max_message_size_bytes = 2; -} - - -// Add blocks to the archive canister -message ArchiveAddRequest { - repeated Block blocks = 1; -} - -message ArchiveAddResponse { -} - - -// Fetch a list of all of the archive nodes -message GetNodesRequest { -} - -message GetNodesResponse { - repeated ic_base_types.pb.v1.PrincipalId nodes = 1; -} - - -// ** BASIC TYPES ** -message ICPTs { - option (ic_base_types.pb.v1.tui_signed_message) = true; - uint64 e8s = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - -} - -message Payment { - option (ic_base_types.pb.v1.tui_signed_message) = true; - ICPTs receiver_gets = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - -} - -message BlockHeight { - option (ic_base_types.pb.v1.tui_signed_message) = true; - uint64 height = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; -} - - -// This is the -message Block { - Hash parent_hash = 1; - TimeStamp timestamp = 2; - Transaction transaction = 3; -} - -message Hash { - bytes hash = 1; -} - -message Account { - AccountIdentifier identifier = 1; - ICPTs balance = 2; -} - -message Transaction { - oneof transfer { - Burn burn = 1; - Mint mint = 2; - Send send = 3; - } - Memo memo = 4; - BlockHeight created_at = 5; // obsolete - TimeStamp created_at_time = 6; -} - -message Send { - AccountIdentifier from = 1; - AccountIdentifier to = 2; - ICPTs amount = 3; - ICPTs max_fee = 4; -} - -message Mint { - AccountIdentifier to = 2; - ICPTs amount = 3; -} - -message Burn { - AccountIdentifier from = 1; - ICPTs amount = 3; -} - - -message AccountIdentifier { - option (ic_base_types.pb.v1.tui_signed_message) = true; - bytes hash = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - -} - -message Subaccount { - option (ic_base_types.pb.v1.tui_signed_message) = true; - bytes sub_account = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - -} - -message Memo { - option (ic_base_types.pb.v1.tui_signed_message) = true; - uint64 memo = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true]; - -} - -message TimeStamp { - uint64 timestamp_nanos = 1; -} - -message Certification { - bytes certification = 1; -} - diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index 52dfdeae..f19112bb 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit 52dfdeae81bb0b50cf3332f4690ed5c978f15f27 +Subproject commit f19112bb6340721c276af459924b3c4261c0291a diff --git a/deps/nanopb b/deps/nanopb deleted file mode 160000 index f5f65a90..00000000 --- a/deps/nanopb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5f65a90c8057a591f3cc98de40874bd78c9880d diff --git a/deps/nanopb_tiny/pb.h b/deps/nanopb_tiny/pb.h deleted file mode 100644 index f1f3a101..00000000 --- a/deps/nanopb_tiny/pb.h +++ /dev/null @@ -1,880 +0,0 @@ -/* Common parts of the nanopb library. Most of these are quite low-level - * stuff. For the high-level interface, see pb_encode.h and pb_decode.h. - */ - -#ifndef PB_H_INCLUDED -#define PB_H_INCLUDED - -/***************************************************************** - * Nanopb compilation time options. You can change these here by * - * uncommenting the lines, or on the compiler command line. * - *****************************************************************/ - -/* Enable support for dynamically allocated fields */ -/* #define PB_ENABLE_MALLOC 1 */ - -/* Define this if your CPU / compiler combination does not support - * unaligned memory access to packed structures. */ -/* #define PB_NO_PACKED_STRUCTS 1 */ - -/* Increase the number of required fields that are tracked. - * A compiler warning will tell if you need this. */ -/* #define PB_MAX_REQUIRED_FIELDS 256 */ - -/* Add support for tag numbers > 65536 and fields larger than 65536 bytes. */ -/* #define PB_FIELD_32BIT 1 */ - -/* Disable support for error messages in order to save some code space. */ -/* #define PB_NO_ERRMSG 1 */ - -/* Disable support for custom streams (support only memory buffers). */ -/* #define PB_BUFFER_ONLY 1 */ - -/* Disable support for 64-bit datatypes, for compilers without int64_t - or to save some code space. */ -/* #define PB_WITHOUT_64BIT 1 */ - -/* Don't encode scalar arrays as packed. This is only to be used when - * the decoder on the receiving side cannot process packed scalar arrays. - * Such example is older protobuf.js. */ -/* #define PB_ENCODE_ARRAYS_UNPACKED 1 */ - -/* Enable conversion of doubles to floats for platforms that do not - * support 64-bit doubles. Most commonly AVR. */ -/* #define PB_CONVERT_DOUBLE_FLOAT 1 */ - -/* Check whether incoming strings are valid UTF-8 sequences. Slows down - * the string processing slightly and slightly increases code size. */ -/* #define PB_VALIDATE_UTF8 1 */ - -/****************************************************************** - * You usually don't need to change anything below this line. * - * Feel free to look around and use the defined macros, though. * - ******************************************************************/ - - -/* Version of the nanopb library. Just in case you want to check it in - * your own program. */ -#define NANOPB_VERSION nanopb-0.4.6-dev - -/* Include all the system headers needed by nanopb. You will need the - * definitions of the following: - * - strlen, memcpy, memset functions - * - [u]int_least8_t, uint_fast8_t, [u]int_least16_t, [u]int32_t, [u]int64_t - * - size_t - * - bool - * - * If you don't have the standard header files, you can instead provide - * a custom header that defines or includes all this. In that case, - * define PB_SYSTEM_HEADER to the path of this file. - */ -#ifdef PB_SYSTEM_HEADER -#include PB_SYSTEM_HEADER -#else - -#include -#include -#include -#include -#include - -#ifdef PB_ENABLE_MALLOC -#include -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macro for defining packed structures (compiler dependent). - * This just reduces memory requirements, but is not required. - */ -#if defined(PB_NO_PACKED_STRUCTS) -/* Disable struct packing */ -# define PB_PACKED_STRUCT_START -# define PB_PACKED_STRUCT_END -# define pb_packed -#elif defined(__GNUC__) || defined(__clang__) -/* For GCC and clang */ -# define PB_PACKED_STRUCT_START -# define PB_PACKED_STRUCT_END -# define pb_packed __attribute__((packed)) -#elif defined(__ICCARM__) || defined(__CC_ARM) -/* For IAR ARM and Keil MDK-ARM compilers */ -# define PB_PACKED_STRUCT_START _Pragma("pack(push, 1)") -# define PB_PACKED_STRUCT_END _Pragma("pack(pop)") -# define pb_packed -#elif defined(_MSC_VER) && (_MSC_VER >= 1500) -/* For Microsoft Visual C++ */ -# define PB_PACKED_STRUCT_START __pragma(pack(push, 1)) -# define PB_PACKED_STRUCT_END __pragma(pack(pop)) -# define pb_packed -#else -/* Unknown compiler */ -# define PB_PACKED_STRUCT_START -# define PB_PACKED_STRUCT_END -# define pb_packed -#endif - -/* Handly macro for suppressing unreferenced-parameter compiler warnings. */ -#ifndef PB_UNUSED -#define PB_UNUSED(x) (void)(x) -#endif - -/* Harvard-architecture processors may need special attributes for storing - * field information in program memory. */ -#ifndef PB_PROGMEM -#ifdef __AVR__ -#include -#define PB_PROGMEM PROGMEM -#define PB_PROGMEM_READU32(x) pgm_read_dword(&x) -#else -#define PB_PROGMEM -#define PB_PROGMEM_READU32(x, y) *((uint32_t *)PIC(x)+(y)) -#define PB_PROGMEM_READTYPE(TYPE, VALUE, OFFSET) *((TYPE *)PIC(VALUE)+(OFFSET)) -#endif -#endif - -/* Compile-time assertion, used for checking compatible compilation options. - * If this does not work properly on your compiler, use - * #define PB_NO_STATIC_ASSERT to disable it. - * - * But before doing that, check carefully the error message / place where it - * comes from to see if the error has a real cause. Unfortunately the error - * message is not always very clear to read, but you can see the reason better - * in the place where the PB_STATIC_ASSERT macro was called. - */ -#ifndef PB_NO_STATIC_ASSERT -# ifndef PB_STATIC_ASSERT -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -/* C11 standard _Static_assert mechanism */ -# define PB_STATIC_ASSERT(COND,MSG) _Static_assert(COND,#MSG); -# else -/* Classic negative-size-array static assert mechanism */ -# define PB_STATIC_ASSERT(COND, MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1]; -# define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) -# define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##_##LINE##_##COUNTER -# endif -# endif -#else -/* Static asserts disabled by PB_NO_STATIC_ASSERT */ -# define PB_STATIC_ASSERT(COND,MSG) -#endif - -/* Number of required fields to keep track of. */ -#ifndef PB_MAX_REQUIRED_FIELDS -#define PB_MAX_REQUIRED_FIELDS 64 -#endif - -#if PB_MAX_REQUIRED_FIELDS < 64 -#error You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64). -#endif - -#ifdef PB_WITHOUT_64BIT -#ifdef PB_CONVERT_DOUBLE_FLOAT -/* Cannot use doubles without 64-bit types */ -#undef PB_CONVERT_DOUBLE_FLOAT -#endif -#endif - -/* List of possible field types. These are used in the autogenerated code. - * Least-significant 4 bits tell the scalar type - * Most-significant 4 bits specify repeated/required/packed etc. - */ - -typedef uint_least8_t pb_type_t; - -/**** Field data types ****/ - -/* Numeric types */ -#define PB_LTYPE_BOOL 0x00U /* bool */ -#define PB_LTYPE_VARINT 0x01U /* int32, int64, enum, bool */ -#define PB_LTYPE_UVARINT 0x02U /* uint32, uint64 */ -#define PB_LTYPE_SVARINT 0x03U /* sint32, sint64 */ -#define PB_LTYPE_FIXED32 0x04U /* fixed32, sfixed32, float */ -#define PB_LTYPE_FIXED64 0x05U /* fixed64, sfixed64, double */ - -/* Marker for last packable field type. */ -#define PB_LTYPE_LAST_PACKABLE 0x05U - -/* Byte array with pre-allocated buffer. - * data_size is the length of the allocated PB_BYTES_ARRAY structure. */ -#define PB_LTYPE_BYTES 0x06U - -/* String with pre-allocated buffer. - * data_size is the maximum length. */ -#define PB_LTYPE_STRING 0x07U - -/* Submessage - * submsg_fields is pointer to field descriptions */ -#define PB_LTYPE_SUBMESSAGE 0x08U - -/* Submessage with pre-decoding callback - * The pre-decoding callback is stored as pb_callback_t right before pSize. - * submsg_fields is pointer to field descriptions */ -#define PB_LTYPE_SUBMSG_W_CB 0x09U - -/* Extension pseudo-field - * The field contains a pointer to pb_extension_t */ -#define PB_LTYPE_EXTENSION 0x0AU - -/* Byte array with inline, pre-allocated byffer. - * data_size is the length of the inline, allocated buffer. - * This differs from PB_LTYPE_BYTES by defining the element as - * pb_byte_t[data_size] rather than pb_bytes_array_t. */ -#define PB_LTYPE_FIXED_LENGTH_BYTES 0x0BU - -/* Number of declared LTYPES */ -#define PB_LTYPES_COUNT 0x0CU -#define PB_LTYPE_MASK 0x0FU - -/**** Field repetition rules ****/ - -#define PB_HTYPE_REQUIRED 0x00U -#define PB_HTYPE_OPTIONAL 0x10U -#define PB_HTYPE_SINGULAR 0x10U -#define PB_HTYPE_REPEATED 0x20U -#define PB_HTYPE_FIXARRAY 0x20U -#define PB_HTYPE_ONEOF 0x30U -#define PB_HTYPE_MASK 0x30U - -/**** Field allocation types ****/ - -#define PB_ATYPE_STATIC 0x00U -#define PB_ATYPE_POINTER 0x80U -#define PB_ATYPE_CALLBACK 0x40U -#define PB_ATYPE_MASK 0xC0U - -#define PB_ATYPE(x) ((x) & PB_ATYPE_MASK) -#define PB_HTYPE(x) ((x) & PB_HTYPE_MASK) -#define PB_LTYPE(x) ((x) & PB_LTYPE_MASK) -#define PB_LTYPE_IS_SUBMSG(x) (PB_LTYPE(x) == PB_LTYPE_SUBMESSAGE || \ - PB_LTYPE(x) == PB_LTYPE_SUBMSG_W_CB) - -/* Data type used for storing sizes of struct fields - * and array counts. - */ -#if defined(PB_FIELD_32BIT) -typedef uint32_t pb_size_t; -typedef int32_t pb_ssize_t; -#else -typedef uint_least16_t pb_size_t; -typedef int_least16_t pb_ssize_t; -#endif -#define PB_SIZE_MAX ((pb_size_t)-1) - -/* Data type for storing encoded data and other byte streams. - * This typedef exists to support platforms where uint8_t does not exist. - * You can regard it as equivalent on uint8_t on other platforms. - */ -typedef uint_least8_t pb_byte_t; - -/* Forward declaration of struct types */ -typedef struct pb_istream_s pb_istream_t; -typedef struct pb_ostream_s pb_ostream_t; -typedef struct pb_field_iter_s pb_field_iter_t; - -/* This structure is used in auto-generated constants - * to specify struct fields. - */ -typedef struct pb_msgdesc_s pb_msgdesc_t; -struct pb_msgdesc_s { - const uint32_t *field_info; - const pb_msgdesc_t *const *submsg_info; - const pb_byte_t *default_value; - - bool (*field_callback)(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_iter_t *field); - - pb_size_t field_count; - pb_size_t required_field_count; - pb_size_t largest_tag; -}; - -/* Iterator for message descriptor */ -struct pb_field_iter_s { - const pb_msgdesc_t *descriptor; /* Pointer to message descriptor constant */ - void *message; /* Pointer to start of the structure */ - - pb_size_t index; /* Index of the field */ - pb_size_t field_info_index; /* Index to descriptor->field_info array */ - pb_size_t required_field_index; /* Index that counts only the required fields */ - pb_size_t submessage_index; /* Index that counts only submessages */ - - pb_size_t tag; /* Tag of current field */ - pb_size_t data_size; /* sizeof() of a single item */ - pb_size_t array_size; /* Number of array entries */ - pb_type_t type; /* Type of current field */ - - void *pField; /* Pointer to current field in struct */ - void *pData; /* Pointer to current data contents. Different than pField for arrays and pointers. */ - void *pSize; /* Pointer to count/has field */ - - const pb_msgdesc_t *submsg_desc; /* For submessage fields, pointer to field descriptor for the submessage. */ -}; - -/* For compatibility with legacy code */ -typedef pb_field_iter_t pb_field_t; - -/* Make sure that the standard integer types are of the expected sizes. - * Otherwise fixed32/fixed64 fields can break. - * - * If you get errors here, it probably means that your stdint.h is not - * correct for your platform. - */ -#ifndef PB_WITHOUT_64BIT -PB_STATIC_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t), INT64_T_WRONG_SIZE) -PB_STATIC_ASSERT(sizeof(uint64_t) == 2 * sizeof(uint32_t), UINT64_T_WRONG_SIZE) -#endif - -/* This structure is used for 'bytes' arrays. - * It has the number of bytes in the beginning, and after that an array. - * Note that actual structs used will have a different length of bytes array. - */ -#define PB_BYTES_ARRAY_T(n) struct { pb_size_t size; pb_byte_t bytes[n]; } -#define PB_BYTES_ARRAY_T_ALLOCSIZE(n) ((size_t)n + offsetof(pb_bytes_array_t, bytes)) - -struct pb_bytes_array_s { - pb_size_t size; - pb_byte_t bytes[1]; -}; -typedef struct pb_bytes_array_s pb_bytes_array_t; - -/* This structure is used for giving the callback function. - * It is stored in the message structure and filled in by the method that - * calls pb_decode. - * - * The decoding callback will be given a limited-length stream - * If the wire type was string, the length is the length of the string. - * If the wire type was a varint/fixed32/fixed64, the length is the length - * of the actual value. - * The function may be called multiple times (especially for repeated types, - * but also otherwise if the message happens to contain the field multiple - * times.) - * - * The encoding callback will receive the actual output stream. - * It should write all the data in one call, including the field tag and - * wire type. It can write multiple fields. - * - * The callback can be null if you want to skip a field. - */ -typedef struct pb_callback_s pb_callback_t; -struct pb_callback_s { - /* Callback functions receive a pointer to the arg field. - * You can access the value of the field as *arg, and modify it if needed. - */ - union { - bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg); - - bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void *const *arg); - } funcs; - - /* Free arg for use by callback */ - void *arg; -}; - -extern bool pb_default_field_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field); - -/* Wire types. Library user needs these only in encoder callbacks. */ -typedef enum { - PB_WT_VARINT = 0, - PB_WT_64BIT = 1, - PB_WT_STRING = 2, - PB_WT_32BIT = 5 -} pb_wire_type_t; - -/* Structure for defining the handling of unknown/extension fields. - * Usually the pb_extension_type_t structure is automatically generated, - * while the pb_extension_t structure is created by the user. However, - * if you want to catch all unknown fields, you can also create a custom - * pb_extension_type_t with your own callback. - */ -typedef struct pb_extension_type_s pb_extension_type_t; -typedef struct pb_extension_s pb_extension_t; -struct pb_extension_type_s { - /* Called for each unknown field in the message. - * If you handle the field, read off all of its data and return true. - * If you do not handle the field, do not read anything and return true. - * If you run into an error, return false. - * Set to NULL for default handler. - */ - bool (*decode)(pb_istream_t *stream, pb_extension_t *extension, - uint32_t tag, pb_wire_type_t wire_type); - - /* Called once after all regular fields have been encoded. - * If you have something to write, do so and return true. - * If you do not have anything to write, just return true. - * If you run into an error, return false. - * Set to NULL for default handler. - */ - bool (*encode)(pb_ostream_t *stream, const pb_extension_t *extension); - - /* Free field for use by the callback. */ - const void *arg; -}; - -struct pb_extension_s { - /* Type describing the extension field. Usually you'll initialize - * this to a pointer to the automatically generated structure. */ - const pb_extension_type_t *type; - - /* Destination for the decoded data. This must match the datatype - * of the extension field. */ - void *dest; - - /* Pointer to the next extension handler, or NULL. - * If this extension does not match a field, the next handler is - * automatically called. */ - pb_extension_t *next; - - /* The decoder sets this to true if the extension was found. - * Ignored for encoding. */ - bool found; -}; - -#define pb_extension_init_zero {NULL,NULL,NULL,false} - -/* Memory allocation functions to use. You can define pb_realloc and - * pb_free to custom functions if you want. */ -#ifdef PB_ENABLE_MALLOC -# ifndef pb_realloc -# define pb_realloc(ptr, size) realloc(ptr, size) -# endif -# ifndef pb_free -# define pb_free(ptr) free(ptr) -# endif -#endif - -/* This is used to inform about need to regenerate .pb.h/.pb.c files. */ -#define PB_PROTO_HEADER_VERSION 40 - -/* These macros are used to declare pb_field_t's in the constant array. */ -/* Size of a structure member, in bytes. */ -#define pb_membersize(st, m) (sizeof ((st*)0)->m) -/* Number of entries in an array. */ -#define pb_arraysize(st, m) (pb_membersize(st, m) / pb_membersize(st, m[0])) -/* Delta from start of one member to the start of another member. */ -#define pb_delta(st, m1, m2) ((int)offsetof(st, m1) - (int)offsetof(st, m2)) - -/* Force expansion of macro value */ -#define PB_EXPAND(x) x - -/* Binding of a message field set into a specific structure */ -#define PB_BIND(msgname, structname, width) \ - const uint32_t structname ## _field_info[] PB_PROGMEM = \ - { \ - msgname ## _FIELDLIST(PB_GEN_FIELD_INFO_ ## width, structname) \ - 0 \ - }; \ - const pb_msgdesc_t* const structname ## _submsg_info[] = \ - { \ - msgname ## _FIELDLIST(PB_GEN_SUBMSG_INFO, structname) \ - NULL \ - }; \ - const pb_msgdesc_t structname ## _msg = \ - { \ - structname ## _field_info, \ - structname ## _submsg_info, \ - msgname ## _DEFAULT, \ - msgname ## _CALLBACK, \ - 0 msgname ## _FIELDLIST(PB_GEN_FIELD_COUNT, structname), \ - 0 msgname ## _FIELDLIST(PB_GEN_REQ_FIELD_COUNT, structname), \ - 0 msgname ## _FIELDLIST(PB_GEN_LARGEST_TAG, structname), \ - }; \ - msgname ## _FIELDLIST(PB_GEN_FIELD_INFO_ASSERT_ ## width, structname) - -#define PB_GEN_FIELD_COUNT(structname, atype, htype, ltype, fieldname, tag) +1 -#define PB_GEN_REQ_FIELD_COUNT(structname, atype, htype, ltype, fieldname, tag) \ - + (PB_HTYPE_ ## htype == PB_HTYPE_REQUIRED) -#define PB_GEN_LARGEST_TAG(structname, atype, htype, ltype, fieldname, tag) \ - * 0 + tag - -/* X-macro for generating the entries in struct_field_info[] array. */ -#define PB_GEN_FIELD_INFO_1(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_1(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_2(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_2(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_4(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_4(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_8(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_8(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_AUTO(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_AUTO2(PB_FIELDINFO_WIDTH_AUTO(_PB_ATYPE_ ## atype, _PB_HTYPE_ ## htype, _PB_LTYPE_ ## ltype), \ - tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_FIELDINFO_AUTO2(width, tag, type, data_offset, data_size, size_offset, array_size) \ - PB_FIELDINFO_AUTO3(width, tag, type, data_offset, data_size, size_offset, array_size) - -#define PB_FIELDINFO_AUTO3(width, tag, type, data_offset, data_size, size_offset, array_size) \ - PB_FIELDINFO_ ## width(tag, type, data_offset, data_size, size_offset, array_size) - -/* X-macro for generating asserts that entries fit in struct_field_info[] array. - * The structure of macros here must match the structure above in PB_GEN_FIELD_INFO_x(), - * but it is not easily reused because of how macro substitutions work. */ -#define PB_GEN_FIELD_INFO_ASSERT_1(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_ASSERT_1(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_ASSERT_2(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_ASSERT_2(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_ASSERT_4(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_ASSERT_4(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_ASSERT_8(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_ASSERT_8(tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_GEN_FIELD_INFO_ASSERT_AUTO(structname, atype, htype, ltype, fieldname, tag) \ - PB_FIELDINFO_ASSERT_AUTO2(PB_FIELDINFO_WIDTH_AUTO(_PB_ATYPE_ ## atype, _PB_HTYPE_ ## htype, _PB_LTYPE_ ## ltype), \ - tag, PB_ATYPE_ ## atype | PB_HTYPE_ ## htype | PB_LTYPE_MAP_ ## ltype, \ - PB_DATA_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_SIZE_OFFSET_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \ - PB_ARRAY_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname)) - -#define PB_FIELDINFO_ASSERT_AUTO2(width, tag, type, data_offset, data_size, size_offset, array_size) \ - PB_FIELDINFO_ASSERT_AUTO3(width, tag, type, data_offset, data_size, size_offset, array_size) - -#define PB_FIELDINFO_ASSERT_AUTO3(width, tag, type, data_offset, data_size, size_offset, array_size) \ - PB_FIELDINFO_ASSERT_ ## width(tag, type, data_offset, data_size, size_offset, array_size) - -#define PB_DATA_OFFSET_STATIC(htype, structname, fieldname) PB_DO ## htype(structname, fieldname) -#define PB_DATA_OFFSET_POINTER(htype, structname, fieldname) PB_DO ## htype(structname, fieldname) -#define PB_DATA_OFFSET_CALLBACK(htype, structname, fieldname) PB_DO ## htype(structname, fieldname) -#define PB_DO_PB_HTYPE_REQUIRED(structname, fieldname) offsetof(structname, fieldname) -#define PB_DO_PB_HTYPE_SINGULAR(structname, fieldname) offsetof(structname, fieldname) -#define PB_DO_PB_HTYPE_ONEOF(structname, fieldname) offsetof(structname, PB_ONEOF_NAME(FULL, fieldname)) -#define PB_DO_PB_HTYPE_OPTIONAL(structname, fieldname) offsetof(structname, fieldname) -#define PB_DO_PB_HTYPE_REPEATED(structname, fieldname) offsetof(structname, fieldname) -#define PB_DO_PB_HTYPE_FIXARRAY(structname, fieldname) offsetof(structname, fieldname) - -#define PB_SIZE_OFFSET_STATIC(htype, structname, fieldname) PB_SO ## htype(structname, fieldname) -#define PB_SIZE_OFFSET_POINTER(htype, structname, fieldname) PB_SO_PTR ## htype(structname, fieldname) -#define PB_SIZE_OFFSET_CALLBACK(htype, structname, fieldname) PB_SO_CB ## htype(structname, fieldname) -#define PB_SO_PB_HTYPE_REQUIRED(structname, fieldname) 0 -#define PB_SO_PB_HTYPE_SINGULAR(structname, fieldname) 0 -#define PB_SO_PB_HTYPE_ONEOF(structname, fieldname) PB_SO_PB_HTYPE_ONEOF2(structname, PB_ONEOF_NAME(FULL, fieldname), PB_ONEOF_NAME(UNION, fieldname)) -#define PB_SO_PB_HTYPE_ONEOF2(structname, fullname, unionname) PB_SO_PB_HTYPE_ONEOF3(structname, fullname, unionname) -#define PB_SO_PB_HTYPE_ONEOF3(structname, fullname, unionname) pb_delta(structname, fullname, which_ ## unionname) -#define PB_SO_PB_HTYPE_OPTIONAL(structname, fieldname) pb_delta(structname, fieldname, has_ ## fieldname) -#define PB_SO_PB_HTYPE_REPEATED(structname, fieldname) pb_delta(structname, fieldname, fieldname ## _count) -#define PB_SO_PB_HTYPE_FIXARRAY(structname, fieldname) 0 -#define PB_SO_PTR_PB_HTYPE_REQUIRED(structname, fieldname) 0 -#define PB_SO_PTR_PB_HTYPE_SINGULAR(structname, fieldname) 0 -#define PB_SO_PTR_PB_HTYPE_ONEOF(structname, fieldname) PB_SO_PB_HTYPE_ONEOF(structname, fieldname) -#define PB_SO_PTR_PB_HTYPE_OPTIONAL(structname, fieldname) 0 -#define PB_SO_PTR_PB_HTYPE_REPEATED(structname, fieldname) PB_SO_PB_HTYPE_REPEATED(structname, fieldname) -#define PB_SO_PTR_PB_HTYPE_FIXARRAY(structname, fieldname) 0 -#define PB_SO_CB_PB_HTYPE_REQUIRED(structname, fieldname) 0 -#define PB_SO_CB_PB_HTYPE_SINGULAR(structname, fieldname) 0 -#define PB_SO_CB_PB_HTYPE_ONEOF(structname, fieldname) PB_SO_PB_HTYPE_ONEOF(structname, fieldname) -#define PB_SO_CB_PB_HTYPE_OPTIONAL(structname, fieldname) 0 -#define PB_SO_CB_PB_HTYPE_REPEATED(structname, fieldname) 0 -#define PB_SO_CB_PB_HTYPE_FIXARRAY(structname, fieldname) 0 - -#define PB_ARRAY_SIZE_STATIC(htype, structname, fieldname) PB_AS ## htype(structname, fieldname) -#define PB_ARRAY_SIZE_POINTER(htype, structname, fieldname) PB_AS_PTR ## htype(structname, fieldname) -#define PB_ARRAY_SIZE_CALLBACK(htype, structname, fieldname) 1 -#define PB_AS_PB_HTYPE_REQUIRED(structname, fieldname) 1 -#define PB_AS_PB_HTYPE_SINGULAR(structname, fieldname) 1 -#define PB_AS_PB_HTYPE_OPTIONAL(structname, fieldname) 1 -#define PB_AS_PB_HTYPE_ONEOF(structname, fieldname) 1 -#define PB_AS_PB_HTYPE_REPEATED(structname, fieldname) pb_arraysize(structname, fieldname) -#define PB_AS_PB_HTYPE_FIXARRAY(structname, fieldname) pb_arraysize(structname, fieldname) -#define PB_AS_PTR_PB_HTYPE_REQUIRED(structname, fieldname) 1 -#define PB_AS_PTR_PB_HTYPE_SINGULAR(structname, fieldname) 1 -#define PB_AS_PTR_PB_HTYPE_OPTIONAL(structname, fieldname) 1 -#define PB_AS_PTR_PB_HTYPE_ONEOF(structname, fieldname) 1 -#define PB_AS_PTR_PB_HTYPE_REPEATED(structname, fieldname) 1 -#define PB_AS_PTR_PB_HTYPE_FIXARRAY(structname, fieldname) pb_arraysize(structname, fieldname[0]) - -#define PB_DATA_SIZE_STATIC(htype, structname, fieldname) PB_DS ## htype(structname, fieldname) -#define PB_DATA_SIZE_POINTER(htype, structname, fieldname) PB_DS_PTR ## htype(structname, fieldname) -#define PB_DATA_SIZE_CALLBACK(htype, structname, fieldname) PB_DS_CB ## htype(structname, fieldname) -#define PB_DS_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_PB_HTYPE_SINGULAR(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_PB_HTYPE_OPTIONAL(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_PB_HTYPE_ONEOF(structname, fieldname) pb_membersize(structname, PB_ONEOF_NAME(FULL, fieldname)) -#define PB_DS_PB_HTYPE_REPEATED(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PB_HTYPE_FIXARRAY(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PTR_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PTR_PB_HTYPE_SINGULAR(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PTR_PB_HTYPE_OPTIONAL(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PTR_PB_HTYPE_ONEOF(structname, fieldname) pb_membersize(structname, PB_ONEOF_NAME(FULL, fieldname)[0]) -#define PB_DS_PTR_PB_HTYPE_REPEATED(structname, fieldname) pb_membersize(structname, fieldname[0]) -#define PB_DS_PTR_PB_HTYPE_FIXARRAY(structname, fieldname) pb_membersize(structname, fieldname[0][0]) -#define PB_DS_CB_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_CB_PB_HTYPE_SINGULAR(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_CB_PB_HTYPE_OPTIONAL(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_CB_PB_HTYPE_ONEOF(structname, fieldname) pb_membersize(structname, PB_ONEOF_NAME(FULL, fieldname)) -#define PB_DS_CB_PB_HTYPE_REPEATED(structname, fieldname) pb_membersize(structname, fieldname) -#define PB_DS_CB_PB_HTYPE_FIXARRAY(structname, fieldname) pb_membersize(structname, fieldname) - -#define PB_ONEOF_NAME(type, tuple) PB_EXPAND(PB_ONEOF_NAME_ ## type tuple) -#define PB_ONEOF_NAME_UNION(unionname, membername, fullname) unionname -#define PB_ONEOF_NAME_MEMBER(unionname, membername, fullname) membername -#define PB_ONEOF_NAME_FULL(unionname, membername, fullname) fullname - -#define PB_GEN_SUBMSG_INFO(structname, atype, htype, ltype, fieldname, tag) \ - PB_SUBMSG_INFO_ ## htype(_PB_LTYPE_ ## ltype, structname, fieldname) - -#define PB_SUBMSG_INFO_REQUIRED(ltype, structname, fieldname) PB_SI ## ltype(structname ## _ ## fieldname ## _MSGTYPE) -#define PB_SUBMSG_INFO_SINGULAR(ltype, structname, fieldname) PB_SI ## ltype(structname ## _ ## fieldname ## _MSGTYPE) -#define PB_SUBMSG_INFO_OPTIONAL(ltype, structname, fieldname) PB_SI ## ltype(structname ## _ ## fieldname ## _MSGTYPE) -#define PB_SUBMSG_INFO_ONEOF(ltype, structname, fieldname) PB_SUBMSG_INFO_ONEOF2(ltype, structname, PB_ONEOF_NAME(UNION, fieldname), PB_ONEOF_NAME(MEMBER, fieldname)) -#define PB_SUBMSG_INFO_ONEOF2(ltype, structname, unionname, membername) PB_SUBMSG_INFO_ONEOF3(ltype, structname, unionname, membername) -#define PB_SUBMSG_INFO_ONEOF3(ltype, structname, unionname, membername) PB_SI ## ltype(structname ## _ ## unionname ## _ ## membername ## _MSGTYPE) -#define PB_SUBMSG_INFO_REPEATED(ltype, structname, fieldname) PB_SI ## ltype(structname ## _ ## fieldname ## _MSGTYPE) -#define PB_SUBMSG_INFO_FIXARRAY(ltype, structname, fieldname) PB_SI ## ltype(structname ## _ ## fieldname ## _MSGTYPE) -#define PB_SI_PB_LTYPE_BOOL(t) -#define PB_SI_PB_LTYPE_BYTES(t) -#define PB_SI_PB_LTYPE_DOUBLE(t) -#define PB_SI_PB_LTYPE_ENUM(t) -#define PB_SI_PB_LTYPE_UENUM(t) -#define PB_SI_PB_LTYPE_FIXED32(t) -#define PB_SI_PB_LTYPE_FIXED64(t) -#define PB_SI_PB_LTYPE_FLOAT(t) -#define PB_SI_PB_LTYPE_INT32(t) -#define PB_SI_PB_LTYPE_INT64(t) -#define PB_SI_PB_LTYPE_MESSAGE(t) PB_SUBMSG_DESCRIPTOR(t) -#define PB_SI_PB_LTYPE_MSG_W_CB(t) PB_SUBMSG_DESCRIPTOR(t) -#define PB_SI_PB_LTYPE_SFIXED32(t) -#define PB_SI_PB_LTYPE_SFIXED64(t) -#define PB_SI_PB_LTYPE_SINT32(t) -#define PB_SI_PB_LTYPE_SINT64(t) -#define PB_SI_PB_LTYPE_STRING(t) -#define PB_SI_PB_LTYPE_UINT32(t) -#define PB_SI_PB_LTYPE_UINT64(t) -#define PB_SI_PB_LTYPE_EXTENSION(t) -#define PB_SI_PB_LTYPE_FIXED_LENGTH_BYTES(t) -#define PB_SUBMSG_DESCRIPTOR(t) &(t ## _msg), - -/* The field descriptors use a variable width format, with width of either - * 1, 2, 4 or 8 of 32-bit words. The two lowest bytes of the first byte always - * encode the descriptor size, 6 lowest bits of field tag number, and 8 bits - * of the field type. - * - * Descriptor size is encoded as 0 = 1 word, 1 = 2 words, 2 = 4 words, 3 = 8 words. - * - * Formats, listed starting with the least significant bit of the first word. - * 1 word: [2-bit len] [6-bit tag] [8-bit type] [8-bit data_offset] [4-bit size_offset] [4-bit data_size] - * - * 2 words: [2-bit len] [6-bit tag] [8-bit type] [12-bit array_size] [4-bit size_offset] - * [16-bit data_offset] [12-bit data_size] [4-bit tag>>6] - * - * 4 words: [2-bit len] [6-bit tag] [8-bit type] [16-bit array_size] - * [8-bit size_offset] [24-bit tag>>6] - * [32-bit data_offset] - * [32-bit data_size] - * - * 8 words: [2-bit len] [6-bit tag] [8-bit type] [16-bit reserved] - * [8-bit size_offset] [24-bit tag>>6] - * [32-bit data_offset] - * [32-bit data_size] - * [32-bit array_size] - * [32-bit reserved] - * [32-bit reserved] - * [32-bit reserved] - */ - -#define PB_FIELDINFO_1(tag, type, data_offset, data_size, size_offset, array_size) \ - (0 | (((tag) << 2) & 0xFF) | ((type) << 8) | (((uint32_t)(data_offset) & 0xFF) << 16) | \ - (((uint32_t)(size_offset) & 0x0F) << 24) | (((uint32_t)(data_size) & 0x0F) << 28)), - -#define PB_FIELDINFO_2(tag, type, data_offset, data_size, size_offset, array_size) \ - (1 | (((tag) << 2) & 0xFF) | ((type) << 8) | (((uint32_t)(array_size) & 0xFFF) << 16) | (((uint32_t)(size_offset) & 0x0F) << 28)), \ - (((uint32_t)(data_offset) & 0xFFFF) | (((uint32_t)(data_size) & 0xFFF) << 16) | (((uint32_t)(tag) & 0x3c0) << 22)), - -#define PB_FIELDINFO_4(tag, type, data_offset, data_size, size_offset, array_size) \ - (2 | (((tag) << 2) & 0xFF) | ((type) << 8) | (((uint32_t)(array_size) & 0xFFFF) << 16)), \ - ((uint32_t)(int_least8_t)(size_offset) | (((uint32_t)(tag) << 2) & 0xFFFFFF00)), \ - (data_offset), (data_size), - -#define PB_FIELDINFO_8(tag, type, data_offset, data_size, size_offset, array_size) \ - (3 | (((tag) << 2) & 0xFF) | ((type) << 8)), \ - ((uint32_t)(int_least8_t)(size_offset) | (((uint32_t)(tag) << 2) & 0xFFFFFF00)), \ - (data_offset), (data_size), (array_size), 0, 0, 0, - -/* These assertions verify that the field information fits in the allocated space. - * The generator tries to automatically determine the correct width that can fit all - * data associated with a message. These asserts will fail only if there has been a - * problem in the automatic logic - this may be worth reporting as a bug. As a workaround, - * you can increase the descriptor width by defining PB_FIELDINFO_WIDTH or by setting - * descriptorsize option in .options file. - */ -#define PB_FITS(value, bits) ((uint32_t)(value) < ((uint32_t)1<2GB messages with nanopb anyway. - */ -#define PB_FIELDINFO_ASSERT_4(tag, type, data_offset, data_size, size_offset, array_size) \ - PB_STATIC_ASSERT(PB_FITS(tag,30) && PB_FITS(data_offset,31) && PB_FITS(size_offset,8) && PB_FITS(data_size,31) && PB_FITS(array_size,16), FIELDINFO_DOES_NOT_FIT_width4_field ## tag) - -#define PB_FIELDINFO_ASSERT_8(tag, type, data_offset, data_size, size_offset, array_size) \ - PB_STATIC_ASSERT(PB_FITS(tag,30) && PB_FITS(data_offset,31) && PB_FITS(size_offset,8) && PB_FITS(data_size,31) && PB_FITS(array_size,31), FIELDINFO_DOES_NOT_FIT_width8_field ## tag) -#endif - - -/* Automatic picking of FIELDINFO width: - * Uses width 1 when possible, otherwise resorts to width 2. - * This is used when PB_BIND() is called with "AUTO" as the argument. - * The generator will give explicit size argument when it knows that a message - * structure grows beyond 1-word format limits. - */ -#define PB_FIELDINFO_WIDTH_AUTO(atype, htype, ltype) PB_FI_WIDTH ## atype(htype, ltype) -#define PB_FI_WIDTH_PB_ATYPE_STATIC(htype, ltype) PB_FI_WIDTH ## htype(ltype) -#define PB_FI_WIDTH_PB_ATYPE_POINTER(htype, ltype) PB_FI_WIDTH ## htype(ltype) -#define PB_FI_WIDTH_PB_ATYPE_CALLBACK(htype, ltype) 2 -#define PB_FI_WIDTH_PB_HTYPE_REQUIRED(ltype) PB_FI_WIDTH ## ltype -#define PB_FI_WIDTH_PB_HTYPE_SINGULAR(ltype) PB_FI_WIDTH ## ltype -#define PB_FI_WIDTH_PB_HTYPE_OPTIONAL(ltype) PB_FI_WIDTH ## ltype -#define PB_FI_WIDTH_PB_HTYPE_ONEOF(ltype) PB_FI_WIDTH ## ltype -#define PB_FI_WIDTH_PB_HTYPE_REPEATED(ltype) 2 -#define PB_FI_WIDTH_PB_HTYPE_FIXARRAY(ltype) 2 -#define PB_FI_WIDTH_PB_LTYPE_BOOL 1 -#define PB_FI_WIDTH_PB_LTYPE_BYTES 2 -#define PB_FI_WIDTH_PB_LTYPE_DOUBLE 1 -#define PB_FI_WIDTH_PB_LTYPE_ENUM 1 -#define PB_FI_WIDTH_PB_LTYPE_UENUM 1 -#define PB_FI_WIDTH_PB_LTYPE_FIXED32 1 -#define PB_FI_WIDTH_PB_LTYPE_FIXED64 1 -#define PB_FI_WIDTH_PB_LTYPE_FLOAT 1 -#define PB_FI_WIDTH_PB_LTYPE_INT32 1 -#define PB_FI_WIDTH_PB_LTYPE_INT64 1 -#define PB_FI_WIDTH_PB_LTYPE_MESSAGE 2 -#define PB_FI_WIDTH_PB_LTYPE_MSG_W_CB 2 -#define PB_FI_WIDTH_PB_LTYPE_SFIXED32 1 -#define PB_FI_WIDTH_PB_LTYPE_SFIXED64 1 -#define PB_FI_WIDTH_PB_LTYPE_SINT32 1 -#define PB_FI_WIDTH_PB_LTYPE_SINT64 1 -#define PB_FI_WIDTH_PB_LTYPE_STRING 2 -#define PB_FI_WIDTH_PB_LTYPE_UINT32 1 -#define PB_FI_WIDTH_PB_LTYPE_UINT64 1 -#define PB_FI_WIDTH_PB_LTYPE_EXTENSION 1 -#define PB_FI_WIDTH_PB_LTYPE_FIXED_LENGTH_BYTES 2 - -/* The mapping from protobuf types to LTYPEs is done using these macros. */ -#define PB_LTYPE_MAP_BOOL PB_LTYPE_BOOL -#define PB_LTYPE_MAP_BYTES PB_LTYPE_BYTES -#define PB_LTYPE_MAP_DOUBLE PB_LTYPE_FIXED64 -#define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINT -#define PB_LTYPE_MAP_UENUM PB_LTYPE_UVARINT -#define PB_LTYPE_MAP_FIXED32 PB_LTYPE_FIXED32 -#define PB_LTYPE_MAP_FIXED64 PB_LTYPE_FIXED64 -#define PB_LTYPE_MAP_FLOAT PB_LTYPE_FIXED32 -#define PB_LTYPE_MAP_INT32 PB_LTYPE_VARINT -#define PB_LTYPE_MAP_INT64 PB_LTYPE_VARINT -#define PB_LTYPE_MAP_MESSAGE PB_LTYPE_SUBMESSAGE -#define PB_LTYPE_MAP_MSG_W_CB PB_LTYPE_SUBMSG_W_CB -#define PB_LTYPE_MAP_SFIXED32 PB_LTYPE_FIXED32 -#define PB_LTYPE_MAP_SFIXED64 PB_LTYPE_FIXED64 -#define PB_LTYPE_MAP_SINT32 PB_LTYPE_SVARINT -#define PB_LTYPE_MAP_SINT64 PB_LTYPE_SVARINT -#define PB_LTYPE_MAP_STRING PB_LTYPE_STRING -#define PB_LTYPE_MAP_UINT32 PB_LTYPE_UVARINT -#define PB_LTYPE_MAP_UINT64 PB_LTYPE_UVARINT -#define PB_LTYPE_MAP_EXTENSION PB_LTYPE_EXTENSION -#define PB_LTYPE_MAP_FIXED_LENGTH_BYTES PB_LTYPE_FIXED_LENGTH_BYTES - -/* These macros are used for giving out error messages. - * They are mostly a debugging aid; the main error information - * is the true/false return value from functions. - * Some code space can be saved by disabling the error - * messages if not used. - * - * PB_SET_ERROR() sets the error message if none has been set yet. - * msg must be a constant string literal. - * PB_GET_ERROR() always returns a pointer to a string. - * PB_RETURN_ERROR() sets the error and returns false from current - * function. - */ -#ifdef PB_NO_ERRMSG -#define PB_SET_ERROR(stream, msg) PB_UNUSED(stream) -#define PB_GET_ERROR(stream) "(errmsg disabled)" -#else -#define PB_SET_ERROR(stream, msg) (stream->errmsg = (stream)->errmsg ? (stream)->errmsg : (msg)) -#define PB_GET_ERROR(stream) ((stream)->errmsg ? (stream)->errmsg : "(none)") -#endif - -#define PB_RETURN_ERROR(stream, msg) return PB_SET_ERROR(stream, msg), false - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#ifndef ZX_NO_CPP -#ifdef __cplusplus -#if __cplusplus >= 201103L -#define PB_CONSTEXPR constexpr -#else // __cplusplus >= 201103L -#define PB_CONSTEXPR -#endif // __cplusplus >= 201103L - -#if __cplusplus >= 201703L -#define PB_INLINE_CONSTEXPR inline constexpr -#else // __cplusplus >= 201703L -#define PB_INLINE_CONSTEXPR PB_CONSTEXPR -#endif // __cplusplus >= 201703L - -namespace nanopb { -// Each type will be partially specialized by the generator. - template - struct MessageDescriptor; -} // namespace nanopb -#endif /* __cplusplus */ - -#endif -#endif diff --git a/deps/nanopb_tiny/pb_common.c b/deps/nanopb_tiny/pb_common.c deleted file mode 100644 index c71a118d..00000000 --- a/deps/nanopb_tiny/pb_common.c +++ /dev/null @@ -1,364 +0,0 @@ -/* pb_common.c: Common support functions for pb_encode.c and pb_decode.c. - * - * 2014 Petteri Aimonen - */ - -#include -#include "pb_common.h" - -static bool load_descriptor_values(pb_field_iter_t *iter) { - uint32_t word0; - uint32_t data_offset; - int_least8_t size_offset; - - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *)PIC(iter->descriptor); - if (iter->index >= descriptor->field_count) - return false; - - word0 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index); - iter->type = (pb_type_t) ((word0 >> 8) & 0xFF); - - switch (word0 & 3) { - case 0: { - /* 1-word format */ - iter->array_size = 1; - iter->tag = (pb_size_t) ((word0 >> 2) & 0x3F); - size_offset = (int_least8_t) ((word0 >> 24) & 0x0F); - data_offset = (word0 >> 16) & 0xFF; - iter->data_size = (pb_size_t) ((word0 >> 28) & 0x0F); - break; - } - - case 1: { - /* 2-word format */ - uint32_t word1 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 1); - - iter->array_size = (pb_size_t) ((word0 >> 16) & 0x0FFF); - iter->tag = (pb_size_t) (((word0 >> 2) & 0x3F) | ((word1 >> 28) << 6)); - size_offset = (int_least8_t) ((word0 >> 28) & 0x0F); - data_offset = word1 & 0xFFFF; - iter->data_size = (pb_size_t) ((word1 >> 16) & 0x0FFF); - break; - } - - case 2: { - /* 4-word format */ - uint32_t word1 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 1); - uint32_t word2 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 2); - uint32_t word3 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 3); - - iter->array_size = (pb_size_t) (word0 >> 16); - iter->tag = (pb_size_t) (((word0 >> 2) & 0x3F) | ((word1 >> 8) << 6)); - size_offset = (int_least8_t) (word1 & 0xFF); - data_offset = word2; - iter->data_size = (pb_size_t) word3; - break; - } - - default: { - /* 8-word format */ - uint32_t word1 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 1); - uint32_t word2 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 2); - uint32_t word3 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 3); - uint32_t word4 = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index + 4); - - iter->array_size = (pb_size_t) word4; - iter->tag = (pb_size_t) (((word0 >> 2) & 0x3F) | ((word1 >> 8) << 6)); - size_offset = (int_least8_t) (word1 & 0xFF); - data_offset = word2; - iter->data_size = (pb_size_t) word3; - break; - } - } - - if (!iter->message) { - /* Avoid doing arithmetic on null pointers, it is undefined */ - iter->pField = NULL; - iter->pSize = NULL; - } else { - iter->pField = (char *) iter->message + data_offset; - - if (size_offset) { - iter->pSize = (char *) iter->pField - size_offset; - } else if (PB_HTYPE(iter->type) == PB_HTYPE_REPEATED && - (PB_ATYPE(iter->type) == PB_ATYPE_STATIC || - PB_ATYPE(iter->type) == PB_ATYPE_POINTER)) { - /* Fixed count array */ - iter->pSize = &iter->array_size; - } else { - iter->pSize = NULL; - } - - if (PB_ATYPE(iter->type) == PB_ATYPE_POINTER && iter->pField != NULL) { - iter->pData = *(void **) iter->pField; - } else { - iter->pData = iter->pField; - } - } - - if (PB_LTYPE_IS_SUBMSG(iter->type)) - { - iter->submsg_desc = PB_PROGMEM_READTYPE(const pb_msgdesc_t *, descriptor->submsg_info, iter->submessage_index); - } - else - { - iter->submsg_desc = NULL; - } - - return true; -} - -static void advance_iterator(pb_field_iter_t *iter) { - iter->index++; - - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *)PIC(iter->descriptor); - - if (iter->index >= descriptor->field_count) { - /* Restart */ - iter->index = 0; - iter->field_info_index = 0; - iter->submessage_index = 0; - iter->required_field_index = 0; - } else { - /* Increment indexes based on previous field type. - * All field info formats have the following fields: - * - lowest 2 bits tell the amount of words in the descriptor (2^n words) - * - bits 2..7 give the lowest bits of tag number. - * - bits 8..15 give the field type. - */ - uint32_t prev_descriptor = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index); - pb_type_t prev_type = (prev_descriptor >> 8) & 0xFF; - pb_size_t descriptor_len = (pb_size_t) (1 << (prev_descriptor & 3)); - - /* Add to fields. - * The cast to pb_size_t is needed to avoid -Wconversion warning. - * Because the data is is constants from generator, there is no danger of overflow. - */ - iter->field_info_index = (pb_size_t) (iter->field_info_index + descriptor_len); - iter->required_field_index = (pb_size_t) (iter->required_field_index + - (PB_HTYPE(prev_type) == PB_HTYPE_REQUIRED)); - iter->submessage_index = (pb_size_t) (iter->submessage_index + PB_LTYPE_IS_SUBMSG(prev_type)); - } -} - -bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_msgdesc_t *desc, void *message) { - memset(iter, 0, sizeof(*iter)); - - iter->descriptor = desc; - iter->message = message; - - return load_descriptor_values(iter); -} - -bool pb_field_iter_begin_extension(pb_field_iter_t *iter, pb_extension_t *extension) { - const pb_msgdesc_t *msg = (const pb_msgdesc_t *) extension->type->arg; - bool status; - - uint32_t word0 = PB_PROGMEM_READU32(msg->field_info, 0); - if (PB_ATYPE(word0 >> 8) == PB_ATYPE_POINTER) { - /* For pointer extensions, the pointer is stored directly - * in the extension structure. This avoids having an extra - * indirection. */ - status = pb_field_iter_begin(iter, msg, &extension->dest); - } else { - status = pb_field_iter_begin(iter, msg, extension->dest); - } - - iter->pSize = &extension->found; - return status; -} - -bool pb_field_iter_next(pb_field_iter_t *iter) { - advance_iterator(iter); - (void) load_descriptor_values(iter); - return iter->index != 0; -} - -bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag) { - ZEMU_TRACE() - - if (iter->tag == tag) { - ZEMU_TRACE() - return true; /* Nothing to do, correct field already. */ - } - - { - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter->descriptor); - if (tag > descriptor->largest_tag) { - ZEMU_TRACE() - return false; - } - } - - ZEMU_TRACE() - pb_size_t start = iter->index; - ZEMU_TRACE() - - uint32_t fieldinfo; - - if (tag < iter->tag) { - ZEMU_TRACE() - /* Fields are in tag number order, so we know that tag is between - * 0 and our start position. Setting index to end forces - * advance_iterator() call below to restart from beginning. */ - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter->descriptor); - iter->index = descriptor->field_count; - } - - do { - ZEMU_TRACE() - /* Advance iterator but don't load values yet */ - advance_iterator(iter); - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter->descriptor); - - ZEMU_TRACE() - /* Do fast check for tag number match */ - fieldinfo = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index); - - if (((fieldinfo >> 2) & 0x3F) == (tag & 0x3F)) { - /* Good candidate, check further */ - (void) load_descriptor_values(iter); - - if (iter->tag == tag && - PB_LTYPE(iter->type) != PB_LTYPE_EXTENSION) { - /* Found it */ - return true; - } - } - } while (iter->index != start); - - /* Searched all the way back to start, and found nothing. */ - (void) load_descriptor_values(iter); - return false; -} - -bool pb_field_iter_find_extension(pb_field_iter_t *iter) { - if (PB_LTYPE(iter->type) == PB_LTYPE_EXTENSION) { - return true; - } else { - pb_size_t start = iter->index; - uint32_t fieldinfo; - - do { - /* Advance iterator but don't load values yet */ - advance_iterator(iter); - - /* Do fast check for field type */ - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter->descriptor); - fieldinfo = PB_PROGMEM_READU32(descriptor->field_info, iter->field_info_index); - - if (PB_LTYPE((fieldinfo >> 8) & 0xFF) == PB_LTYPE_EXTENSION) { - return load_descriptor_values(iter); - } - } while (iter->index != start); - - /* Searched all the way back to start, and found nothing. */ - (void) load_descriptor_values(iter); - return false; - } -} - -static void *pb_const_cast(const void *p) { - /* Note: this casts away const, in order to use the common field iterator - * logic for both encoding and decoding. The cast is done using union - * to avoid spurious compiler warnings. */ - union { - void *p1; - const void *p2; - } t; - t.p2 = p; - return t.p1; -} - -bool pb_field_iter_begin_const(pb_field_iter_t *iter, const pb_msgdesc_t *desc, const void *message) { - return pb_field_iter_begin(iter, desc, pb_const_cast(message)); -} - -bool pb_field_iter_begin_extension_const(pb_field_iter_t *iter, const pb_extension_t *extension) { - return pb_field_iter_begin_extension(iter, (pb_extension_t *) pb_const_cast(extension)); -} - -bool pb_default_field_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_t *field) { - if (field->data_size == sizeof(pb_callback_t)) { - pb_callback_t *pCallback = (pb_callback_t *) field->pData; - - if (pCallback != NULL) { - if (istream != NULL && pCallback->funcs.decode != NULL) { - return pCallback->funcs.decode(istream, field, &pCallback->arg); - } - - if (ostream != NULL && pCallback->funcs.encode != NULL) { - return pCallback->funcs.encode(ostream, field, &pCallback->arg); - } - } - } - - return true; /* Success, but didn't do anything */ - -} - -#ifdef PB_VALIDATE_UTF8 - -/* This function checks whether a string is valid UTF-8 text. - * - * Algorithm is adapted from https://www.cl.cam.ac.uk/~mgk25/ucs/utf8_check.c - * Original copyright: Markus Kuhn 2005-03-30 - * Licensed under "Short code license", which allows use under MIT license or - * any compatible with it. - */ - -bool pb_validate_utf8(const char *str) -{ - const pb_byte_t *s = (const pb_byte_t*)str; - while (*s) - { - if (*s < 0x80) - { - /* 0xxxxxxx */ - s++; - } - else if ((s[0] & 0xe0) == 0xc0) - { - /* 110XXXXx 10xxxxxx */ - if ((s[1] & 0xc0) != 0x80 || - (s[0] & 0xfe) == 0xc0) /* overlong? */ - return false; - else - s += 2; - } - else if ((s[0] & 0xf0) == 0xe0) - { - /* 1110XXXX 10Xxxxxx 10xxxxxx */ - if ((s[1] & 0xc0) != 0x80 || - (s[2] & 0xc0) != 0x80 || - (s[0] == 0xe0 && (s[1] & 0xe0) == 0x80) || /* overlong? */ - (s[0] == 0xed && (s[1] & 0xe0) == 0xa0) || /* surrogate? */ - (s[0] == 0xef && s[1] == 0xbf && - (s[2] & 0xfe) == 0xbe)) /* U+FFFE or U+FFFF? */ - return false; - else - s += 3; - } - else if ((s[0] & 0xf8) == 0xf0) - { - /* 11110XXX 10XXxxxx 10xxxxxx 10xxxxxx */ - if ((s[1] & 0xc0) != 0x80 || - (s[2] & 0xc0) != 0x80 || - (s[3] & 0xc0) != 0x80 || - (s[0] == 0xf0 && (s[1] & 0xf0) == 0x80) || /* overlong? */ - (s[0] == 0xf4 && s[1] > 0x8f) || s[0] > 0xf4) /* > U+10FFFF? */ - return false; - else - s += 4; - } - else - { - return false; - } - } - - return true; -} - -#endif - diff --git a/deps/nanopb_tiny/pb_common.h b/deps/nanopb_tiny/pb_common.h deleted file mode 100644 index 4cf83b56..00000000 --- a/deps/nanopb_tiny/pb_common.h +++ /dev/null @@ -1,50 +0,0 @@ -/* pb_common.h: Common support functions for pb_encode.c and pb_decode.c. - * These functions are rarely needed by applications directly. - */ - -#ifndef PB_COMMON_H_INCLUDED -#define PB_COMMON_H_INCLUDED - -#include "pb.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initialize the field iterator structure to beginning. - * Returns false if the message type is empty. */ -bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_msgdesc_t *desc, void *message); - -/* Get a field iterator for extension field. */ -bool pb_field_iter_begin_extension(pb_field_iter_t *iter, pb_extension_t *extension); - -/* Same as pb_field_iter_begin(), but for const message pointer. - * Note that the pointers in pb_field_iter_t will be non-const but shouldn't - * be written to when using these functions. */ -bool pb_field_iter_begin_const(pb_field_iter_t *iter, const pb_msgdesc_t *desc, const void *message); - -bool pb_field_iter_begin_extension_const(pb_field_iter_t *iter, const pb_extension_t *extension); - -/* Advance the iterator to the next field. - * Returns false when the iterator wraps back to the first field. */ -bool pb_field_iter_next(pb_field_iter_t *iter); - -/* Advance the iterator until it points at a field with the given tag. - * Returns false if no such field exists. */ -bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag); - -/* Find a field with type PB_LTYPE_EXTENSION, or return false if not found. - * There can be only one extension range field per message. */ -bool pb_field_iter_find_extension(pb_field_iter_t *iter); - -#ifdef PB_VALIDATE_UTF8 -/* Validate UTF-8 text string */ -bool pb_validate_utf8(const char *s); -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif - diff --git a/deps/nanopb_tiny/pb_decode.c b/deps/nanopb_tiny/pb_decode.c deleted file mode 100644 index 9996c57d..00000000 --- a/deps/nanopb_tiny/pb_decode.c +++ /dev/null @@ -1,1662 +0,0 @@ -/* pb_decode.c -- decode a protobuf using minimal resources - * - * 2011 Petteri Aimonen - */ - -/* Use the GCC warn_unused_result attribute to check that all return values - * are propagated correctly. On other compilers and gcc before 3.4.0 just - * ignore the annotation. - */ -#if !defined(__GNUC__) || (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) -#define checkreturn -#else -#define checkreturn __attribute__((warn_unused_result)) -#endif - -#include -#include "pb.h" -#include "pb_decode.h" -#include "pb_common.h" - -/************************************** - * Declarations internal to this file * - **************************************/ - -static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); - -static bool checkreturn pb_decode_varint32_eof(pb_istream_t *stream, uint32_t *dest, bool *eof); - -static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size); - -static bool checkreturn decode_basic_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); - -static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); - -static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); - -static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); - -static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field); - -static bool checkreturn -default_extension_decoder(pb_istream_t *stream, pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type); - -static bool checkreturn -decode_extension(pb_istream_t *stream, uint32_t tag, pb_wire_type_t wire_type, pb_extension_t *extension); - -static bool pb_field_set_to_default(pb_field_iter_t *field); - -static bool pb_message_set_to_defaults(pb_field_iter_t *iter); - -static bool checkreturn pb_dec_bool(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_iter_t *field); - -static bool checkreturn pb_skip_varint(pb_istream_t *stream); - -static bool checkreturn pb_skip_string(pb_istream_t *stream); - -#ifdef PB_ENABLE_MALLOC -static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size); -static void initialize_pointer_field(void *pItem, pb_field_iter_t *field); -static bool checkreturn pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *field); -static void pb_release_single_field(pb_field_iter_t *field); -#endif - -#ifdef PB_WITHOUT_64BIT -#define pb_int64_t int32_t -#define pb_uint64_t uint32_t -#else -#define pb_int64_t int64_t -#define pb_uint64_t uint64_t -#endif - -#define PB_WT_PACKED ((pb_wire_type_t)0xFF) - -typedef struct { - uint32_t bitfield[(PB_MAX_REQUIRED_FIELDS + 31) / 32]; -} pb_fields_seen_t; - -/******************************* - * pb_istream_t implementation * - *******************************/ - -static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) { - size_t i; - const pb_byte_t *source = (const pb_byte_t *) stream->state; - stream->state = (pb_byte_t *) stream->state + count; - - if (buf != NULL) { - for (i = 0; i < count; i++) - buf[i] = source[i]; - } - - return true; -} - -bool checkreturn pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) { - if (count == 0) - return true; - -#ifndef PB_BUFFER_ONLY - if (buf == NULL && stream->callback != buf_read) { - /* Skip input bytes */ - pb_byte_t tmp[16]; - while (count > 16) { - if (!pb_read(stream, tmp, 16)) - return false; - - count -= 16; - } - - return pb_read(stream, tmp, count); - } -#endif - - if (stream->bytes_left < count) - PB_RETURN_ERROR(stream, "end-of-stream"); - -#ifndef PB_BUFFER_ONLY - if (!stream->callback(stream, buf, count)) - PB_RETURN_ERROR(stream, "io error"); -#else - if (!buf_read(stream, buf, count)) - return false; -#endif - - stream->bytes_left -= count; - return true; -} - -/* Read a single byte from input stream. buf may not be NULL. - * This is an optimization for the varint decoding. */ -static bool checkreturn pb_readbyte(pb_istream_t *stream, pb_byte_t *buf) { - if (stream->bytes_left == 0) - PB_RETURN_ERROR(stream, "end-of-stream"); - -#ifndef PB_BUFFER_ONLY - if (!stream->callback(stream, buf, 1)) - PB_RETURN_ERROR(stream, "io error"); -#else - *buf = *(const pb_byte_t*)stream->state; - stream->state = (pb_byte_t*)stream->state + 1; -#endif - - stream->bytes_left--; - - return true; -} - -pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen) { - pb_istream_t stream; - /* Cast away the const from buf without a compiler error. We are - * careful to use it only in a const manner in the callbacks. - */ - union { - void *state; - const void *c_state; - } state; -#ifdef PB_BUFFER_ONLY - stream.callback = NULL; -#else - stream.callback = &buf_read; -#endif - state.c_state = buf; - stream.state = state.state; - stream.bytes_left = msglen; -#ifndef PB_NO_ERRMSG - stream.errmsg = NULL; -#endif - return stream; -} - -/******************** - * Helper functions * - ********************/ - -static bool checkreturn pb_decode_varint32_eof(pb_istream_t *stream, uint32_t *dest, bool *eof) { - pb_byte_t byte; - uint32_t result; - - if (!pb_readbyte(stream, &byte)) { - if (stream->bytes_left == 0) { - if (eof) { - *eof = true; - } - } - - return false; - } - - if ((byte & 0x80) == 0) { - /* Quick case, 1 byte value */ - result = byte; - } else { - /* Multibyte case */ - uint_fast8_t bitpos = 7; - result = byte & 0x7F; - - do { - if (!pb_readbyte(stream, &byte)) - return false; - - if (bitpos >= 32) { - /* Note: The varint could have trailing 0x80 bytes, or 0xFF for negative. */ - pb_byte_t sign_extension = (bitpos < 63) ? 0xFF : 0x01; - bool valid_extension = ((byte & 0x7F) == 0x00 || - ((result >> 31) != 0 && byte == sign_extension)); - - if (bitpos >= 64 || !valid_extension) { - PB_RETURN_ERROR(stream, "varint overflow"); - } - } else { - result |= (uint32_t) (byte & 0x7F) << bitpos; - } - bitpos = (uint_fast8_t) (bitpos + 7); - } while (byte & 0x80); - - if (bitpos == 35 && (byte & 0x70) != 0) { - /* The last byte was at bitpos=28, so only bottom 4 bits fit. */ - PB_RETURN_ERROR(stream, "varint overflow"); - } - } - - *dest = result; - return true; -} - -bool checkreturn pb_decode_varint32(pb_istream_t *stream, uint32_t *dest) { - return pb_decode_varint32_eof(stream, dest, NULL); -} - -#ifndef PB_WITHOUT_64BIT - -bool checkreturn pb_decode_varint(pb_istream_t *stream, uint64_t *dest) { - pb_byte_t byte; - uint_fast8_t bitpos = 0; - uint64_t result = 0; - - do { - if (bitpos >= 64) - PB_RETURN_ERROR(stream, "varint overflow"); - - if (!pb_readbyte(stream, &byte)) - return false; - - result |= (uint64_t) (byte & 0x7F) << bitpos; - bitpos = (uint_fast8_t) (bitpos + 7); - } while (byte & 0x80); - - *dest = result; - return true; -} - -#endif - -bool checkreturn pb_skip_varint(pb_istream_t *stream) { - pb_byte_t byte; - do { - if (!pb_read(stream, &byte, 1)) - return false; - } while (byte & 0x80); - return true; -} - -bool checkreturn pb_skip_string(pb_istream_t *stream) { - uint32_t length; - if (!pb_decode_varint32(stream, &length)) - return false; - - if ((size_t) length != length) { - PB_RETURN_ERROR(stream, "size too large"); - } - - return pb_read(stream, NULL, (size_t) length); -} - -bool checkreturn pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof) { - uint32_t temp; - *eof = false; - *wire_type = (pb_wire_type_t) 0; - *tag = 0; - - if (!pb_decode_varint32_eof(stream, &temp, eof)) { - return false; - } - - *tag = temp >> 3; - *wire_type = (pb_wire_type_t) (temp & 7); - return true; -} - -bool checkreturn pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type) { - switch (wire_type) { - case PB_WT_VARINT: - return pb_skip_varint(stream); - case PB_WT_64BIT: - return pb_read(stream, NULL, 8); - case PB_WT_STRING: - return pb_skip_string(stream); - case PB_WT_32BIT: - return pb_read(stream, NULL, 4); - default: - PB_RETURN_ERROR(stream, "invalid wire_type"); - } -} - -/* Read a raw value to buffer, for the purpose of passing it to callback as - * a substream. Size is maximum size on call, and actual size on return. - */ -static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size) { - size_t max_size = *size; - switch (wire_type) { - case PB_WT_VARINT: - *size = 0; - do { - (*size)++; - if (*size > max_size) - PB_RETURN_ERROR(stream, "varint overflow"); - - if (!pb_read(stream, buf, 1)) - return false; - } while (*buf++ & 0x80); - return true; - - case PB_WT_64BIT: - *size = 8; - return pb_read(stream, buf, 8); - - case PB_WT_32BIT: - *size = 4; - return pb_read(stream, buf, 4); - - case PB_WT_STRING: - /* Calling read_raw_value with a PB_WT_STRING is an error. - * Explicitly handle this case and fallthrough to default to avoid - * compiler warnings. - */ - - default: - PB_RETURN_ERROR(stream, "invalid wire_type"); - } -} - -/* Decode string length from stream and return a substream with limited length. - * Remember to close the substream using pb_close_string_substream(). - */ -bool checkreturn pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream) { - uint32_t size; - if (!pb_decode_varint32(stream, &size)) - return false; - - *substream = *stream; - if (substream->bytes_left < size) - PB_RETURN_ERROR(stream, "parent stream too short"); - - substream->bytes_left = (size_t) size; - stream->bytes_left -= (size_t) size; - return true; -} - -bool checkreturn pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream) { - if (substream->bytes_left) { - if (!pb_read(substream, NULL, substream->bytes_left)) - return false; - } - - stream->state = substream->state; - -#ifndef PB_NO_ERRMSG - stream->errmsg = substream->errmsg; -#endif - return true; -} - -/************************* - * Decode a single field * - *************************/ - -static bool checkreturn decode_basic_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { - ZEMU_TRACE() - - switch (PB_LTYPE(field->type)) { - case PB_LTYPE_BOOL: - if (wire_type != PB_WT_VARINT && wire_type != PB_WT_PACKED) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_bool(stream, field); - - case PB_LTYPE_VARINT: - case PB_LTYPE_UVARINT: - case PB_LTYPE_SVARINT: - if (wire_type != PB_WT_VARINT && wire_type != PB_WT_PACKED) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_varint(stream, field); - - case PB_LTYPE_FIXED32: - if (wire_type != PB_WT_32BIT && wire_type != PB_WT_PACKED) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_decode_fixed32(stream, field->pData); - - case PB_LTYPE_FIXED64: - if (wire_type != PB_WT_64BIT && wire_type != PB_WT_PACKED) - PB_RETURN_ERROR(stream, "wrong wire type"); - -#ifdef PB_CONVERT_DOUBLE_FLOAT - if (field->data_size == sizeof(float)) - { - return pb_decode_double_as_float(stream, (float*)field->pData); - } -#endif - -#ifdef PB_WITHOUT_64BIT - PB_RETURN_ERROR(stream, "invalid data_size"); -#else - return pb_decode_fixed64(stream, field->pData); -#endif - - case PB_LTYPE_BYTES: - if (wire_type != PB_WT_STRING) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_bytes(stream, field); - - case PB_LTYPE_STRING: - if (wire_type != PB_WT_STRING) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_string(stream, field); - - case PB_LTYPE_SUBMESSAGE: - case PB_LTYPE_SUBMSG_W_CB: - if (wire_type != PB_WT_STRING) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_submessage(stream, field); - - case PB_LTYPE_FIXED_LENGTH_BYTES: - if (wire_type != PB_WT_STRING) - PB_RETURN_ERROR(stream, "wrong wire type"); - - return pb_dec_fixed_length_bytes(stream, field); - - default: - PB_RETURN_ERROR(stream, "invalid field type"); - } -} - -static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { - ZEMU_TRACE() - - switch (PB_HTYPE(field->type)) { - case PB_HTYPE_REQUIRED: - return decode_basic_field(stream, wire_type, field); - - case PB_HTYPE_OPTIONAL: - if (field->pSize != NULL) - *(bool *) field->pSize = true; - return decode_basic_field(stream, wire_type, field); - - case PB_HTYPE_REPEATED: - if (wire_type == PB_WT_STRING - && PB_LTYPE(field->type) <= PB_LTYPE_LAST_PACKABLE) { - ZEMU_TRACE() - - /* Packed array */ - bool status = true; - pb_istream_t substream; - pb_size_t *size = (pb_size_t *) field->pSize; - field->pData = (char *) field->pField + field->data_size * (*size); - - if (!pb_make_string_substream(stream, &substream)) - return false; - - while (substream.bytes_left > 0 && *size < field->array_size) { - if (!decode_basic_field(&substream, PB_WT_PACKED, field)) { - status = false; - break; - } - (*size)++; - field->pData = (char *) field->pData + field->data_size; - } - - if (substream.bytes_left != 0) - PB_RETURN_ERROR(stream, "array overflow"); - if (!pb_close_string_substream(stream, &substream)) - return false; - - return status; - } else { - /* Repeated field */ - pb_size_t *size = (pb_size_t *) field->pSize; - field->pData = (char *) field->pField + field->data_size * (*size); - - if ((*size)++ >= field->array_size) - PB_RETURN_ERROR(stream, "array overflow"); - - return decode_basic_field(stream, wire_type, field); - } - - case PB_HTYPE_ONEOF: - if (PB_LTYPE_IS_SUBMSG(field->type) && - *(pb_size_t *) field->pSize != field->tag) { - /* We memset to zero so that any callbacks are set to NULL. - * This is because the callbacks might otherwise have values - * from some other union field. - * If callbacks are needed inside oneof field, use .proto - * option submsg_callback to have a separate callback function - * that can set the fields before submessage is decoded. - * pb_dec_submessage() will set any default values. */ - ZEMU_TRACE() - memset(field->pData, 0, (size_t) field->data_size); - - const pb_msgdesc_t *tmp = (const pb_msgdesc_t *) PIC(field->submsg_desc); - const bool validDefaultValue = tmp != NULL && tmp->default_value != NULL; - const bool validFieldCallback = tmp != NULL && tmp->field_callback != NULL; - const bool validSubmsgInfo = tmp != NULL && tmp->submsg_info != NULL; - - /* Set default values for the submessage fields. */ - if (validDefaultValue || validFieldCallback || validSubmsgInfo) { - pb_field_iter_t submsg_iter; - if (pb_field_iter_begin(&submsg_iter, field->submsg_desc, field->pData)) { - if (!pb_message_set_to_defaults(&submsg_iter)) - PB_RETURN_ERROR(stream, "failed to set defaults"); - } - } - } - *(pb_size_t *) field->pSize = field->tag; - - return decode_basic_field(stream, wire_type, field); - - default: - PB_RETURN_ERROR(stream, "invalid field type"); - } -} - -#ifdef PB_ENABLE_MALLOC -/* Allocate storage for the field and store the pointer at iter->pData. - * array_size is the number of entries to reserve in an array. - * Zero size is not allowed, use pb_free() for releasing. - */ -static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size) -{ - void *ptr = *(void**)pData; - - if (data_size == 0 || array_size == 0) - PB_RETURN_ERROR(stream, "invalid size"); - -#ifdef __AVR__ - /* Workaround for AVR libc bug 53284: http://savannah.nongnu.org/bugs/?53284 - * Realloc to size of 1 byte can cause corruption of the malloc structures. - */ - if (data_size == 1 && array_size == 1) - { - data_size = 2; - } -#endif - - /* Check for multiplication overflows. - * This code avoids the costly division if the sizes are small enough. - * Multiplication is safe as long as only half of bits are set - * in either multiplicand. - */ - { - const size_t check_limit = (size_t)1 << (sizeof(size_t) * 4); - if (data_size >= check_limit || array_size >= check_limit) - { - const size_t size_max = (size_t)-1; - if (size_max / array_size < data_size) - { - PB_RETURN_ERROR(stream, "size too large"); - } - } - } - - /* Allocate new or expand previous allocation */ - /* Note: on failure the old pointer will remain in the structure, - * the message must be freed by caller also on error return. */ - ptr = pb_realloc(ptr, array_size * data_size); - if (ptr == NULL) - PB_RETURN_ERROR(stream, "realloc failed"); - - *(void**)pData = ptr; - return true; -} - -/* Clear a newly allocated item in case it contains a pointer, or is a submessage. */ -static void initialize_pointer_field(void *pItem, pb_field_iter_t *field) -{ - if (PB_LTYPE(field->type) == PB_LTYPE_STRING || - PB_LTYPE(field->type) == PB_LTYPE_BYTES) - { - *(void**)pItem = NULL; - } - else if (PB_LTYPE_IS_SUBMSG(field->type)) - { - /* We memset to zero so that any callbacks are set to NULL. - * Default values will be set by pb_dec_submessage(). */ - memset(pItem, 0, field->data_size); - } -} -#endif - -static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { - ZEMU_TRACE() - -#ifndef PB_ENABLE_MALLOC - PB_UNUSED(wire_type); - PB_UNUSED(field); - PB_RETURN_ERROR(stream, "no malloc support"); -#else - switch (PB_HTYPE(field->type)) - { - case PB_HTYPE_REQUIRED: - case PB_HTYPE_OPTIONAL: - case PB_HTYPE_ONEOF: - if (PB_LTYPE_IS_SUBMSG(field->type) && *(void**)field->pField != NULL) - { - /* Duplicate field, have to release the old allocation first. */ - /* FIXME: Does this work correctly for oneofs? */ - pb_release_single_field(field); - } - - if (PB_HTYPE(field->type) == PB_HTYPE_ONEOF) - { - *(pb_size_t*)field->pSize = field->tag; - } - - if (PB_LTYPE(field->type) == PB_LTYPE_STRING || - PB_LTYPE(field->type) == PB_LTYPE_BYTES) - { - /* pb_dec_string and pb_dec_bytes handle allocation themselves */ - field->pData = field->pField; - return decode_basic_field(stream, wire_type, field); - } - else - { - if (!allocate_field(stream, field->pField, field->data_size, 1)) - return false; - - field->pData = *(void**)field->pField; - initialize_pointer_field(field->pData, field); - return decode_basic_field(stream, wire_type, field); - } - - case PB_HTYPE_REPEATED: - if (wire_type == PB_WT_STRING - && PB_LTYPE(field->type) <= PB_LTYPE_LAST_PACKABLE) - { - /* Packed array, multiple items come in at once. */ - bool status = true; - pb_size_t *size = (pb_size_t*)field->pSize; - size_t allocated_size = *size; - pb_istream_t substream; - - if (!pb_make_string_substream(stream, &substream)) - return false; - - while (substream.bytes_left) - { - if (*size == PB_SIZE_MAX) - { -#ifndef PB_NO_ERRMSG - stream->errmsg = "too many array entries"; -#endif - status = false; - break; - } - - if ((size_t)*size + 1 > allocated_size) - { - /* Allocate more storage. This tries to guess the - * number of remaining entries. Round the division - * upwards. */ - size_t remain = (substream.bytes_left - 1) / field->data_size + 1; - if (remain < PB_SIZE_MAX - allocated_size) - allocated_size += remain; - else - allocated_size += 1; - - if (!allocate_field(&substream, field->pField, field->data_size, allocated_size)) - { - status = false; - break; - } - } - - /* Decode the array entry */ - field->pData = *(char**)field->pField + field->data_size * (*size); - initialize_pointer_field(field->pData, field); - if (!decode_basic_field(&substream, PB_WT_PACKED, field)) - { - status = false; - break; - } - - (*size)++; - } - if (!pb_close_string_substream(stream, &substream)) - return false; - - return status; - } - else - { - /* Normal repeated field, i.e. only one item at a time. */ - pb_size_t *size = (pb_size_t*)field->pSize; - - if (*size == PB_SIZE_MAX) - PB_RETURN_ERROR(stream, "too many array entries"); - - if (!allocate_field(stream, field->pField, field->data_size, (size_t)(*size + 1))) - return false; - - field->pData = *(char**)field->pField + field->data_size * (*size); - (*size)++; - initialize_pointer_field(field->pData, field); - return decode_basic_field(stream, wire_type, field); - } - - default: - PB_RETURN_ERROR(stream, "invalid field type"); - } -#endif -} - -static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { - ZEMU_TRACE() - - if (!field->descriptor->field_callback) - return pb_skip_field(stream, wire_type); - - if (wire_type == PB_WT_STRING) { - pb_istream_t substream; - size_t prev_bytes_left; - - if (!pb_make_string_substream(stream, &substream)) - return false; - - do { - prev_bytes_left = substream.bytes_left; - if (!field->descriptor->field_callback(&substream, NULL, field)) - PB_RETURN_ERROR(stream, "callback failed"); - } while (substream.bytes_left > 0 && substream.bytes_left < prev_bytes_left); - - if (!pb_close_string_substream(stream, &substream)) - return false; - - return true; - } else { - /* Copy the single scalar value to stack. - * This is required so that we can limit the stream length, - * which in turn allows to use same callback for packed and - * not-packed fields. */ - pb_istream_t substream; - pb_byte_t buffer[10]; - size_t size = sizeof(buffer); - - if (!read_raw_value(stream, wire_type, buffer, &size)) - return false; - substream = pb_istream_from_buffer(buffer, size); - - return field->descriptor->field_callback(&substream, NULL, field); - } -} - -static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *field) { -#ifdef PB_ENABLE_MALLOC - /* When decoding an oneof field, check if there is old data that must be - * released first. */ - if (PB_HTYPE(field->type) == PB_HTYPE_ONEOF) - { - if (!pb_release_union_field(stream, field)) - return false; - } -#endif - - switch (PB_ATYPE(field->type)) { - case PB_ATYPE_STATIC: - return decode_static_field(stream, wire_type, field); - - case PB_ATYPE_POINTER: - return decode_pointer_field(stream, wire_type, field); - - case PB_ATYPE_CALLBACK: - return decode_callback_field(stream, wire_type, field); - - default: - PB_RETURN_ERROR(stream, "invalid field type"); - } -} - -/* Default handler for extension fields. Expects to have a pb_msgdesc_t - * pointer in the extension->type->arg field, pointing to a message with - * only one field in it. */ -static bool checkreturn default_extension_decoder(pb_istream_t *stream, - pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type) { - pb_field_iter_t iter; - - if (!pb_field_iter_begin_extension(&iter, extension)) - PB_RETURN_ERROR(stream, "invalid extension"); - - if (iter.tag != tag || !iter.message) - return true; - - extension->found = true; - return decode_field(stream, wire_type, &iter); -} - -/* Try to decode an unknown field as an extension field. Tries each extension - * decoder in turn, until one of them handles the field or loop ends. */ -static bool checkreturn decode_extension(pb_istream_t *stream, - uint32_t tag, pb_wire_type_t wire_type, pb_extension_t *extension) { - size_t pos = stream->bytes_left; - - while (extension != NULL && pos == stream->bytes_left) { - bool status; - if (extension->type->decode) - status = extension->type->decode(stream, extension, tag, wire_type); - else - status = default_extension_decoder(stream, extension, tag, wire_type); - - if (!status) - return false; - - extension = extension->next; - } - - return true; -} - -/* Initialize message fields to default values, recursively */ -static bool pb_field_set_to_default(pb_field_iter_t *field) { - pb_type_t type; - type = field->type; - - if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) { - pb_extension_t *ext = *(pb_extension_t *const *) field->pData; - while (ext != NULL) { - pb_field_iter_t ext_iter; - if (pb_field_iter_begin_extension(&ext_iter, ext)) { - ext->found = false; - if (!pb_message_set_to_defaults(&ext_iter)) - return false; - } - ext = ext->next; - } - } else if (PB_ATYPE(type) == PB_ATYPE_STATIC) { - bool init_data = true; - if (PB_HTYPE(type) == PB_HTYPE_OPTIONAL && field->pSize != NULL) { - /* Set has_field to false. Still initialize the optional field - * itself also. */ - *(bool *) field->pSize = false; - } else if (PB_HTYPE(type) == PB_HTYPE_REPEATED || - PB_HTYPE(type) == PB_HTYPE_ONEOF) { - /* REPEATED: Set array count to 0, no need to initialize contents. - ONEOF: Set which_field to 0. */ - *(pb_size_t *) field->pSize = 0; - init_data = false; - } - - if (init_data) { - const bool isSubmsg = PB_LTYPE_IS_SUBMSG(field->type); - const pb_msgdesc_t *tmp = (const pb_msgdesc_t *) PIC(field->submsg_desc); - const bool validDefaultValue = tmp != NULL && tmp->default_value != NULL; - const bool validFieldCallback = tmp != NULL && tmp->field_callback != NULL; - const bool validSubmsgInfo = tmp != NULL && tmp->submsg_info != NULL; - - if (isSubmsg && (validDefaultValue || validFieldCallback || validSubmsgInfo)) { - /* Initialize submessage to defaults. - * Only needed if it has default values - * or callback/submessage fields. */ - pb_field_iter_t submsg_iter; - if (pb_field_iter_begin(&submsg_iter, field->submsg_desc, field->pData)) { - if (!pb_message_set_to_defaults(&submsg_iter)) - return false; - } - } else { - /* Initialize to zeros */ - memset(field->pData, 0, (size_t) field->data_size); - } - } - } else if (PB_ATYPE(type) == PB_ATYPE_POINTER) { - /* Initialize the pointer to NULL. */ - *(void **) field->pField = NULL; - - /* Initialize array count to 0. */ - if (PB_HTYPE(type) == PB_HTYPE_REPEATED || - PB_HTYPE(type) == PB_HTYPE_ONEOF) { - *(pb_size_t *) field->pSize = 0; - } - } else if (PB_ATYPE(type) == PB_ATYPE_CALLBACK) { - /* Don't overwrite callback */ - } - - return true; -} - -static bool pb_message_set_to_defaults(pb_field_iter_t *iter) { - pb_istream_t defstream = PB_ISTREAM_EMPTY; - uint32_t tag = 0; - pb_wire_type_t wire_type = PB_WT_VARINT; - bool eof; - - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter->descriptor); - - if (descriptor->default_value) { - defstream = pb_istream_from_buffer(PB_PROGMEM_READTYPE(const pb_byte_t *, descriptor->default_value, 0), - (size_t) -1); - - if (!pb_decode_tag(&defstream, &wire_type, &tag, &eof)) - return false; - } - - do { - if (!pb_field_set_to_default(iter)) - return false; - - if (tag != 0 && iter->tag == tag) { - /* We have a default value for this field in the defstream */ - if (!decode_field(&defstream, wire_type, iter)) - return false; - if (!pb_decode_tag(&defstream, &wire_type, &tag, &eof)) - return false; - - if (iter->pSize) - *(bool *) iter->pSize = false; - } - } while (pb_field_iter_next(iter)); - - return true; -} - -/********************* - * Decode all fields * - *********************/ - -static bool checkreturn -pb_decode_inner(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags) { - uint32_t extension_range_start = 0; - pb_extension_t *extensions = NULL; - - ZEMU_TRACE() - - /* 'fixed_count_field' and 'fixed_count_size' track position of a repeated fixed - * count field. This can only handle _one_ repeated fixed count field that - * is unpacked and unordered among other (non repeated fixed count) fields. - */ - pb_size_t fixed_count_field = PB_SIZE_MAX; - pb_size_t fixed_count_size = 0; - pb_size_t fixed_count_total_size = 0; - - pb_fields_seen_t fields_seen = {{0, 0}}; - const uint32_t allbits = ~(uint32_t) 0; - pb_field_iter_t iter; - - ZEMU_TRACE() - - if (pb_field_iter_begin(&iter, fields, dest_struct)) { - if ((flags & PB_DECODE_NOINIT) == 0) { - if (!pb_message_set_to_defaults(&iter)) - PB_RETURN_ERROR(stream, "failed to set defaults"); - } - } - - while (stream->bytes_left) { - ZEMU_TRACE() - - uint32_t tag; - pb_wire_type_t wire_type; - bool eof; - - if (!pb_decode_tag(stream, &wire_type, &tag, &eof)) { - if (eof) - break; - else - return false; - } - - if (tag == 0) { - if (flags & PB_DECODE_NULLTERMINATED) { - break; - } else { - PB_RETURN_ERROR(stream, "zero tag"); - } - } - - ZEMU_TRACE() - const bool tag_found = pb_field_iter_find(&iter, tag); - ZEMU_TRACE() - const bool type_is_extension = PB_LTYPE(iter.type) == PB_LTYPE_EXTENSION; - ZEMU_TRACE() - - if (!tag_found || type_is_extension) { - ZEMU_TRACE() - - /* No match found, check if it matches an extension. */ - if (extension_range_start == 0) { - if (pb_field_iter_find_extension(&iter)) { - extensions = *(pb_extension_t *const *) iter.pData; - extension_range_start = iter.tag; - } - - if (!extensions) { - extension_range_start = (uint32_t) -1; - } - } - - if (tag >= extension_range_start) { - size_t pos = stream->bytes_left; - - if (!decode_extension(stream, tag, wire_type, extensions)) - return false; - - if (pos != stream->bytes_left) { - /* The field was handled */ - continue; - } - } - - /* No match found, skip data */ - if (!pb_skip_field(stream, wire_type)) - return false; - continue; - } - - ZEMU_TRACE() - - /* If a repeated fixed count field was found, get size from - * 'fixed_count_field' as there is no counter contained in the struct. - */ - if (PB_HTYPE(iter.type) == PB_HTYPE_REPEATED && iter.pSize == &iter.array_size) { - if (fixed_count_field != iter.index) { - /* If the new fixed count field does not match the previous one, - * check that the previous one is NULL or that it finished - * receiving all the expected data. - */ - if (fixed_count_field != PB_SIZE_MAX && - fixed_count_size != fixed_count_total_size) { - PB_RETURN_ERROR(stream, "wrong size for fixed count field"); - } - - fixed_count_field = iter.index; - fixed_count_size = 0; - fixed_count_total_size = iter.array_size; - } - - iter.pSize = &fixed_count_size; - } - - ZEMU_TRACE() - - if (PB_HTYPE(iter.type) == PB_HTYPE_REQUIRED - && iter.required_field_index < PB_MAX_REQUIRED_FIELDS) { - uint32_t tmp = ((uint32_t) 1 << (iter.required_field_index & 31)); - fields_seen.bitfield[iter.required_field_index >> 5] |= tmp; - } - - ZEMU_TRACE() - - if (!decode_field(stream, wire_type, &iter)) - return false; - } - - ZEMU_TRACE() - - /* Check that all elements of the last decoded fixed count field were present. */ - if (fixed_count_field != PB_SIZE_MAX && - fixed_count_size != fixed_count_total_size) { - PB_RETURN_ERROR(stream, "wrong size for fixed count field"); - } - - ZEMU_TRACE() - - /* Check that all required fields were present. */ - { - ZEMU_TRACE() - - const pb_msgdesc_t *descriptor = (const pb_msgdesc_t *) PIC(iter.descriptor); - pb_size_t req_field_count = descriptor->required_field_count; - - ZEMU_TRACE() - - if (req_field_count > 0) { - pb_size_t i; - - ZEMU_TRACE() - - if (req_field_count > PB_MAX_REQUIRED_FIELDS) - req_field_count = PB_MAX_REQUIRED_FIELDS; - - ZEMU_TRACE() - - /* Check the whole words */ - for (i = 0; i < (req_field_count >> 5); i++) { - if (fields_seen.bitfield[i] != allbits) - PB_RETURN_ERROR(stream, "missing required field"); - } - - ZEMU_TRACE() - - /* Check the remaining bits (if any) */ - if ((req_field_count & 31) != 0) { - if (fields_seen.bitfield[req_field_count >> 5] != - (allbits >> (uint_least8_t) (32 - (req_field_count & 31)))) { - PB_RETURN_ERROR(stream, "missing required field"); - } - } - } - } - - ZEMU_TRACE() - - return true; -} - -bool checkreturn pb_decode_ex(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags) { - bool status; - - if ((flags & PB_DECODE_DELIMITED) == 0) { - status = pb_decode_inner(stream, fields, dest_struct, flags); - } else { - pb_istream_t substream; - if (!pb_make_string_substream(stream, &substream)) - return false; - - status = pb_decode_inner(&substream, fields, dest_struct, flags); - - if (!pb_close_string_substream(stream, &substream)) - return false; - } - -#ifdef PB_ENABLE_MALLOC - if (!status) - pb_release(fields, dest_struct); -#endif - - return status; -} - -bool checkreturn pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct) { - bool status; - - status = pb_decode_inner(stream, fields, dest_struct, 0); - -#ifdef PB_ENABLE_MALLOC - if (!status) - pb_release(fields, dest_struct); -#endif - - return status; -} - -#ifdef PB_ENABLE_MALLOC -/* Given an oneof field, if there has already been a field inside this oneof, - * release it before overwriting with a different one. */ -static bool pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *field) -{ - pb_field_iter_t old_field = *field; - pb_size_t old_tag = *(pb_size_t*)field->pSize; /* Previous which_ value */ - pb_size_t new_tag = field->tag; /* New which_ value */ - - if (old_tag == 0) - return true; /* Ok, no old data in union */ - - if (old_tag == new_tag) - return true; /* Ok, old data is of same type => merge */ - - /* Release old data. The find can fail if the message struct contains - * invalid data. */ - if (!pb_field_iter_find(&old_field, old_tag)) - PB_RETURN_ERROR(stream, "invalid union tag"); - - pb_release_single_field(&old_field); - - if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) - { - /* Initialize the pointer to NULL to make sure it is valid - * even in case of error return. */ - *(void**)field->pField = NULL; - field->pData = NULL; - } - - return true; -} - -static void pb_release_single_field(pb_field_iter_t *field) -{ - pb_type_t type; - type = field->type; - - if (PB_HTYPE(type) == PB_HTYPE_ONEOF) - { - if (*(pb_size_t*)field->pSize != field->tag) - return; /* This is not the current field in the union */ - } - - /* Release anything contained inside an extension or submsg. - * This has to be done even if the submsg itself is statically - * allocated. */ - if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) - { - /* Release fields from all extensions in the linked list */ - pb_extension_t *ext = *(pb_extension_t**)field->pData; - while (ext != NULL) - { - pb_field_iter_t ext_iter; - if (pb_field_iter_begin_extension(&ext_iter, ext)) - { - pb_release_single_field(&ext_iter); - } - ext = ext->next; - } - } - else if (PB_LTYPE_IS_SUBMSG(type) && PB_ATYPE(type) != PB_ATYPE_CALLBACK) - { - /* Release fields in submessage or submsg array */ - pb_size_t count = 1; - - if (PB_ATYPE(type) == PB_ATYPE_POINTER) - { - field->pData = *(void**)field->pField; - } - else - { - field->pData = field->pField; - } - - if (PB_HTYPE(type) == PB_HTYPE_REPEATED) - { - count = *(pb_size_t*)field->pSize; - - if (PB_ATYPE(type) == PB_ATYPE_STATIC && count > field->array_size) - { - /* Protect against corrupted _count fields */ - count = field->array_size; - } - } - - if (field->pData) - { - for (; count > 0; count--) - { - pb_release(field->submsg_desc, field->pData); - field->pData = (char*)field->pData + field->data_size; - } - } - } - - if (PB_ATYPE(type) == PB_ATYPE_POINTER) - { - if (PB_HTYPE(type) == PB_HTYPE_REPEATED && - (PB_LTYPE(type) == PB_LTYPE_STRING || - PB_LTYPE(type) == PB_LTYPE_BYTES)) - { - /* Release entries in repeated string or bytes array */ - void **pItem = *(void***)field->pField; - pb_size_t count = *(pb_size_t*)field->pSize; - for (; count > 0; count--) - { - pb_free(*pItem); - *pItem++ = NULL; - } - } - - if (PB_HTYPE(type) == PB_HTYPE_REPEATED) - { - /* We are going to release the array, so set the size to 0 */ - *(pb_size_t*)field->pSize = 0; - } - - /* Release main pointer */ - pb_free(*(void**)field->pField); - *(void**)field->pField = NULL; - } -} - -void pb_release(const pb_msgdesc_t *fields, void *dest_struct) -{ - pb_field_iter_t iter; - - if (!dest_struct) - return; /* Ignore NULL pointers, similar to free() */ - - if (!pb_field_iter_begin(&iter, fields, dest_struct)) - return; /* Empty message type */ - - do - { - pb_release_single_field(&iter); - } while (pb_field_iter_next(&iter)); -} -#endif - -/* Field decoders */ - -bool pb_decode_bool(pb_istream_t *stream, bool *dest) { - uint32_t value; - if (!pb_decode_varint32(stream, &value)) - return false; - - *(bool *) dest = (value != 0); - return true; -} - -bool pb_decode_svarint(pb_istream_t *stream, pb_int64_t *dest) { - pb_uint64_t value; - if (!pb_decode_varint(stream, &value)) - return false; - - if (value & 1) - *dest = (pb_int64_t) (~(value >> 1)); - else - *dest = (pb_int64_t) (value >> 1); - - return true; -} - -bool pb_decode_fixed32(pb_istream_t *stream, void *dest) { - union { - uint32_t fixed32; - pb_byte_t bytes[4]; - } u; - - if (!pb_read(stream, u.bytes, 4)) - return false; - -#if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN && CHAR_BIT == 8 - /* fast path - if we know that we're on little endian, assign directly */ - *(uint32_t*)dest = u.fixed32; -#else - *(uint32_t *) dest = ((uint32_t) u.bytes[0] << 0) | - ((uint32_t) u.bytes[1] << 8) | - ((uint32_t) u.bytes[2] << 16) | - ((uint32_t) u.bytes[3] << 24); -#endif - return true; -} - -#ifndef PB_WITHOUT_64BIT - -bool pb_decode_fixed64(pb_istream_t *stream, void *dest) { - union { - uint64_t fixed64; - pb_byte_t bytes[8]; - } u; - - if (!pb_read(stream, u.bytes, 8)) - return false; - -#if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN && CHAR_BIT == 8 - /* fast path - if we know that we're on little endian, assign directly */ - *(uint64_t*)dest = u.fixed64; -#else - *(uint64_t *) dest = ((uint64_t) u.bytes[0] << 0) | - ((uint64_t) u.bytes[1] << 8) | - ((uint64_t) u.bytes[2] << 16) | - ((uint64_t) u.bytes[3] << 24) | - ((uint64_t) u.bytes[4] << 32) | - ((uint64_t) u.bytes[5] << 40) | - ((uint64_t) u.bytes[6] << 48) | - ((uint64_t) u.bytes[7] << 56); -#endif - return true; -} - -#endif - -static bool checkreturn pb_dec_bool(pb_istream_t *stream, const pb_field_iter_t *field) { - return pb_decode_bool(stream, (bool *) field->pData); -} - -static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_iter_t *field) { - if (PB_LTYPE(field->type) == PB_LTYPE_UVARINT) { - pb_uint64_t value, clamped; - if (!pb_decode_varint(stream, &value)) - return false; - - /* Cast to the proper field size, while checking for overflows */ - if (field->data_size == sizeof(pb_uint64_t)) - clamped = *(pb_uint64_t *) field->pData = value; - else if (field->data_size == sizeof(uint32_t)) - clamped = *(uint32_t *) field->pData = (uint32_t) value; - else if (field->data_size == sizeof(uint_least16_t)) - clamped = *(uint_least16_t *) field->pData = (uint_least16_t) value; - else if (field->data_size == sizeof(uint_least8_t)) - clamped = *(uint_least8_t *) field->pData = (uint_least8_t) value; - else - PB_RETURN_ERROR(stream, "invalid data_size"); - - if (clamped != value) - PB_RETURN_ERROR(stream, "integer too large"); - - return true; - } else { - pb_uint64_t value; - pb_int64_t svalue; - pb_int64_t clamped; - - if (PB_LTYPE(field->type) == PB_LTYPE_SVARINT) { - if (!pb_decode_svarint(stream, &svalue)) - return false; - } else { - if (!pb_decode_varint(stream, &value)) - return false; - - /* See issue 97: Google's C++ protobuf allows negative varint values to - * be cast as int32_t, instead of the int64_t that should be used when - * encoding. Nanopb versions before 0.2.5 had a bug in encoding. In order to - * not break decoding of such messages, we cast <=32 bit fields to - * int32_t first to get the sign correct. - */ - if (field->data_size == sizeof(pb_int64_t)) - svalue = (pb_int64_t) value; - else - svalue = (int32_t) value; - } - - /* Cast to the proper field size, while checking for overflows */ - if (field->data_size == sizeof(pb_int64_t)) - clamped = *(pb_int64_t *) field->pData = svalue; - else if (field->data_size == sizeof(int32_t)) - clamped = *(int32_t *) field->pData = (int32_t) svalue; - else if (field->data_size == sizeof(int_least16_t)) - clamped = *(int_least16_t *) field->pData = (int_least16_t) svalue; - else if (field->data_size == sizeof(int_least8_t)) - clamped = *(int_least8_t *) field->pData = (int_least8_t) svalue; - else - PB_RETURN_ERROR(stream, "invalid data_size"); - - if (clamped != svalue) - PB_RETURN_ERROR(stream, "integer too large"); - - return true; - } -} - -static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_iter_t *field) { - uint32_t size; - size_t alloc_size; - pb_bytes_array_t *dest; - - if (!pb_decode_varint32(stream, &size)) - return false; - - if (size > PB_SIZE_MAX) - PB_RETURN_ERROR(stream, "bytes overflow"); - - alloc_size = PB_BYTES_ARRAY_T_ALLOCSIZE(size); - if (size > alloc_size) - PB_RETURN_ERROR(stream, "size too large"); - - if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) { -#ifndef PB_ENABLE_MALLOC - PB_RETURN_ERROR(stream, "no malloc support"); -#else - if (stream->bytes_left < size) - PB_RETURN_ERROR(stream, "end-of-stream"); - - if (!allocate_field(stream, field->pData, alloc_size, 1)) - return false; - dest = *(pb_bytes_array_t**)field->pData; -#endif - } else { - if (alloc_size > field->data_size) - PB_RETURN_ERROR(stream, "bytes overflow"); - dest = (pb_bytes_array_t *) field->pData; - } - - dest->size = (pb_size_t) size; - return pb_read(stream, dest->bytes, (size_t) size); -} - -static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_iter_t *field) { - uint32_t size; - size_t alloc_size; - pb_byte_t *dest = (pb_byte_t *) field->pData; - - if (!pb_decode_varint32(stream, &size)) - return false; - - if (size == (uint32_t) -1) - PB_RETURN_ERROR(stream, "size too large"); - - /* Space for null terminator */ - alloc_size = (size_t) (size + 1); - - if (alloc_size < size) - PB_RETURN_ERROR(stream, "size too large"); - - if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) { -#ifndef PB_ENABLE_MALLOC - PB_RETURN_ERROR(stream, "no malloc support"); -#else - if (stream->bytes_left < size) - PB_RETURN_ERROR(stream, "end-of-stream"); - - if (!allocate_field(stream, field->pData, alloc_size, 1)) - return false; - dest = *(pb_byte_t**)field->pData; -#endif - } else { - if (alloc_size > field->data_size) - PB_RETURN_ERROR(stream, "string overflow"); - } - - dest[size] = 0; - - if (!pb_read(stream, dest, (size_t) size)) - return false; - -#ifdef PB_VALIDATE_UTF8 - if (!pb_validate_utf8((const char*)dest)) - PB_RETURN_ERROR(stream, "invalid utf8"); -#endif - - return true; -} - -static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_iter_t *field) { - bool status = true; - bool submsg_consumed = false; - pb_istream_t substream; - - if (!pb_make_string_substream(stream, &substream)) - return false; - - if (field->submsg_desc == NULL) - PB_RETURN_ERROR(stream, "invalid field descriptor"); - - /* Submessages can have a separate message-level callback that is called - * before decoding the message. Typically it is used to set callback fields - * inside oneofs. */ - if (PB_LTYPE(field->type) == PB_LTYPE_SUBMSG_W_CB && field->pSize != NULL) { - /* Message callback is stored right before pSize. */ - pb_callback_t *callback = (pb_callback_t *) field->pSize - 1; - if (callback->funcs.decode) { - status = callback->funcs.decode(&substream, field, &callback->arg); - - if (substream.bytes_left == 0) { - submsg_consumed = true; - } - } - } - - /* Now decode the submessage contents */ - if (status && !submsg_consumed) { - unsigned int flags = 0; - - /* Static required/optional fields are already initialized by top-level - * pb_decode(), no need to initialize them again. */ - if (PB_ATYPE(field->type) == PB_ATYPE_STATIC && - PB_HTYPE(field->type) != PB_HTYPE_REPEATED) { - flags = PB_DECODE_NOINIT; - } - - status = pb_decode_inner(&substream, field->submsg_desc, field->pData, flags); - } - - if (!pb_close_string_substream(stream, &substream)) - return false; - - return status; -} - -static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_iter_t *field) { - uint32_t size; - - if (!pb_decode_varint32(stream, &size)) - return false; - - if (size > PB_SIZE_MAX) - PB_RETURN_ERROR(stream, "bytes overflow"); - - if (size == 0) { - /* As a special case, treat empty bytes string as all zeros for fixed_length_bytes. */ - memset(field->pData, 0, (size_t) field->data_size); - return true; - } - - if (size != field->data_size) - PB_RETURN_ERROR(stream, "incorrect fixed length bytes size"); - - return pb_read(stream, (pb_byte_t *) field->pData, (size_t) field->data_size); -} - -#ifdef PB_CONVERT_DOUBLE_FLOAT -bool pb_decode_double_as_float(pb_istream_t *stream, float *dest) -{ - uint_least8_t sign; - int exponent; - uint32_t mantissa; - uint64_t value; - union { float f; uint32_t i; } out; - - if (!pb_decode_fixed64(stream, &value)) - return false; - - /* Decompose input value */ - sign = (uint_least8_t)((value >> 63) & 1); - exponent = (int)((value >> 52) & 0x7FF) - 1023; - mantissa = (value >> 28) & 0xFFFFFF; /* Highest 24 bits */ - - /* Figure if value is in range representable by floats. */ - if (exponent == 1024) - { - /* Special value */ - exponent = 128; - mantissa >>= 1; - } - else - { - if (exponent > 127) - { - /* Too large, convert to infinity */ - exponent = 128; - mantissa = 0; - } - else if (exponent < -150) - { - /* Too small, convert to zero */ - exponent = -127; - mantissa = 0; - } - else if (exponent < -126) - { - /* Denormalized */ - mantissa |= 0x1000000; - mantissa >>= (-126 - exponent); - exponent = -127; - } - - /* Round off mantissa */ - mantissa = (mantissa + 1) >> 1; - - /* Check if mantissa went over 2.0 */ - if (mantissa & 0x800000) - { - exponent += 1; - mantissa &= 0x7FFFFF; - mantissa >>= 1; - } - } - - /* Combine fields */ - out.i = mantissa; - out.i |= (uint32_t)(exponent + 127) << 23; - out.i |= (uint32_t)sign << 31; - - *dest = out.f; - return true; -} -#endif diff --git a/deps/nanopb_tiny/pb_decode.h b/deps/nanopb_tiny/pb_decode.h deleted file mode 100644 index fa99389f..00000000 --- a/deps/nanopb_tiny/pb_decode.h +++ /dev/null @@ -1,207 +0,0 @@ -/* pb_decode.h: Functions to decode protocol buffers. Depends on pb_decode.c. - * The main function is pb_decode. You also need an input stream, and the - * field descriptions created by nanopb_generator.py. - */ - -#ifndef PB_DECODE_H_INCLUDED -#define PB_DECODE_H_INCLUDED - -#include "pb.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Structure for defining custom input streams. You will need to provide - * a callback function to read the bytes from your storage, which can be - * for example a file or a network socket. - * - * The callback must conform to these rules: - * - * 1) Return false on IO errors. This will cause decoding to abort. - * 2) You can use state to store your own data (e.g. buffer pointer), - * and rely on pb_read to verify that no-body reads past bytes_left. - * 3) Your callback may be used with substreams, in which case bytes_left - * is different than from the main stream. Don't use bytes_left to compute - * any pointers. - */ -struct pb_istream_s { -#ifdef PB_BUFFER_ONLY - /* Callback pointer is not used in buffer-only configuration. - * Having an int pointer here allows binary compatibility but - * gives an error if someone tries to assign callback function. - */ - int *callback; -#else - - bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count); - -#endif - - void *state; /* Free field for use by callback implementation */ - size_t bytes_left; - -#ifndef PB_NO_ERRMSG - const char *errmsg; -#endif -}; - -#ifndef PB_NO_ERRMSG -#define PB_ISTREAM_EMPTY {0,0,0,0} -#else -#define PB_ISTREAM_EMPTY {0,0,0} -#endif - -/*************************** - * Main decoding functions * - ***************************/ - -/* Decode a single protocol buffers message from input stream into a C structure. - * Returns true on success, false on any failure. - * The actual struct pointed to by dest must match the description in fields. - * Callback fields of the destination structure must be initialized by caller. - * All other fields will be initialized by this function. - * - * Example usage: - * MyMessage msg = {}; - * uint8_t buffer[64]; - * pb_istream_t stream; - * - * // ... read some data into buffer ... - * - * stream = pb_istream_from_buffer(buffer, count); - * pb_decode(&stream, MyMessage_fields, &msg); - */ -bool pb_decode(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct); - -/* Extended version of pb_decode, with several options to control - * the decoding process: - * - * PB_DECODE_NOINIT: Do not initialize the fields to default values. - * This is slightly faster if you do not need the default - * values and instead initialize the structure to 0 using - * e.g. memset(). This can also be used for merging two - * messages, i.e. combine already existing data with new - * values. - * - * PB_DECODE_DELIMITED: Input message starts with the message size as varint. - * Corresponds to parseDelimitedFrom() in Google's - * protobuf API. - * - * PB_DECODE_NULLTERMINATED: Stop reading when field tag is read as 0. This allows - * reading null terminated messages. - * NOTE: Until nanopb-0.4.0, pb_decode() also allows - * null-termination. This behaviour is not supported in - * most other protobuf implementations, so PB_DECODE_DELIMITED - * is a better option for compatibility. - * - * Multiple flags can be combined with bitwise or (| operator) - */ -#define PB_DECODE_NOINIT 0x01U -#define PB_DECODE_DELIMITED 0x02U -#define PB_DECODE_NULLTERMINATED 0x04U - -bool pb_decode_ex(pb_istream_t *stream, const pb_msgdesc_t *fields, void *dest_struct, unsigned int flags); - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define pb_decode_noinit(s, f, d) pb_decode_ex(s,f,d, PB_DECODE_NOINIT) -#define pb_decode_delimited(s, f, d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED) -#define pb_decode_delimited_noinit(s, f, d) pb_decode_ex(s,f,d, PB_DECODE_DELIMITED | PB_DECODE_NOINIT) -#define pb_decode_nullterminated(s, f, d) pb_decode_ex(s,f,d, PB_DECODE_NULLTERMINATED) - -#ifdef PB_ENABLE_MALLOC -/* Release any allocated pointer fields. If you use dynamic allocation, you should - * call this for any successfully decoded message when you are done with it. If - * pb_decode() returns with an error, the message is already released. - */ -void pb_release(const pb_msgdesc_t *fields, void *dest_struct); -#else -/* Allocation is not supported, so release is no-op */ -#define pb_release(fields, dest_struct) PB_UNUSED(fields); PB_UNUSED(dest_struct); -#endif - - -/************************************** - * Functions for manipulating streams * - **************************************/ - -/* Create an input stream for reading from a memory buffer. - * - * msglen should be the actual length of the message, not the full size of - * allocated buffer. - * - * Alternatively, you can use a custom stream that reads directly from e.g. - * a file or a network socket. - */ -pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t msglen); - -/* Function to read from a pb_istream_t. You can use this if you need to - * read some custom header data, or to read data in field callbacks. - */ -bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); - - -/************************************************ - * Helper functions for writing field callbacks * - ************************************************/ - -/* Decode the tag for the next field in the stream. Gives the wire type and - * field tag. At end of the message, returns false and sets eof to true. */ -bool pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof); - -/* Skip the field payload data, given the wire type. */ -bool pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type); - -/* Decode an integer in the varint format. This works for enum, int32, - * int64, uint32 and uint64 field types. */ -#ifndef PB_WITHOUT_64BIT - -bool pb_decode_varint(pb_istream_t *stream, uint64_t *dest); - -#else -#define pb_decode_varint pb_decode_varint32 -#endif - -/* Decode an integer in the varint format. This works for enum, int32, - * and uint32 field types. */ -bool pb_decode_varint32(pb_istream_t *stream, uint32_t *dest); - -/* Decode a bool value in varint format. */ -bool pb_decode_bool(pb_istream_t *stream, bool *dest); - -/* Decode an integer in the zig-zagged svarint format. This works for sint32 - * and sint64. */ -#ifndef PB_WITHOUT_64BIT - -bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest); - -#else -bool pb_decode_svarint(pb_istream_t *stream, int32_t *dest); -#endif - -/* Decode a fixed32, sfixed32 or float value. You need to pass a pointer to - * a 4-byte wide C variable. */ -bool pb_decode_fixed32(pb_istream_t *stream, void *dest); - -#ifndef PB_WITHOUT_64BIT -/* Decode a fixed64, sfixed64 or double value. You need to pass a pointer to - * a 8-byte wide C variable. */ -bool pb_decode_fixed64(pb_istream_t *stream, void *dest); - -#endif - -#ifdef PB_CONVERT_DOUBLE_FLOAT -/* Decode a double value into float variable. */ -bool pb_decode_double_as_float(pb_istream_t *stream, float *dest); -#endif - -/* Make a limited-length substream for reading a PB_WT_STRING field. */ -bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream); - -bool pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/deps/nanos-secure-sdk b/deps/nanos-secure-sdk index 30189cfd..62dd0477 160000 --- a/deps/nanos-secure-sdk +++ b/deps/nanos-secure-sdk @@ -1 +1 @@ -Subproject commit 30189cfd070040e5c144d4dab103d549302dcfff +Subproject commit 62dd047774b5e8a6b4e6158b493ee029453b5bae diff --git a/deps/nanosplus-secure-sdk b/deps/nanosplus-secure-sdk index 45ccba9c..48bb8d49 160000 --- a/deps/nanosplus-secure-sdk +++ b/deps/nanosplus-secure-sdk @@ -1 +1 @@ -Subproject commit 45ccba9cd72eaae0d1305b9d519d3702fb4e138b +Subproject commit 48bb8d493548f840ddd261bbe60930f3f5966e7b diff --git a/deps/nanox-secure-sdk b/deps/nanox-secure-sdk index 2d6e2e0d..48bb8d49 160000 --- a/deps/nanox-secure-sdk +++ b/deps/nanox-secure-sdk @@ -1 +1 @@ -Subproject commit 2d6e2e0d2eda2a09bc79bdf57b6b2e3d708eec1d +Subproject commit 48bb8d493548f840ddd261bbe60930f3f5966e7b diff --git a/deps/stax-secure-sdk b/deps/stax-secure-sdk index cabc1590..a23bad84 160000 --- a/deps/stax-secure-sdk +++ b/deps/stax-secure-sdk @@ -1 +1 @@ -Subproject commit cabc159007c6d257636ce8fb5b779b7b69f78c91 +Subproject commit a23bad84cbf39a5071644d2191b177191c089b23 diff --git a/js/package.json b/js/package.json index 16249462..fa25610a 100644 --- a/js/package.json +++ b/js/package.json @@ -28,16 +28,16 @@ "@zondax/ledger-js": "^0.2.2" }, "devDependencies": { - "@types/node": "^18.11.18", - "@typescript-eslint/eslint-plugin": "^5.47.1", - "@typescript-eslint/parser": "^5.47.1", + "@types/node": "^20.11.24", + "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/parser": "^7.1.0", "eslint": "^8.31.0", - "eslint-config-prettier": "^8.5.0", - "eslint-config-standard-with-typescript": "^34.0.1", + "eslint-config-prettier": "^9.1.0", + "eslint-config-standard-with-typescript": "^43.0.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.6.0", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", - "prettier": "^2.8.1", + "prettier": "^3.2.5", "typescript": "^5.0.2" }, "files": [ diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 00000000..3e4cbb1f --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,7 @@ +[app] +build_directory = "./app/" +sdk = "C" +devices = ["nanos", "nanox", "nanos+", "stax"] + +[tests] +unit_directory = "./tests/" diff --git a/tests/cbor_parser.cpp b/tests/cbor_parser.cpp index 25ce390c..09bcb87d 100644 --- a/tests/cbor_parser.cpp +++ b/tests/cbor_parser.cpp @@ -23,280 +23,28 @@ #include #include -#include "pb_decode.h" -#include "protobuf/dfinity.pb.h" -#include "protobuf/governance.pb.h" -#include "protobuf/base_types.pb.h" #include "zxformat.h" // Basic CBOR test cases generated with http://cbor.me/ namespace { - TEST(TxTest, one_byte_accountid) { - parser_tx_obj.special_transfer_type = normal_transaction; - uint8_t inBuffer[1000]; - const char *tmp = "d9d9f7a167636f6e74656e74a6636172674c620210011a0612040a0211116b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16a2cd02c5b2d1006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d8a4aa4ffc7bc5ccdcd5a7a3d10c9bb06741063b02c7e908a624f721d02"; - - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - //SHOULD FAIL - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_context_unexpected_size); - - } - - TEST(NANOPBTEST, mergeMaturity) { - uint8_t inBuffer[1000]; - const char *tmp = "620210016A02080E"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 13); - EXPECT_EQ(request.has_id, false); - EXPECT_EQ(request.neuron_id_or_subaccount.neuron_id.id,1); - EXPECT_EQ(request.which_neuron_id_or_subaccount,12); - EXPECT_EQ(request.command.merge_maturity.percentage_to_merge, 14); - } - - TEST(NANOPBTEST, registerVote) { - uint8_t inBuffer[1000]; - const char *tmp = "620310C8033A060A02087B1001"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 7); - EXPECT_EQ(request.has_id, false); - EXPECT_EQ(request.neuron_id_or_subaccount.neuron_id.id,456); - EXPECT_EQ(request.which_neuron_id_or_subaccount,12); - EXPECT_EQ(request.command.register_vote.proposal.id, 123); - EXPECT_EQ(request.command.register_vote.vote, 1); - } - - TEST(NANOPBTEST, follow) { - uint8_t inBuffer[1000]; - const char *tmp = "6202107B2A3C1202100112021002120210031202100412021005120210061202100712021008120210091202100A1202100B1202100C1202100D1202100E1202100F"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 5); - EXPECT_EQ(request.has_id, false); - EXPECT_EQ(request.neuron_id_or_subaccount.neuron_id.id,123); - EXPECT_EQ(request.command.follow.topic, 0); - EXPECT_EQ(request.command.follow.followees_count, 15); - EXPECT_EQ(request.which_neuron_id_or_subaccount,12); - EXPECT_EQ(request.command.follow.followees[0].id,1); - EXPECT_EQ(request.command.follow.followees[14].id,15); - } - - TEST(NANOPBTEST, test) { - uint8_t inBuffer[1000]; - const char *tmp = "0A0012050A0308E8071A0308890122220A2001010101010101010101010101010101010101010101010101010101010101012A220A2035548EC29E9D85305850E87A2D2642FE7214FF4BB36334070DEAFC3345C3B127"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - SendRequest request = SendRequest_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, SendRequest_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.to.hash[0], 0x35); - } - - TEST(NANOPBTEST, increaseTimer) { - uint8_t inBuffer[1000]; - const char *tmp = "0A02107B12060A040880A305"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.id.id, 123); - EXPECT_EQ(request.which_command, 2); - EXPECT_EQ(request.command.configure.which_operation, 1); - EXPECT_EQ(request.command.configure.operation.increase_dissolve_delay.additional_dissolve_delay_seconds, 86400); - } - - TEST(NANOPBTEST, AddHotkey) { - uint8_t inBuffer[1000]; - const char *tmp = "0A02107B122322210A1F0A1D45717A3A0E68FCEEF546AC77BAC551754B48DBB1FCCFA180673030B602"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 2); - - EXPECT_EQ(request.command.configure.which_operation, 4); - - EXPECT_EQ(request.id.id, 123); - - EXPECT_EQ(request.command.configure.operation.add_hot_key.has_new_hot_key, true); - EXPECT_EQ(request.command.configure.operation.add_hot_key.new_hot_key.serialized_id.size, 29); - - char buffer[100]; - array_to_hexstr(buffer, 100, request.command.configure.operation.add_hot_key.new_hot_key.serialized_id.bytes, - 29); - printf("%s\n", buffer); - } - - TEST(NANOPBTEST, RemoveHotkey) { - uint8_t inBuffer[1000]; - const char *tmp = "0A02107B12232A210A1F0A1D45717A3A0E68FCEEF546AC77BAC551754B48DBB1FCCFA180673030B602"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 2); - - EXPECT_EQ(request.command.configure.which_operation, 5); - } - - TEST(NANOPBTEST, StartDisolve) { - uint8_t inBuffer[1000]; - const char *tmp = "0A02107B12021200"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.id.id, 123); - - EXPECT_EQ(request.which_command, 2); - - EXPECT_EQ(request.command.configure.which_operation, 2); - } - - TEST(NANOPBTEST, Spawn) { - uint8_t inBuffer[1000]; - const char *tmp = "620310D20922210A1F0A1D1AE9690FA70DA5046B84210162105D0F6E510B7211FA7B72AEED333702"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.command.spawn.new_controller.serialized_id.size, 29); - - char buffer[300]; - - array_to_hexstr(buffer, 300, request.command.spawn.new_controller.serialized_id.bytes,29); - printf("%s", buffer); - - } - - TEST(NANOPBTEST, Disburse) { - uint8_t inBuffer[1000]; - const char *tmp = "0A02107B1A2B0A05088092F40112220A2035548EC29E9D85305850E87A2D2642FE7214FF4BB36334070DEAFC3345C3B127"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.which_command, 3); - - EXPECT_EQ(request.id.id, 123); - - EXPECT_EQ(request.command.disburse.amount.e8s, 4000000); - - EXPECT_EQ(request.command.disburse.to_account.hash.size, 32); - } + // TODO: this test was removed because app no longer supports protobuf + /* TEST(TxTest, one_byte_accountid) { */ + /* parser_tx_obj.special_transfer_type = normal_transaction; */ + /* uint8_t inBuffer[1000]; */ + /* const char *tmp = "d9d9f7a167636f6e74656e74a6636172674c620210011a0612040a0211116b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16a2cd02c5b2d1006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d8a4aa4ffc7bc5ccdcd5a7a3d10c9bb06741063b02c7e908a624f721d02"; */ + /**/ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* //SHOULD FAIL */ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_context_unexpected_size); */ + /**/ + /* } */ TEST(CBORParserTest, MinimalListTest) { // [1,2,3] @@ -310,7 +58,7 @@ namespace { err = cbor_parser_init(inBuffer, inBufferLen, 0, &parser, &it); EXPECT_EQ(err, CborNoError); - size_t arrLen; + size_t arrLen; err = cbor_value_get_array_length(&it, &arrLen); EXPECT_EQ(err, CborNoError); EXPECT_EQ(arrLen, 3); @@ -493,131 +241,108 @@ namespace { EXPECT_EQ(err, parser_ok); } - TEST(CBORParserTest, TokenTransfer) { - parser_tx_obj.special_transfer_type = normal_transaction; - uint8_t inBuffer[1000]; - const char *tmp = "d9d9f7a367636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e636550f5390d960c6e52f489155a4309da03da6e696e67726573735f6578706972791b1674c5e29ec9c2106673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000201016b6d6574686f645f6e616d656773656e645f70626361726758560a0012050a0308e8071a0308890122220a2001010101010101010101010101010101010101010101010101010101010101012a220a2035548ec29e9d85305850e87a2d2642fe7214ff4bb36334070deafc3345c3b1276d73656e6465725f7075626b657958583056301006072a8648ce3d020106052b8104000a03420004e1142e1fbc940344d9161709196bb8bd151f94379c48dd507ab99a0776109128b94b5303cf2b2d28e25a779da175b62f8a975599b20c63d5193202640576ec5e6a73656e6465725f7369675840de5bccbb0a0173c432cd58ea4495d4d1e122d6ce04e31dcf63217f3d3a9b73130dc9bbf3b10e61c8db8bf8800bb4649e27786e5bc9418838c95864be28487a6a"; - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_ok); - - } - - TEST(CBORParserTest, IncreaseNeuronTimer) { - parser_tx_obj.special_transfer_type = normal_transaction; - uint8_t inBuffer[1000]; - - const char *tmp = "d9d9f7a167636f6e74656e74a6636172675839620a10a7d18aaad3a2a2c6131a2b0a0508959aef3a12220a2068d518e2fd2be6566e62c36611b9794dfcbc04eb4227eefb73ab3c7a2d0ae5776b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b169bc8985c330d006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d8a4aa4ffc7bc5ccdcd5a7a3d10c9bb06741063b02c7e908a624f721d02"; - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_ok); - } - - TEST(CBORParserTest, StakeTx) { - parser_tx_obj.special_transfer_type = neuron_stake_transaction; - uint8_t inBuffer[1000]; - - const char *tmp = "d9d9f7a167636f6e74656e74a663617267583e0a0a08f2d4a0eca697869f0812070a050880c2d72f1a0308904e2a220a20a8a1abecdb66f57eb6eba44c3b5f11a6c433fe932680a9519b064b80ca8794e16b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16985a582755f1806b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302"; - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_ok); - parser_tx_obj.special_transfer_type = invalid; - } - - TEST(CBORParserTest, ClaimNeuron) { - parser_tx_obj.special_transfer_type = normal_transaction; - uint8_t inBuffer[1000]; - - const char *tmp = "d9d9f7a167636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e6365505833a6590c6d2b601e3a24557cfbb4336e696e67726573735f6578706972791b16bad506bb4ca0f06673656e646572581d2594dccb73ca0226c58299d4e21badbcee00d153deccb38fa20cd46e026b63616e69737465725f69644a000000000000000601016b6d6574686f645f6e616d656d636c61696d5f6e6575726f6e7363617267588b4449444c000171820130343139623066656363356639613164353162393033643262363234346430356531326134386661386233353731396538313262623635643966393035613365613965356137323362363537616665393136313236396431663134633164383034376530323230616461633434653731313630323531656364616662613064636535"; - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_ok); - } - - TEST(CBORParserTest, Configure_JoinCommunityFund) { - parser_tx_obj.special_transfer_type = normal_transaction; - uint8_t inBuffer[1000]; - - const char *tmp = "d9d9f7a167636f6e74656e74a663617267486202107b12023a006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16ba67d2b864bf406b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; - auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); - - parser_context_t ctx; - auto err = parser_parse(&ctx, inBuffer, inBufferLen); - EXPECT_EQ(err, parser_ok); - - err = parser_validate(&ctx); - EXPECT_EQ(err, parser_ok); - } - - TEST(NANOPBTEST, JoinCommunity) { - uint8_t inBuffer[1000]; - const char *tmp = "6202107B12023A00"; - size_t len = parseHexString(inBuffer, sizeof(inBuffer), tmp); - bool status; - - /* Allocate space for the decoded message. */ - ic_nns_governance_pb_v1_ManageNeuron request = ic_nns_governance_pb_v1_ManageNeuron_init_zero; - - /* Create a stream that reads from the buffer. */ - pb_istream_t stream = pb_istream_from_buffer(inBuffer, len); - - /* Now we are ready to decode the message. */ - status = pb_decode(&stream, ic_nns_governance_pb_v1_ManageNeuron_fields, &request); - - EXPECT_EQ(status, true); - - EXPECT_EQ(request.command.configure.which_operation, 7); - - EXPECT_EQ(request.neuron_id_or_subaccount.neuron_id.id, 123); - - EXPECT_EQ(request.which_neuron_id_or_subaccount,12); - - } - - TEST(CBORParserTest, CombinedTX) { - uint8_t inBuffer[1000]; - - const char *tmp = "d9d9f7a167636f6e74656e74a46e696e67726573735f6578706972791b16bc685267142b8065706174687381824e726571756573745f737461747573582038b344ba26f15444b4f989078c952ce99b559d3eb59e829c5a463a33812e32546c726571756573745f747970656a726561645f73746174656673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; - uint32_t inBufferLen = parseHexString(inBuffer + 4, sizeof(inBuffer) - 4, tmp); - EXPECT_EQ(inBufferLen, 156); - MEMCPY(&inBuffer[0], &inBufferLen, 4); - - const char *tmp2 = "d9d9f7a167636f6e74656e74a66361726758320a0012050a0308904e1a0308904e2a220a20a2a794c66495083317e4be5197eb655b1e63015469d769e2338af3d3e3f3aa866b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16bc685084d14ec06b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; - uint32_t inBufferLen2 = parseHexString(inBuffer + 8 + inBufferLen, sizeof(inBuffer) - 4 - inBufferLen, tmp2); - EXPECT_EQ(inBufferLen2, 192); - MEMCPY(&inBuffer[4 + inBufferLen], &inBufferLen2, 4); -// char array[2000]; -// MEMZERO(array,2000); -// uint16_t total_len = 156 + 192 + 8; -// uint32_t strLen = array_to_hexstr(array, sizeof(array), inBuffer, 160); -// strLen += array_to_hexstr(array + strLen, sizeof(array) - strLen, inBuffer + 160, 200); -// EXPECT_EQ(strLen, 2*(156+192 + 8)); -// std::cout << array << std::endl; - parser_context_t ctx; - parser_tx_obj.special_transfer_type = normal_transaction; - auto err = parser_parse_combined(&ctx, inBuffer, inBufferLen + inBufferLen2 + 8); - EXPECT_EQ(err, parser_ok); - } + // TODO: Test disabled as internally it uses protobuf data for which + // the app is not longer compatible. + /* TEST(CBORParserTest, TokenTransfer) { */ + /* parser_tx_obj.special_transfer_type = normal_transaction; */ + /* uint8_t inBuffer[1000]; */ + /* const char *tmp = "d9d9f7a367636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e636550f5390d960c6e52f489155a4309da03da6e696e67726573735f6578706972791b1674c5e29ec9c2106673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000201016b6d6574686f645f6e616d656773656e645f70626361726758560a0012050a0308e8071a0308890122220a2001010101010101010101010101010101010101010101010101010101010101012a220a2035548ec29e9d85305850e87a2d2642fe7214ff4bb36334070deafc3345c3b1276d73656e6465725f7075626b657958583056301006072a8648ce3d020106052b8104000a03420004e1142e1fbc940344d9161709196bb8bd151f94379c48dd507ab99a0776109128b94b5303cf2b2d28e25a779da175b62f8a975599b20c63d5193202640576ec5e6a73656e6465725f7369675840de5bccbb0a0173c432cd58ea4495d4d1e122d6ce04e31dcf63217f3d3a9b73130dc9bbf3b10e61c8db8bf8800bb4649e27786e5bc9418838c95864be28487a6a"; */ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* } */ + /**/ + /* TEST(CBORParserTest, IncreaseNeuronTimer) { */ + /* parser_tx_obj.special_transfer_type = normal_transaction; */ + /* uint8_t inBuffer[1000]; */ + /**/ + /* const char *tmp = "d9d9f7a167636f6e74656e74a6636172675839620a10a7d18aaad3a2a2c6131a2b0a0508959aef3a12220a2068d518e2fd2be6566e62c36611b9794dfcbc04eb4227eefb73ab3c7a2d0ae5776b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b169bc8985c330d006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d8a4aa4ffc7bc5ccdcd5a7a3d10c9bb06741063b02c7e908a624f721d02"; */ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_ok); */ + /* } */ + + /* TEST(CBORParserTest, StakeTx) { */ + /* parser_tx_obj.special_transfer_type = neuron_stake_transaction; */ + /* uint8_t inBuffer[1000]; */ + /**/ + /* const char *tmp = "d9d9f7a167636f6e74656e74a663617267583e0a0a08f2d4a0eca697869f0812070a050880c2d72f1a0308904e2a220a20a8a1abecdb66f57eb6eba44c3b5f11a6c433fe932680a9519b064b80ca8794e16b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16985a582755f1806b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302"; */ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_ok); */ + /* parser_tx_obj.special_transfer_type = invalid; */ + /* } */ + + /* TEST(CBORParserTest, ClaimNeuron) { */ + /* parser_tx_obj.special_transfer_type = normal_transaction; */ + /* uint8_t inBuffer[1000]; */ + /**/ + /* const char *tmp = "d9d9f7a167636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e6365505833a6590c6d2b601e3a24557cfbb4336e696e67726573735f6578706972791b16bad506bb4ca0f06673656e646572581d2594dccb73ca0226c58299d4e21badbcee00d153deccb38fa20cd46e026b63616e69737465725f69644a000000000000000601016b6d6574686f645f6e616d656d636c61696d5f6e6575726f6e7363617267588b4449444c000171820130343139623066656363356639613164353162393033643262363234346430356531326134386661386233353731396538313262623635643966393035613365613965356137323362363537616665393136313236396431663134633164383034376530323230616461633434653731313630323531656364616662613064636535"; */ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_ok); */ + /* } */ + + /* TEST(CBORParserTest, Configure_JoinCommunityFund) { */ + /* parser_tx_obj.special_transfer_type = normal_transaction; */ + /* uint8_t inBuffer[1000]; */ + /**/ + /* const char *tmp = "d9d9f7a167636f6e74656e74a663617267486202107b12023a006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16ba67d2b864bf406b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; */ + /* auto inBufferLen = parseHexString(inBuffer, sizeof(inBuffer), tmp); */ + /**/ + /* parser_context_t ctx; */ + /* auto err = parser_parse(&ctx, inBuffer, inBufferLen); */ + /* EXPECT_EQ(err, parser_ok); */ + /**/ + /* err = parser_validate(&ctx); */ + /* EXPECT_EQ(err, parser_ok); */ + /* } */ + +/* TEST(CBORParserTest, CombinedTX) { */ +/* uint8_t inBuffer[1000]; */ +/**/ +/* const char *tmp = "d9d9f7a167636f6e74656e74a46e696e67726573735f6578706972791b16bc685267142b8065706174687381824e726571756573745f737461747573582038b344ba26f15444b4f989078c952ce99b559d3eb59e829c5a463a33812e32546c726571756573745f747970656a726561645f73746174656673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; */ +/* uint32_t inBufferLen = parseHexString(inBuffer + 4, sizeof(inBuffer) - 4, tmp); */ +/* EXPECT_EQ(inBufferLen, 156); */ +/* MEMCPY(&inBuffer[0], &inBufferLen, 4); */ +/**/ +/* const char *tmp2 = "d9d9f7a167636f6e74656e74a66361726758320a0012050a0308904e1a0308904e2a220a20a2a794c66495083317e4be5197eb655b1e63015469d769e2338af3d3e3f3aa866b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16bc685084d14ec06b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581dd899978f029508f4fa5fce3d2539de5aade6d229efcc458233deee7502"; */ +/* uint32_t inBufferLen2 = parseHexString(inBuffer + 8 + inBufferLen, sizeof(inBuffer) - 4 - inBufferLen, tmp2); */ +/* EXPECT_EQ(inBufferLen2, 192); */ +/* MEMCPY(&inBuffer[4 + inBufferLen], &inBufferLen2, 4); */ +/* // char array[2000]; */ +/* // MEMZERO(array,2000); */ +/* // uint16_t total_len = 156 + 192 + 8; */ +/* // uint32_t strLen = array_to_hexstr(array, sizeof(array), inBuffer, 160); */ +/* // strLen += array_to_hexstr(array + strLen, sizeof(array) - strLen, inBuffer + 160, 200); */ +/* // EXPECT_EQ(strLen, 2*(156+192 + 8)); */ +/* // std::cout << array << std::endl; */ +/* parser_context_t ctx; */ +/* parser_tx_obj.special_transfer_type = normal_transaction; */ +/* auto err = parser_parse_combined(&ctx, inBuffer, inBufferLen + inBufferLen2 + 8); */ +/* EXPECT_EQ(err, parser_ok); */ +/* } */ TEST(CBORParserTest, CombinedTXFail) { uint8_t inBuffer[1000]; diff --git a/tests/ui_tests.cpp b/tests/ui_tests.cpp index 67405595..4d04f5bf 100644 --- a/tests/ui_tests.cpp +++ b/tests/ui_tests.cpp @@ -19,7 +19,6 @@ using ::testing::TestWithParam; -class JsonTests_Phase1 : public JsonTests_Base {}; class JsonTests_Phase2 : public JsonTests_Base {}; class JsonTests_Candid_Send : public JsonTests_Base {}; class JsonTests_SNS_AddPermission : public JsonTests_Base {}; @@ -30,17 +29,6 @@ class JsonTests_SNS_SetDissolveDelay : public JsonTests_Base {}; class JsonTests_ICRC : public JsonTests_Base {}; class JsonTests_Deprecated : public JsonTests_Base {}; -INSTANTIATE_TEST_SUITE_P ( - Phase1, - JsonTests_Phase1, - ::testing::ValuesIn(GetJsonTestCases("manual.json")), - JsonTests_Phase1::PrintToStringParamName() -); - -// Parametric test using current runtime: -TEST_P(JsonTests_Phase1, Normal) { check_testcase(GetParam(), false); } - -TEST_P(JsonTests_Phase1, Expert) { check_testcase(GetParam(), true); } //////////////////// //////////////////// diff --git a/tests_zemu/package.json b/tests_zemu/package.json index bd6ac9bc..6a5cacfe 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -19,26 +19,26 @@ }, "dependencies": { "@zondax/ledger-icp": "link:../js", - "@zondax/zemu": "^0.44.2" + "@zondax/zemu": "^0.47.0" }, "devDependencies": { "@types/jest": "^29.2.3", "@types/ledgerhq__hw-transport": "^4.21.4", "@types/secp256k1": "^4.0.3", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", - "crypto-js": "4.1.1", + "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/parser": "^7.1.0", + "crypto-js": "4.2.0", "eslint": "^8.22.0", - "eslint-config-prettier": "^8.5.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jest": "^27.1.6", - "eslint-plugin-prettier": "^4.2.1", - "jest": "29.5.0", - "js-sha256": "0.9.0", - "prettier": "^2.7.1", + "eslint-plugin-prettier": "^5.1.3", + "jest": "29.7.0", + "js-sha256": "0.11.0", + "prettier": "^3.2.5", "secp256k1": "^5.0.0", "ts-jest": "^29.0.3", "ts-node": "^10.9.1", - "typescript": "^4.7.4" + "typescript": "^5.3.3" } } diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index 572fb5cf..b312d29b 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index 572fb5cf..b312d29b 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00000.png b/tests_zemu/snapshots/s-pb_add_hotkey/00000.png deleted file mode 100644 index eeaf96b9..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00001.png b/tests_zemu/snapshots/s-pb_add_hotkey/00001.png deleted file mode 100644 index 3778c3e0..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00002.png b/tests_zemu/snapshots/s-pb_add_hotkey/00002.png deleted file mode 100644 index e80ee8b9..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00003.png b/tests_zemu/snapshots/s-pb_add_hotkey/00003.png deleted file mode 100644 index 35a7a7c1..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00004.png b/tests_zemu/snapshots/s-pb_add_hotkey/00004.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_add_hotkey/00005.png b/tests_zemu/snapshots/s-pb_add_hotkey/00005.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_add_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_check_status/00000.png b/tests_zemu/snapshots/s-pb_check_status/00000.png deleted file mode 100644 index 9ea0710b..00000000 Binary files a/tests_zemu/snapshots/s-pb_check_status/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_check_status/00001.png b/tests_zemu/snapshots/s-pb_check_status/00001.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_check_status/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_check_status/00002.png b/tests_zemu/snapshots/s-pb_check_status/00002.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_check_status/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_claim_neurons/00000.png b/tests_zemu/snapshots/s-pb_claim_neurons/00000.png deleted file mode 100644 index 88080c02..00000000 Binary files a/tests_zemu/snapshots/s-pb_claim_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_claim_neurons/00001.png b/tests_zemu/snapshots/s-pb_claim_neurons/00001.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_claim_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_claim_neurons/00002.png b/tests_zemu/snapshots/s-pb_claim_neurons/00002.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_claim_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00000.png b/tests_zemu/snapshots/s-pb_disburse/00000.png deleted file mode 100644 index a7034fe3..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00001.png b/tests_zemu/snapshots/s-pb_disburse/00001.png deleted file mode 100644 index e8f4c4ea..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00002.png b/tests_zemu/snapshots/s-pb_disburse/00002.png deleted file mode 100644 index 24104fda..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00003.png b/tests_zemu/snapshots/s-pb_disburse/00003.png deleted file mode 100644 index 1735a762..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00004.png b/tests_zemu/snapshots/s-pb_disburse/00004.png deleted file mode 100644 index cc5dbc95..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00005.png b/tests_zemu/snapshots/s-pb_disburse/00005.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_disburse/00006.png b/tests_zemu/snapshots/s-pb_disburse/00006.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_disburse/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00000.png b/tests_zemu/snapshots/s-pb_follow/00000.png deleted file mode 100644 index 56ae887b..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00001.png b/tests_zemu/snapshots/s-pb_follow/00001.png deleted file mode 100644 index d945a16d..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00002.png b/tests_zemu/snapshots/s-pb_follow/00002.png deleted file mode 100644 index b5eb232d..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00003.png b/tests_zemu/snapshots/s-pb_follow/00003.png deleted file mode 100644 index 79197993..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00004.png b/tests_zemu/snapshots/s-pb_follow/00004.png deleted file mode 100644 index a53d2667..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00005.png b/tests_zemu/snapshots/s-pb_follow/00005.png deleted file mode 100644 index 72f4f338..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00006.png b/tests_zemu/snapshots/s-pb_follow/00006.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_follow/00007.png b/tests_zemu/snapshots/s-pb_follow/00007.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_follow/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00000.png b/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00000.png deleted file mode 100644 index 2ccc7f89..00000000 Binary files a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00001.png b/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00001.png deleted file mode 100644 index d945a16d..00000000 Binary files a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00002.png b/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00002.png deleted file mode 100644 index 5fd49b3e..00000000 Binary files a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00003.png b/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00003.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00004.png b/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00004.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_increase_dissolve_delay/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_join_community_fund/00000.png b/tests_zemu/snapshots/s-pb_join_community_fund/00000.png deleted file mode 100644 index 282a3862..00000000 Binary files a/tests_zemu/snapshots/s-pb_join_community_fund/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_join_community_fund/00001.png b/tests_zemu/snapshots/s-pb_join_community_fund/00001.png deleted file mode 100644 index d945a16d..00000000 Binary files a/tests_zemu/snapshots/s-pb_join_community_fund/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_join_community_fund/00002.png b/tests_zemu/snapshots/s-pb_join_community_fund/00002.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_join_community_fund/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_join_community_fund/00003.png b/tests_zemu/snapshots/s-pb_join_community_fund/00003.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_join_community_fund/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_list_neurons/00000.png b/tests_zemu/snapshots/s-pb_list_neurons/00000.png deleted file mode 100644 index 7eb62c78..00000000 Binary files a/tests_zemu/snapshots/s-pb_list_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_list_neurons/00001.png b/tests_zemu/snapshots/s-pb_list_neurons/00001.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_list_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_list_neurons/00002.png b/tests_zemu/snapshots/s-pb_list_neurons/00002.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_list_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00000.png b/tests_zemu/snapshots/s-pb_register_vote/00000.png deleted file mode 100644 index 96c47158..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00001.png b/tests_zemu/snapshots/s-pb_register_vote/00001.png deleted file mode 100644 index fa2bd922..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00002.png b/tests_zemu/snapshots/s-pb_register_vote/00002.png deleted file mode 100644 index dea9390b..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00003.png b/tests_zemu/snapshots/s-pb_register_vote/00003.png deleted file mode 100644 index aac72e60..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00004.png b/tests_zemu/snapshots/s-pb_register_vote/00004.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_register_vote/00005.png b/tests_zemu/snapshots/s-pb_register_vote/00005.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_register_vote/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00000.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00000.png deleted file mode 100644 index 25b3c9a7..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00001.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00001.png deleted file mode 100644 index 3778c3e0..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00002.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00002.png deleted file mode 100644 index e80ee8b9..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00003.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00003.png deleted file mode 100644 index 35a7a7c1..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00004.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00004.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_remove_hotkey/00005.png b/tests_zemu/snapshots/s-pb_remove_hotkey/00005.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_remove_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00000.png b/tests_zemu/snapshots/s-pb_sign_update_call/00000.png deleted file mode 100644 index f43ff1cc..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00001.png b/tests_zemu/snapshots/s-pb_sign_update_call/00001.png deleted file mode 100644 index ef1b54f3..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00002.png b/tests_zemu/snapshots/s-pb_sign_update_call/00002.png deleted file mode 100644 index 64051ca9..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00003.png b/tests_zemu/snapshots/s-pb_sign_update_call/00003.png deleted file mode 100644 index 1b169b4f..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00004.png b/tests_zemu/snapshots/s-pb_sign_update_call/00004.png deleted file mode 100644 index c687e272..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00005.png b/tests_zemu/snapshots/s-pb_sign_update_call/00005.png deleted file mode 100644 index 092a724a..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00006.png b/tests_zemu/snapshots/s-pb_sign_update_call/00006.png deleted file mode 100644 index d53a8f4c..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00007.png b/tests_zemu/snapshots/s-pb_sign_update_call/00007.png deleted file mode 100644 index 9404c03a..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00008.png b/tests_zemu/snapshots/s-pb_sign_update_call/00008.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_sign_update_call/00009.png b/tests_zemu/snapshots/s-pb_sign_update_call/00009.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_sign_update_call/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_spawn_neuron/00000.png b/tests_zemu/snapshots/s-pb_spawn_neuron/00000.png deleted file mode 100644 index a26357f3..00000000 Binary files a/tests_zemu/snapshots/s-pb_spawn_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_spawn_neuron/00001.png b/tests_zemu/snapshots/s-pb_spawn_neuron/00001.png deleted file mode 100644 index 858d46ae..00000000 Binary files a/tests_zemu/snapshots/s-pb_spawn_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_spawn_neuron/00002.png b/tests_zemu/snapshots/s-pb_spawn_neuron/00002.png deleted file mode 100644 index f94d0a53..00000000 Binary files a/tests_zemu/snapshots/s-pb_spawn_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_spawn_neuron/00003.png b/tests_zemu/snapshots/s-pb_spawn_neuron/00003.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_spawn_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_spawn_neuron/00004.png b/tests_zemu/snapshots/s-pb_spawn_neuron/00004.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_spawn_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00000.png b/tests_zemu/snapshots/s-pb_stake_neuron/00000.png deleted file mode 100644 index c0461ffa..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00001.png b/tests_zemu/snapshots/s-pb_stake_neuron/00001.png deleted file mode 100644 index ef1b54f3..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00002.png b/tests_zemu/snapshots/s-pb_stake_neuron/00002.png deleted file mode 100644 index 64051ca9..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00003.png b/tests_zemu/snapshots/s-pb_stake_neuron/00003.png deleted file mode 100644 index 8c0c73bf..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00004.png b/tests_zemu/snapshots/s-pb_stake_neuron/00004.png deleted file mode 100644 index d53a8f4c..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00005.png b/tests_zemu/snapshots/s-pb_stake_neuron/00005.png deleted file mode 100644 index 4af2a173..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00006.png b/tests_zemu/snapshots/s-pb_stake_neuron/00006.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stake_neuron/00007.png b/tests_zemu/snapshots/s-pb_stake_neuron/00007.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_stake_neuron/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_start_dissolve/00000.png b/tests_zemu/snapshots/s-pb_start_dissolve/00000.png deleted file mode 100644 index 546ffb33..00000000 Binary files a/tests_zemu/snapshots/s-pb_start_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_start_dissolve/00001.png b/tests_zemu/snapshots/s-pb_start_dissolve/00001.png deleted file mode 100644 index 87f126f0..00000000 Binary files a/tests_zemu/snapshots/s-pb_start_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_start_dissolve/00002.png b/tests_zemu/snapshots/s-pb_start_dissolve/00002.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_start_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_start_dissolve/00003.png b/tests_zemu/snapshots/s-pb_start_dissolve/00003.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_start_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stop_dissolve/00000.png b/tests_zemu/snapshots/s-pb_stop_dissolve/00000.png deleted file mode 100644 index f9c633f8..00000000 Binary files a/tests_zemu/snapshots/s-pb_stop_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stop_dissolve/00001.png b/tests_zemu/snapshots/s-pb_stop_dissolve/00001.png deleted file mode 100644 index 87f126f0..00000000 Binary files a/tests_zemu/snapshots/s-pb_stop_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stop_dissolve/00002.png b/tests_zemu/snapshots/s-pb_stop_dissolve/00002.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-pb_stop_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-pb_stop_dissolve/00003.png b/tests_zemu/snapshots/s-pb_stop_dissolve/00003.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-pb_stop_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00000.png b/tests_zemu/snapshots/s-sign_basic_expert/00000.png deleted file mode 100644 index f43ff1cc..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00001.png b/tests_zemu/snapshots/s-sign_basic_expert/00001.png deleted file mode 100644 index e3a75b9e..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00002.png b/tests_zemu/snapshots/s-sign_basic_expert/00002.png deleted file mode 100644 index f1fced3b..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00003.png b/tests_zemu/snapshots/s-sign_basic_expert/00003.png deleted file mode 100644 index a5dbb35d..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00004.png b/tests_zemu/snapshots/s-sign_basic_expert/00004.png deleted file mode 100644 index e741e9c8..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00005.png b/tests_zemu/snapshots/s-sign_basic_expert/00005.png deleted file mode 100644 index 38f39e68..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00006.png b/tests_zemu/snapshots/s-sign_basic_expert/00006.png deleted file mode 100644 index ff658300..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00007.png b/tests_zemu/snapshots/s-sign_basic_expert/00007.png deleted file mode 100644 index e3e0efd1..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00008.png b/tests_zemu/snapshots/s-sign_basic_expert/00008.png deleted file mode 100644 index bf388d43..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00009.png b/tests_zemu/snapshots/s-sign_basic_expert/00009.png deleted file mode 100644 index 1e9bf193..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00010.png b/tests_zemu/snapshots/s-sign_basic_expert/00010.png deleted file mode 100644 index 26b39bbb..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00011.png b/tests_zemu/snapshots/s-sign_basic_expert/00011.png deleted file mode 100644 index 9404c03a..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00011.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00012.png b/tests_zemu/snapshots/s-sign_basic_expert/00012.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00012.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_expert/00013.png b/tests_zemu/snapshots/s-sign_basic_expert/00013.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_expert/00013.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00000.png b/tests_zemu/snapshots/s-sign_basic_normal/00000.png deleted file mode 100644 index f43ff1cc..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00001.png b/tests_zemu/snapshots/s-sign_basic_normal/00001.png deleted file mode 100644 index 38f39e68..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00002.png b/tests_zemu/snapshots/s-sign_basic_normal/00002.png deleted file mode 100644 index ff658300..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00003.png b/tests_zemu/snapshots/s-sign_basic_normal/00003.png deleted file mode 100644 index e3e0efd1..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00004.png b/tests_zemu/snapshots/s-sign_basic_normal/00004.png deleted file mode 100644 index bf388d43..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00005.png b/tests_zemu/snapshots/s-sign_basic_normal/00005.png deleted file mode 100644 index 1e9bf193..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00006.png b/tests_zemu/snapshots/s-sign_basic_normal/00006.png deleted file mode 100644 index 26b39bbb..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00007.png b/tests_zemu/snapshots/s-sign_basic_normal/00007.png deleted file mode 100644 index 9404c03a..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00008.png b/tests_zemu/snapshots/s-sign_basic_normal/00008.png deleted file mode 100644 index 006c26ab..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign_basic_normal/00009.png b/tests_zemu/snapshots/s-sign_basic_normal/00009.png deleted file mode 100644 index b6270f13..00000000 Binary files a/tests_zemu/snapshots/s-sign_basic_normal/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00001.png b/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00001.png index e473c74b..7f54ba24 100644 Binary files a/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00001.png and b/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00001.png differ diff --git a/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00003.png b/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00003.png index 6743db0d..7847be1b 100644 Binary files a/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00003.png and b/tests_zemu/snapshots/sp-candid_auto_stake_maturity/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_disburse/00003.png b/tests_zemu/snapshots/sp-candid_disburse/00003.png index dca8aae3..27ac1752 100644 Binary files a/tests_zemu/snapshots/sp-candid_disburse/00003.png and b/tests_zemu/snapshots/sp-candid_disburse/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_disburse/00004.png b/tests_zemu/snapshots/sp-candid_disburse/00004.png index 07c96a89..54dcc00c 100644 Binary files a/tests_zemu/snapshots/sp-candid_disburse/00004.png and b/tests_zemu/snapshots/sp-candid_disburse/00004.png differ diff --git a/tests_zemu/snapshots/sp-candid_disburse/00005.png b/tests_zemu/snapshots/sp-candid_disburse/00005.png index 56c0c614..6110245f 100644 Binary files a/tests_zemu/snapshots/sp-candid_disburse/00005.png and b/tests_zemu/snapshots/sp-candid_disburse/00005.png differ diff --git a/tests_zemu/snapshots/sp-candid_follow/00003.png b/tests_zemu/snapshots/sp-candid_follow/00003.png index d1a07a70..2d26ae5e 100644 Binary files a/tests_zemu/snapshots/sp-candid_follow/00003.png and b/tests_zemu/snapshots/sp-candid_follow/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_follow/00004.png b/tests_zemu/snapshots/sp-candid_follow/00004.png index c0849e10..f5a6e5aa 100644 Binary files a/tests_zemu/snapshots/sp-candid_follow/00004.png and b/tests_zemu/snapshots/sp-candid_follow/00004.png differ diff --git a/tests_zemu/snapshots/sp-candid_follow/00005.png b/tests_zemu/snapshots/sp-candid_follow/00005.png index ad1a2321..498d0234 100644 Binary files a/tests_zemu/snapshots/sp-candid_follow/00005.png and b/tests_zemu/snapshots/sp-candid_follow/00005.png differ diff --git a/tests_zemu/snapshots/sp-candid_follow/00006.png b/tests_zemu/snapshots/sp-candid_follow/00006.png index 06931f6d..e9e83817 100644 Binary files a/tests_zemu/snapshots/sp-candid_follow/00006.png and b/tests_zemu/snapshots/sp-candid_follow/00006.png differ diff --git a/tests_zemu/snapshots/sp-candid_list_neurons/00001.png b/tests_zemu/snapshots/sp-candid_list_neurons/00001.png index c436da5a..5d2a4a1f 100644 Binary files a/tests_zemu/snapshots/sp-candid_list_neurons/00001.png and b/tests_zemu/snapshots/sp-candid_list_neurons/00001.png differ diff --git a/tests_zemu/snapshots/sp-candid_merge_neuron/00003.png b/tests_zemu/snapshots/sp-candid_merge_neuron/00003.png index b60d7e3e..288a177b 100644 Binary files a/tests_zemu/snapshots/sp-candid_merge_neuron/00003.png and b/tests_zemu/snapshots/sp-candid_merge_neuron/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_send_icp/00002.png b/tests_zemu/snapshots/sp-candid_send_icp/00002.png index f8eb5edb..9abb0616 100644 Binary files a/tests_zemu/snapshots/sp-candid_send_icp/00002.png and b/tests_zemu/snapshots/sp-candid_send_icp/00002.png differ diff --git a/tests_zemu/snapshots/sp-candid_send_icp/00003.png b/tests_zemu/snapshots/sp-candid_send_icp/00003.png index 498b7516..872adcf3 100644 Binary files a/tests_zemu/snapshots/sp-candid_send_icp/00003.png and b/tests_zemu/snapshots/sp-candid_send_icp/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_send_icp/00004.png b/tests_zemu/snapshots/sp-candid_send_icp/00004.png index d66076d5..f2f42cdd 100644 Binary files a/tests_zemu/snapshots/sp-candid_send_icp/00004.png and b/tests_zemu/snapshots/sp-candid_send_icp/00004.png differ diff --git a/tests_zemu/snapshots/sp-candid_send_icp/00005.png b/tests_zemu/snapshots/sp-candid_send_icp/00005.png index 10ec551a..a02ad65e 100644 Binary files a/tests_zemu/snapshots/sp-candid_send_icp/00005.png and b/tests_zemu/snapshots/sp-candid_send_icp/00005.png differ diff --git a/tests_zemu/snapshots/sp-candid_send_icp/00006.png b/tests_zemu/snapshots/sp-candid_send_icp/00006.png index b6bbd033..57c10fc3 100644 Binary files a/tests_zemu/snapshots/sp-candid_send_icp/00006.png and b/tests_zemu/snapshots/sp-candid_send_icp/00006.png differ diff --git a/tests_zemu/snapshots/sp-candid_set_dissolve_delay/00001.png b/tests_zemu/snapshots/sp-candid_set_dissolve_delay/00001.png index a8d9d63e..9417ed69 100644 Binary files a/tests_zemu/snapshots/sp-candid_set_dissolve_delay/00001.png and b/tests_zemu/snapshots/sp-candid_set_dissolve_delay/00001.png differ diff --git a/tests_zemu/snapshots/sp-candid_spawn_neuron/00003.png b/tests_zemu/snapshots/sp-candid_spawn_neuron/00003.png index 28e1514b..70827c96 100644 Binary files a/tests_zemu/snapshots/sp-candid_spawn_neuron/00003.png and b/tests_zemu/snapshots/sp-candid_spawn_neuron/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_split_neuron/00001.png b/tests_zemu/snapshots/sp-candid_split_neuron/00001.png index 73c3b2e9..e072195e 100644 Binary files a/tests_zemu/snapshots/sp-candid_split_neuron/00001.png and b/tests_zemu/snapshots/sp-candid_split_neuron/00001.png differ diff --git a/tests_zemu/snapshots/sp-candid_split_neuron/00003.png b/tests_zemu/snapshots/sp-candid_split_neuron/00003.png index 77f37bab..1da9ce14 100644 Binary files a/tests_zemu/snapshots/sp-candid_split_neuron/00003.png and b/tests_zemu/snapshots/sp-candid_split_neuron/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00002.png b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00002.png index 99499795..c9269b6f 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00002.png and b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00002.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00003.png b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00003.png index 5b7cc638..66e009be 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00003.png and b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00004.png b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00004.png index f9eb7673..98b4504e 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00004.png and b/tests_zemu/snapshots/sp-candid_stake_icrc_expert/00004.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_maturity/00003.png b/tests_zemu/snapshots/sp-candid_stake_maturity/00003.png index 15faa7cf..0ee14f4a 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_maturity/00003.png and b/tests_zemu/snapshots/sp-candid_stake_maturity/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00002.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00002.png index 5b7d0c4d..d0010466 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00002.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00002.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00003.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00003.png index 2664a3da..b0579ca6 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00003.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00004.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00004.png index 5478b93e..ccf3ccb9 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00004.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00004.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00005.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00005.png index f68eabd5..b7879476 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00005.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00005.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00006.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00006.png index f8eb5edb..9abb0616 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00006.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00006.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00007.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00007.png index 498b7516..872adcf3 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00007.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00007.png differ diff --git a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00008.png b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00008.png index b6bbd033..57c10fc3 100644 Binary files a/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00008.png and b/tests_zemu/snapshots/sp-candid_stake_neuron_expert/00008.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00002.png b/tests_zemu/snapshots/sp-icrc_transfer/00002.png index 09d359c6..7e7543f8 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00002.png and b/tests_zemu/snapshots/sp-icrc_transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00003.png b/tests_zemu/snapshots/sp-icrc_transfer/00003.png index 699c3c4f..bdf7f9eb 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00003.png and b/tests_zemu/snapshots/sp-icrc_transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00004.png b/tests_zemu/snapshots/sp-icrc_transfer/00004.png index c78324fe..e0eebadd 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00004.png and b/tests_zemu/snapshots/sp-icrc_transfer/00004.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00005.png b/tests_zemu/snapshots/sp-icrc_transfer/00005.png index 9ff1369c..1eec87d0 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00005.png and b/tests_zemu/snapshots/sp-icrc_transfer/00005.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00006.png b/tests_zemu/snapshots/sp-icrc_transfer/00006.png index 9ec16889..9ae7153f 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00006.png and b/tests_zemu/snapshots/sp-icrc_transfer/00006.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00007.png b/tests_zemu/snapshots/sp-icrc_transfer/00007.png index 9492c68d..9652ab9d 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00007.png and b/tests_zemu/snapshots/sp-icrc_transfer/00007.png differ diff --git a/tests_zemu/snapshots/sp-icrc_transfer/00008.png b/tests_zemu/snapshots/sp-icrc_transfer/00008.png index f9eb7673..98b4504e 100644 Binary files a/tests_zemu/snapshots/sp-icrc_transfer/00008.png and b/tests_zemu/snapshots/sp-icrc_transfer/00008.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00001.png b/tests_zemu/snapshots/sp-mainmenu/00001.png index e10e0049..8472e5d9 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00001.png and b/tests_zemu/snapshots/sp-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00002.png b/tests_zemu/snapshots/sp-mainmenu/00002.png index 7e236da6..f7921677 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00002.png and b/tests_zemu/snapshots/sp-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00003.png b/tests_zemu/snapshots/sp-mainmenu/00003.png index e10e0049..8472e5d9 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00003.png and b/tests_zemu/snapshots/sp-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index c8b61779..f4f21279 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index c8b61779..f4f21279 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00011.png b/tests_zemu/snapshots/sp-mainmenu/00011.png index e10e0049..8472e5d9 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00011.png and b/tests_zemu/snapshots/sp-mainmenu/00011.png differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00000.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00001.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00001.png deleted file mode 100644 index 5a1d3274..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00002.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00002.png deleted file mode 100644 index cf3affa5..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00003.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00003.png deleted file mode 100644 index 0f81cda7..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00004.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00004.png deleted file mode 100644 index fc58dfb6..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00005.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_add_hotkey/00006.png b/tests_zemu/snapshots/sp-pb_add_hotkey/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_add_hotkey/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_check_status/00000.png b/tests_zemu/snapshots/sp-pb_check_status/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_check_status/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_check_status/00001.png b/tests_zemu/snapshots/sp-pb_check_status/00001.png deleted file mode 100644 index 030585c6..00000000 Binary files a/tests_zemu/snapshots/sp-pb_check_status/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_check_status/00002.png b/tests_zemu/snapshots/sp-pb_check_status/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_check_status/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_check_status/00003.png b/tests_zemu/snapshots/sp-pb_check_status/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_check_status/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_claim_neurons/00000.png b/tests_zemu/snapshots/sp-pb_claim_neurons/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_claim_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_claim_neurons/00001.png b/tests_zemu/snapshots/sp-pb_claim_neurons/00001.png deleted file mode 100644 index 3006c983..00000000 Binary files a/tests_zemu/snapshots/sp-pb_claim_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_claim_neurons/00002.png b/tests_zemu/snapshots/sp-pb_claim_neurons/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_claim_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_claim_neurons/00003.png b/tests_zemu/snapshots/sp-pb_claim_neurons/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_claim_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00000.png b/tests_zemu/snapshots/sp-pb_disburse/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00001.png b/tests_zemu/snapshots/sp-pb_disburse/00001.png deleted file mode 100644 index d3d8670a..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00002.png b/tests_zemu/snapshots/sp-pb_disburse/00002.png deleted file mode 100644 index 1e2c834c..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00003.png b/tests_zemu/snapshots/sp-pb_disburse/00003.png deleted file mode 100644 index b872e9c1..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00004.png b/tests_zemu/snapshots/sp-pb_disburse/00004.png deleted file mode 100644 index 17a60d04..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00005.png b/tests_zemu/snapshots/sp-pb_disburse/00005.png deleted file mode 100644 index d89c0380..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00006.png b/tests_zemu/snapshots/sp-pb_disburse/00006.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_disburse/00007.png b/tests_zemu/snapshots/sp-pb_disburse/00007.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_disburse/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00000.png b/tests_zemu/snapshots/sp-pb_follow/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00001.png b/tests_zemu/snapshots/sp-pb_follow/00001.png deleted file mode 100644 index 0541da93..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00002.png b/tests_zemu/snapshots/sp-pb_follow/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00003.png b/tests_zemu/snapshots/sp-pb_follow/00003.png deleted file mode 100644 index 5d902631..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00004.png b/tests_zemu/snapshots/sp-pb_follow/00004.png deleted file mode 100644 index f22b053b..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00005.png b/tests_zemu/snapshots/sp-pb_follow/00005.png deleted file mode 100644 index 58f4dc38..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00006.png b/tests_zemu/snapshots/sp-pb_follow/00006.png deleted file mode 100644 index e95f1f2f..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00007.png b/tests_zemu/snapshots/sp-pb_follow/00007.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_follow/00008.png b/tests_zemu/snapshots/sp-pb_follow/00008.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_follow/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00000.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00001.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00001.png deleted file mode 100644 index 814335b0..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00002.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00003.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00003.png deleted file mode 100644 index f8b98202..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00004.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00004.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00005.png b/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00005.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_increase_dissolve_delay/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_join_community_fund/00000.png b/tests_zemu/snapshots/sp-pb_join_community_fund/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_join_community_fund/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_join_community_fund/00001.png b/tests_zemu/snapshots/sp-pb_join_community_fund/00001.png deleted file mode 100644 index 890d0a4c..00000000 Binary files a/tests_zemu/snapshots/sp-pb_join_community_fund/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_join_community_fund/00002.png b/tests_zemu/snapshots/sp-pb_join_community_fund/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/sp-pb_join_community_fund/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_join_community_fund/00003.png b/tests_zemu/snapshots/sp-pb_join_community_fund/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_join_community_fund/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_join_community_fund/00004.png b/tests_zemu/snapshots/sp-pb_join_community_fund/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_join_community_fund/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_list_neurons/00000.png b/tests_zemu/snapshots/sp-pb_list_neurons/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_list_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_list_neurons/00001.png b/tests_zemu/snapshots/sp-pb_list_neurons/00001.png deleted file mode 100644 index c436da5a..00000000 Binary files a/tests_zemu/snapshots/sp-pb_list_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_list_neurons/00002.png b/tests_zemu/snapshots/sp-pb_list_neurons/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_list_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_list_neurons/00003.png b/tests_zemu/snapshots/sp-pb_list_neurons/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_list_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00000.png b/tests_zemu/snapshots/sp-pb_register_vote/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00001.png b/tests_zemu/snapshots/sp-pb_register_vote/00001.png deleted file mode 100644 index b497a360..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00002.png b/tests_zemu/snapshots/sp-pb_register_vote/00002.png deleted file mode 100644 index fba7dfea..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00003.png b/tests_zemu/snapshots/sp-pb_register_vote/00003.png deleted file mode 100644 index 1e96ed22..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00004.png b/tests_zemu/snapshots/sp-pb_register_vote/00004.png deleted file mode 100644 index 0a0b3ec1..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00005.png b/tests_zemu/snapshots/sp-pb_register_vote/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_register_vote/00006.png b/tests_zemu/snapshots/sp-pb_register_vote/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_register_vote/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00000.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00001.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00001.png deleted file mode 100644 index 0d62dfcc..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00002.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00002.png deleted file mode 100644 index cf3affa5..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00003.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00003.png deleted file mode 100644 index 0f81cda7..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00004.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00004.png deleted file mode 100644 index fc58dfb6..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00005.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_remove_hotkey/00006.png b/tests_zemu/snapshots/sp-pb_remove_hotkey/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_remove_hotkey/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00000.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00001.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00002.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00002.png deleted file mode 100644 index e0acb147..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00003.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00003.png deleted file mode 100644 index 1d2c762d..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00004.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00004.png deleted file mode 100644 index f4fcaaae..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00005.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00005.png deleted file mode 100644 index e052fdc8..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00006.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00006.png deleted file mode 100644 index b835239b..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00007.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00007.png deleted file mode 100644 index afeeff26..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00008.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00008.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00009.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00009.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_sign_update_call/00010.png b/tests_zemu/snapshots/sp-pb_sign_update_call/00010.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_sign_update_call/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00000.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00001.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00001.png deleted file mode 100644 index 827476c4..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00002.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00002.png deleted file mode 100644 index 16c4d7ba..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00003.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00003.png deleted file mode 100644 index 344a1fea..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00004.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00004.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_spawn_neuron/00005.png b/tests_zemu/snapshots/sp-pb_spawn_neuron/00005.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_spawn_neuron/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00000.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00001.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00001.png deleted file mode 100644 index efc4171b..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00002.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00002.png deleted file mode 100644 index e0acb147..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00003.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00003.png deleted file mode 100644 index 1d2c762d..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00004.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00004.png deleted file mode 100644 index 77f37bab..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00005.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00005.png deleted file mode 100644 index afeeff26..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00006.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00006.png deleted file mode 100644 index 829b1e02..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00007.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00007.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stake_neuron/00008.png b/tests_zemu/snapshots/sp-pb_stake_neuron/00008.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stake_neuron/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_start_dissolve/00000.png b/tests_zemu/snapshots/sp-pb_start_dissolve/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_start_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_start_dissolve/00001.png b/tests_zemu/snapshots/sp-pb_start_dissolve/00001.png deleted file mode 100644 index 1d8c7a8b..00000000 Binary files a/tests_zemu/snapshots/sp-pb_start_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_start_dissolve/00002.png b/tests_zemu/snapshots/sp-pb_start_dissolve/00002.png deleted file mode 100644 index 4d4f4494..00000000 Binary files a/tests_zemu/snapshots/sp-pb_start_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_start_dissolve/00003.png b/tests_zemu/snapshots/sp-pb_start_dissolve/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_start_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_start_dissolve/00004.png b/tests_zemu/snapshots/sp-pb_start_dissolve/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_start_dissolve/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stop_dissolve/00000.png b/tests_zemu/snapshots/sp-pb_stop_dissolve/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stop_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stop_dissolve/00001.png b/tests_zemu/snapshots/sp-pb_stop_dissolve/00001.png deleted file mode 100644 index 4c841e1d..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stop_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stop_dissolve/00002.png b/tests_zemu/snapshots/sp-pb_stop_dissolve/00002.png deleted file mode 100644 index 4d4f4494..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stop_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stop_dissolve/00003.png b/tests_zemu/snapshots/sp-pb_stop_dissolve/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stop_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-pb_stop_dissolve/00004.png b/tests_zemu/snapshots/sp-pb_stop_dissolve/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-pb_stop_dissolve/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-show_address/00001.png b/tests_zemu/snapshots/sp-show_address/00001.png index d1de3f78..6e991bee 100644 Binary files a/tests_zemu/snapshots/sp-show_address/00001.png and b/tests_zemu/snapshots/sp-show_address/00001.png differ diff --git a/tests_zemu/snapshots/sp-show_address/00002.png b/tests_zemu/snapshots/sp-show_address/00002.png index 8a15042e..50e57c82 100644 Binary files a/tests_zemu/snapshots/sp-show_address/00002.png and b/tests_zemu/snapshots/sp-show_address/00002.png differ diff --git a/tests_zemu/snapshots/sp-show_address/00003.png b/tests_zemu/snapshots/sp-show_address/00003.png index 0f81cda7..54c6f669 100644 Binary files a/tests_zemu/snapshots/sp-show_address/00003.png and b/tests_zemu/snapshots/sp-show_address/00003.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00001.png b/tests_zemu/snapshots/sp-show_address_reject/00001.png index d1de3f78..6e991bee 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00001.png and b/tests_zemu/snapshots/sp-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00002.png b/tests_zemu/snapshots/sp-show_address_reject/00002.png index 8a15042e..50e57c82 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00002.png and b/tests_zemu/snapshots/sp-show_address_reject/00002.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00003.png b/tests_zemu/snapshots/sp-show_address_reject/00003.png index 0f81cda7..54c6f669 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00003.png and b/tests_zemu/snapshots/sp-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00007.png b/tests_zemu/snapshots/sp-show_address_reject/00007.png index d9b5efc5..de8a2912 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00007.png and b/tests_zemu/snapshots/sp-show_address_reject/00007.png differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00000.png b/tests_zemu/snapshots/sp-sign_basic_expert/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00001.png b/tests_zemu/snapshots/sp-sign_basic_expert/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00002.png b/tests_zemu/snapshots/sp-sign_basic_expert/00002.png deleted file mode 100644 index 5b7d0c4d..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00003.png b/tests_zemu/snapshots/sp-sign_basic_expert/00003.png deleted file mode 100644 index 2664a3da..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00004.png b/tests_zemu/snapshots/sp-sign_basic_expert/00004.png deleted file mode 100644 index 21165c4e..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00005.png b/tests_zemu/snapshots/sp-sign_basic_expert/00005.png deleted file mode 100644 index 0a5d22b0..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00006.png b/tests_zemu/snapshots/sp-sign_basic_expert/00006.png deleted file mode 100644 index 00bb8c3d..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00007.png b/tests_zemu/snapshots/sp-sign_basic_expert/00007.png deleted file mode 100644 index dc6ab11d..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00008.png b/tests_zemu/snapshots/sp-sign_basic_expert/00008.png deleted file mode 100644 index e204fa27..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00009.png b/tests_zemu/snapshots/sp-sign_basic_expert/00009.png deleted file mode 100644 index 88ef26d3..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00010.png b/tests_zemu/snapshots/sp-sign_basic_expert/00010.png deleted file mode 100644 index 8fe1f906..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00011.png b/tests_zemu/snapshots/sp-sign_basic_expert/00011.png deleted file mode 100644 index 0e4a6001..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00011.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00012.png b/tests_zemu/snapshots/sp-sign_basic_expert/00012.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00012.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00013.png b/tests_zemu/snapshots/sp-sign_basic_expert/00013.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00013.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_expert/00014.png b/tests_zemu/snapshots/sp-sign_basic_expert/00014.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_expert/00014.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00000.png b/tests_zemu/snapshots/sp-sign_basic_normal/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00001.png b/tests_zemu/snapshots/sp-sign_basic_normal/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00002.png b/tests_zemu/snapshots/sp-sign_basic_normal/00002.png deleted file mode 100644 index 00bb8c3d..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00003.png b/tests_zemu/snapshots/sp-sign_basic_normal/00003.png deleted file mode 100644 index dc6ab11d..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00004.png b/tests_zemu/snapshots/sp-sign_basic_normal/00004.png deleted file mode 100644 index e204fa27..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00005.png b/tests_zemu/snapshots/sp-sign_basic_normal/00005.png deleted file mode 100644 index 88ef26d3..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00006.png b/tests_zemu/snapshots/sp-sign_basic_normal/00006.png deleted file mode 100644 index 8fe1f906..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00007.png b/tests_zemu/snapshots/sp-sign_basic_normal/00007.png deleted file mode 100644 index 0e4a6001..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00008.png b/tests_zemu/snapshots/sp-sign_basic_normal/00008.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00009.png b/tests_zemu/snapshots/sp-sign_basic_normal/00009.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign_basic_normal/00010.png b/tests_zemu/snapshots/sp-sign_basic_normal/00010.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/sp-sign_basic_normal/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sns_add_permissions/00003.png b/tests_zemu/snapshots/sp-sns_add_permissions/00003.png index 4c04b100..ec74130d 100644 Binary files a/tests_zemu/snapshots/sp-sns_add_permissions/00003.png and b/tests_zemu/snapshots/sp-sns_add_permissions/00003.png differ diff --git a/tests_zemu/snapshots/sp-sns_add_permissions/00005.png b/tests_zemu/snapshots/sp-sns_add_permissions/00005.png index 977e35a7..9315690f 100644 Binary files a/tests_zemu/snapshots/sp-sns_add_permissions/00005.png and b/tests_zemu/snapshots/sp-sns_add_permissions/00005.png differ diff --git a/tests_zemu/snapshots/sp-sns_disburse/00003.png b/tests_zemu/snapshots/sp-sns_disburse/00003.png index 4c04b100..ec74130d 100644 Binary files a/tests_zemu/snapshots/sp-sns_disburse/00003.png and b/tests_zemu/snapshots/sp-sns_disburse/00003.png differ diff --git a/tests_zemu/snapshots/sp-sns_disburse/00005.png b/tests_zemu/snapshots/sp-sns_disburse/00005.png index 5032b738..c30eb711 100644 Binary files a/tests_zemu/snapshots/sp-sns_disburse/00005.png and b/tests_zemu/snapshots/sp-sns_disburse/00005.png differ diff --git a/tests_zemu/snapshots/sp-sns_disburse/00006.png b/tests_zemu/snapshots/sp-sns_disburse/00006.png index 3bd7c37d..347f17e9 100644 Binary files a/tests_zemu/snapshots/sp-sns_disburse/00006.png and b/tests_zemu/snapshots/sp-sns_disburse/00006.png differ diff --git a/tests_zemu/snapshots/sp-sns_disburse/00007.png b/tests_zemu/snapshots/sp-sns_disburse/00007.png index ac7bb7c0..957ffe01 100644 Binary files a/tests_zemu/snapshots/sp-sns_disburse/00007.png and b/tests_zemu/snapshots/sp-sns_disburse/00007.png differ diff --git a/tests_zemu/snapshots/sp-sns_remove_permissions/00005.png b/tests_zemu/snapshots/sp-sns_remove_permissions/00005.png index 977e35a7..9315690f 100644 Binary files a/tests_zemu/snapshots/sp-sns_remove_permissions/00005.png and b/tests_zemu/snapshots/sp-sns_remove_permissions/00005.png differ diff --git a/tests_zemu/snapshots/sp-sns_stake_maturity/00005.png b/tests_zemu/snapshots/sp-sns_stake_maturity/00005.png index 7036618f..b62f7046 100644 Binary files a/tests_zemu/snapshots/sp-sns_stake_maturity/00005.png and b/tests_zemu/snapshots/sp-sns_stake_maturity/00005.png differ diff --git a/tests_zemu/snapshots/sp-sns_start_dissolve/00001.png b/tests_zemu/snapshots/sp-sns_start_dissolve/00001.png index 1d8c7a8b..df8203cb 100644 Binary files a/tests_zemu/snapshots/sp-sns_start_dissolve/00001.png and b/tests_zemu/snapshots/sp-sns_start_dissolve/00001.png differ diff --git a/tests_zemu/snapshots/sp-sns_stop_dissolve/00003.png b/tests_zemu/snapshots/sp-sns_stop_dissolve/00003.png index 4c04b100..ec74130d 100644 Binary files a/tests_zemu/snapshots/sp-sns_stop_dissolve/00003.png and b/tests_zemu/snapshots/sp-sns_stop_dissolve/00003.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index ddd88b84..38a93e73 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-pb_add_hotkey/00000.png b/tests_zemu/snapshots/st-pb_add_hotkey/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_add_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_add_hotkey/00001.png b/tests_zemu/snapshots/st-pb_add_hotkey/00001.png deleted file mode 100644 index d65fc52a..00000000 Binary files a/tests_zemu/snapshots/st-pb_add_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_add_hotkey/00002.png b/tests_zemu/snapshots/st-pb_add_hotkey/00002.png deleted file mode 100644 index 803ea3e5..00000000 Binary files a/tests_zemu/snapshots/st-pb_add_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_add_hotkey/00003.png b/tests_zemu/snapshots/st-pb_add_hotkey/00003.png deleted file mode 100644 index ec1aef6e..00000000 Binary files a/tests_zemu/snapshots/st-pb_add_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_add_hotkey/00004.png b/tests_zemu/snapshots/st-pb_add_hotkey/00004.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_add_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_check_status/00000.png b/tests_zemu/snapshots/st-pb_check_status/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_check_status/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_check_status/00001.png b/tests_zemu/snapshots/st-pb_check_status/00001.png deleted file mode 100644 index 073c2474..00000000 Binary files a/tests_zemu/snapshots/st-pb_check_status/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_check_status/00002.png b/tests_zemu/snapshots/st-pb_check_status/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_check_status/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_check_status/00003.png b/tests_zemu/snapshots/st-pb_check_status/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_check_status/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_claim_neurons/00000.png b/tests_zemu/snapshots/st-pb_claim_neurons/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_claim_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_claim_neurons/00001.png b/tests_zemu/snapshots/st-pb_claim_neurons/00001.png deleted file mode 100644 index 6b00eabd..00000000 Binary files a/tests_zemu/snapshots/st-pb_claim_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_claim_neurons/00002.png b/tests_zemu/snapshots/st-pb_claim_neurons/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_claim_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_claim_neurons/00003.png b/tests_zemu/snapshots/st-pb_claim_neurons/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_claim_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_disburse/00000.png b/tests_zemu/snapshots/st-pb_disburse/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_disburse/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_disburse/00001.png b/tests_zemu/snapshots/st-pb_disburse/00001.png deleted file mode 100644 index 2d73b0be..00000000 Binary files a/tests_zemu/snapshots/st-pb_disburse/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_disburse/00002.png b/tests_zemu/snapshots/st-pb_disburse/00002.png deleted file mode 100644 index f9a142ef..00000000 Binary files a/tests_zemu/snapshots/st-pb_disburse/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_disburse/00003.png b/tests_zemu/snapshots/st-pb_disburse/00003.png deleted file mode 100644 index ec1aef6e..00000000 Binary files a/tests_zemu/snapshots/st-pb_disburse/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_disburse/00004.png b/tests_zemu/snapshots/st-pb_disburse/00004.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_disburse/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_follow/00000.png b/tests_zemu/snapshots/st-pb_follow/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_follow/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_follow/00001.png b/tests_zemu/snapshots/st-pb_follow/00001.png deleted file mode 100644 index d133eb55..00000000 Binary files a/tests_zemu/snapshots/st-pb_follow/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_follow/00002.png b/tests_zemu/snapshots/st-pb_follow/00002.png deleted file mode 100644 index bf567edb..00000000 Binary files a/tests_zemu/snapshots/st-pb_follow/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_follow/00003.png b/tests_zemu/snapshots/st-pb_follow/00003.png deleted file mode 100644 index ec1aef6e..00000000 Binary files a/tests_zemu/snapshots/st-pb_follow/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_follow/00004.png b/tests_zemu/snapshots/st-pb_follow/00004.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_follow/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00000.png b/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00001.png b/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00001.png deleted file mode 100644 index 2405c1e0..00000000 Binary files a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00002.png b/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00003.png b/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_increase_dissolve_delay/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_join_community_fund/00000.png b/tests_zemu/snapshots/st-pb_join_community_fund/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_join_community_fund/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_join_community_fund/00001.png b/tests_zemu/snapshots/st-pb_join_community_fund/00001.png deleted file mode 100644 index 9e9889d7..00000000 Binary files a/tests_zemu/snapshots/st-pb_join_community_fund/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_join_community_fund/00002.png b/tests_zemu/snapshots/st-pb_join_community_fund/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_join_community_fund/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_join_community_fund/00003.png b/tests_zemu/snapshots/st-pb_join_community_fund/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_join_community_fund/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_list_neurons/00000.png b/tests_zemu/snapshots/st-pb_list_neurons/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_list_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_list_neurons/00001.png b/tests_zemu/snapshots/st-pb_list_neurons/00001.png deleted file mode 100644 index c2237210..00000000 Binary files a/tests_zemu/snapshots/st-pb_list_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_list_neurons/00002.png b/tests_zemu/snapshots/st-pb_list_neurons/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_list_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_list_neurons/00003.png b/tests_zemu/snapshots/st-pb_list_neurons/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_list_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_register_vote/00000.png b/tests_zemu/snapshots/st-pb_register_vote/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_register_vote/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_register_vote/00001.png b/tests_zemu/snapshots/st-pb_register_vote/00001.png deleted file mode 100644 index 2087ab23..00000000 Binary files a/tests_zemu/snapshots/st-pb_register_vote/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_register_vote/00002.png b/tests_zemu/snapshots/st-pb_register_vote/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_register_vote/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_register_vote/00003.png b/tests_zemu/snapshots/st-pb_register_vote/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_register_vote/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_remove_hotkey/00000.png b/tests_zemu/snapshots/st-pb_remove_hotkey/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_remove_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_remove_hotkey/00001.png b/tests_zemu/snapshots/st-pb_remove_hotkey/00001.png deleted file mode 100644 index de4d9126..00000000 Binary files a/tests_zemu/snapshots/st-pb_remove_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_remove_hotkey/00002.png b/tests_zemu/snapshots/st-pb_remove_hotkey/00002.png deleted file mode 100644 index 803ea3e5..00000000 Binary files a/tests_zemu/snapshots/st-pb_remove_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_remove_hotkey/00003.png b/tests_zemu/snapshots/st-pb_remove_hotkey/00003.png deleted file mode 100644 index ec1aef6e..00000000 Binary files a/tests_zemu/snapshots/st-pb_remove_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_remove_hotkey/00004.png b/tests_zemu/snapshots/st-pb_remove_hotkey/00004.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_remove_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00000.png b/tests_zemu/snapshots/st-pb_sign_update_call/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00001.png b/tests_zemu/snapshots/st-pb_sign_update_call/00001.png deleted file mode 100644 index 8e710b1c..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00002.png b/tests_zemu/snapshots/st-pb_sign_update_call/00002.png deleted file mode 100644 index b28e1487..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00003.png b/tests_zemu/snapshots/st-pb_sign_update_call/00003.png deleted file mode 100644 index f2e99a3d..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00004.png b/tests_zemu/snapshots/st-pb_sign_update_call/00004.png deleted file mode 100644 index 3f259bab..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_sign_update_call/00005.png b/tests_zemu/snapshots/st-pb_sign_update_call/00005.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_sign_update_call/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_spawn_neuron/00000.png b/tests_zemu/snapshots/st-pb_spawn_neuron/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_spawn_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_spawn_neuron/00001.png b/tests_zemu/snapshots/st-pb_spawn_neuron/00001.png deleted file mode 100644 index 36744235..00000000 Binary files a/tests_zemu/snapshots/st-pb_spawn_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_spawn_neuron/00002.png b/tests_zemu/snapshots/st-pb_spawn_neuron/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_spawn_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_spawn_neuron/00003.png b/tests_zemu/snapshots/st-pb_spawn_neuron/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_spawn_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stake_neuron/00000.png b/tests_zemu/snapshots/st-pb_stake_neuron/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_stake_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stake_neuron/00001.png b/tests_zemu/snapshots/st-pb_stake_neuron/00001.png deleted file mode 100644 index 62334686..00000000 Binary files a/tests_zemu/snapshots/st-pb_stake_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stake_neuron/00002.png b/tests_zemu/snapshots/st-pb_stake_neuron/00002.png deleted file mode 100644 index 2029c5b4..00000000 Binary files a/tests_zemu/snapshots/st-pb_stake_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stake_neuron/00003.png b/tests_zemu/snapshots/st-pb_stake_neuron/00003.png deleted file mode 100644 index ec1aef6e..00000000 Binary files a/tests_zemu/snapshots/st-pb_stake_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stake_neuron/00004.png b/tests_zemu/snapshots/st-pb_stake_neuron/00004.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_stake_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_start_dissolve/00000.png b/tests_zemu/snapshots/st-pb_start_dissolve/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_start_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_start_dissolve/00001.png b/tests_zemu/snapshots/st-pb_start_dissolve/00001.png deleted file mode 100644 index c224890e..00000000 Binary files a/tests_zemu/snapshots/st-pb_start_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_start_dissolve/00002.png b/tests_zemu/snapshots/st-pb_start_dissolve/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_start_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_start_dissolve/00003.png b/tests_zemu/snapshots/st-pb_start_dissolve/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_start_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stop_dissolve/00000.png b/tests_zemu/snapshots/st-pb_stop_dissolve/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-pb_stop_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stop_dissolve/00001.png b/tests_zemu/snapshots/st-pb_stop_dissolve/00001.png deleted file mode 100644 index 5fe85250..00000000 Binary files a/tests_zemu/snapshots/st-pb_stop_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stop_dissolve/00002.png b/tests_zemu/snapshots/st-pb_stop_dissolve/00002.png deleted file mode 100644 index 846218ba..00000000 Binary files a/tests_zemu/snapshots/st-pb_stop_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-pb_stop_dissolve/00003.png b/tests_zemu/snapshots/st-pb_stop_dissolve/00003.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-pb_stop_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00000.png b/tests_zemu/snapshots/st-sign_basic_expert/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00001.png b/tests_zemu/snapshots/st-sign_basic_expert/00001.png deleted file mode 100644 index 74197fd8..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00002.png b/tests_zemu/snapshots/st-sign_basic_expert/00002.png deleted file mode 100644 index dcab186a..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00003.png b/tests_zemu/snapshots/st-sign_basic_expert/00003.png deleted file mode 100644 index 5fe2d0de..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00004.png b/tests_zemu/snapshots/st-sign_basic_expert/00004.png deleted file mode 100644 index b87ece71..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00005.png b/tests_zemu/snapshots/st-sign_basic_expert/00005.png deleted file mode 100644 index 46c6e298..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00006.png b/tests_zemu/snapshots/st-sign_basic_expert/00006.png deleted file mode 100644 index 88dd6c8a..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_expert/00007.png b/tests_zemu/snapshots/st-sign_basic_expert/00007.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00000.png b/tests_zemu/snapshots/st-sign_basic_normal/00000.png deleted file mode 100644 index b9bb14c4..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00001.png b/tests_zemu/snapshots/st-sign_basic_normal/00001.png deleted file mode 100644 index 68e4ae06..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00002.png b/tests_zemu/snapshots/st-sign_basic_normal/00002.png deleted file mode 100644 index 95b7e90e..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00003.png b/tests_zemu/snapshots/st-sign_basic_normal/00003.png deleted file mode 100644 index f2e99a3d..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00004.png b/tests_zemu/snapshots/st-sign_basic_normal/00004.png deleted file mode 100644 index 3f259bab..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign_basic_normal/00005.png b/tests_zemu/snapshots/st-sign_basic_normal/00005.png deleted file mode 100644 index bf582528..00000000 Binary files a/tests_zemu/snapshots/st-sign_basic_normal/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index c8b61779..f4f21279 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index c8b61779..f4f21279 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00000.png b/tests_zemu/snapshots/x-pb_add_hotkey/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00001.png b/tests_zemu/snapshots/x-pb_add_hotkey/00001.png deleted file mode 100644 index 5a1d3274..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00002.png b/tests_zemu/snapshots/x-pb_add_hotkey/00002.png deleted file mode 100644 index cf3affa5..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00003.png b/tests_zemu/snapshots/x-pb_add_hotkey/00003.png deleted file mode 100644 index 54c6f669..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00004.png b/tests_zemu/snapshots/x-pb_add_hotkey/00004.png deleted file mode 100644 index fc58dfb6..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00005.png b/tests_zemu/snapshots/x-pb_add_hotkey/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_add_hotkey/00006.png b/tests_zemu/snapshots/x-pb_add_hotkey/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_add_hotkey/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_check_status/00000.png b/tests_zemu/snapshots/x-pb_check_status/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_check_status/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_check_status/00001.png b/tests_zemu/snapshots/x-pb_check_status/00001.png deleted file mode 100644 index 030585c6..00000000 Binary files a/tests_zemu/snapshots/x-pb_check_status/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_check_status/00002.png b/tests_zemu/snapshots/x-pb_check_status/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_check_status/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_check_status/00003.png b/tests_zemu/snapshots/x-pb_check_status/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_check_status/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_claim_neurons/00000.png b/tests_zemu/snapshots/x-pb_claim_neurons/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_claim_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_claim_neurons/00001.png b/tests_zemu/snapshots/x-pb_claim_neurons/00001.png deleted file mode 100644 index 3006c983..00000000 Binary files a/tests_zemu/snapshots/x-pb_claim_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_claim_neurons/00002.png b/tests_zemu/snapshots/x-pb_claim_neurons/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_claim_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_claim_neurons/00003.png b/tests_zemu/snapshots/x-pb_claim_neurons/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_claim_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00000.png b/tests_zemu/snapshots/x-pb_disburse/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00001.png b/tests_zemu/snapshots/x-pb_disburse/00001.png deleted file mode 100644 index d3d8670a..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00002.png b/tests_zemu/snapshots/x-pb_disburse/00002.png deleted file mode 100644 index 1e2c834c..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00003.png b/tests_zemu/snapshots/x-pb_disburse/00003.png deleted file mode 100644 index 4646209c..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00004.png b/tests_zemu/snapshots/x-pb_disburse/00004.png deleted file mode 100644 index efc1bff1..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00005.png b/tests_zemu/snapshots/x-pb_disburse/00005.png deleted file mode 100644 index 82752ad0..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00006.png b/tests_zemu/snapshots/x-pb_disburse/00006.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_disburse/00007.png b/tests_zemu/snapshots/x-pb_disburse/00007.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_disburse/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00000.png b/tests_zemu/snapshots/x-pb_follow/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00001.png b/tests_zemu/snapshots/x-pb_follow/00001.png deleted file mode 100644 index 0541da93..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00002.png b/tests_zemu/snapshots/x-pb_follow/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00003.png b/tests_zemu/snapshots/x-pb_follow/00003.png deleted file mode 100644 index 5d902631..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00004.png b/tests_zemu/snapshots/x-pb_follow/00004.png deleted file mode 100644 index 4844ee2b..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00005.png b/tests_zemu/snapshots/x-pb_follow/00005.png deleted file mode 100644 index c0cdca5e..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00006.png b/tests_zemu/snapshots/x-pb_follow/00006.png deleted file mode 100644 index 92ed5961..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00007.png b/tests_zemu/snapshots/x-pb_follow/00007.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_follow/00008.png b/tests_zemu/snapshots/x-pb_follow/00008.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_follow/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00000.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00001.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00001.png deleted file mode 100644 index 814335b0..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00002.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00003.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00003.png deleted file mode 100644 index f8b98202..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00004.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00004.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00005.png b/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00005.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_increase_dissolve_delay/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_join_community_fund/00000.png b/tests_zemu/snapshots/x-pb_join_community_fund/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_join_community_fund/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_join_community_fund/00001.png b/tests_zemu/snapshots/x-pb_join_community_fund/00001.png deleted file mode 100644 index 890d0a4c..00000000 Binary files a/tests_zemu/snapshots/x-pb_join_community_fund/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_join_community_fund/00002.png b/tests_zemu/snapshots/x-pb_join_community_fund/00002.png deleted file mode 100644 index 35c03a15..00000000 Binary files a/tests_zemu/snapshots/x-pb_join_community_fund/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_join_community_fund/00003.png b/tests_zemu/snapshots/x-pb_join_community_fund/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_join_community_fund/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_join_community_fund/00004.png b/tests_zemu/snapshots/x-pb_join_community_fund/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_join_community_fund/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_list_neurons/00000.png b/tests_zemu/snapshots/x-pb_list_neurons/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_list_neurons/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_list_neurons/00001.png b/tests_zemu/snapshots/x-pb_list_neurons/00001.png deleted file mode 100644 index 5d2a4a1f..00000000 Binary files a/tests_zemu/snapshots/x-pb_list_neurons/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_list_neurons/00002.png b/tests_zemu/snapshots/x-pb_list_neurons/00002.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_list_neurons/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_list_neurons/00003.png b/tests_zemu/snapshots/x-pb_list_neurons/00003.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_list_neurons/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00000.png b/tests_zemu/snapshots/x-pb_register_vote/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00001.png b/tests_zemu/snapshots/x-pb_register_vote/00001.png deleted file mode 100644 index b497a360..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00002.png b/tests_zemu/snapshots/x-pb_register_vote/00002.png deleted file mode 100644 index fba7dfea..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00003.png b/tests_zemu/snapshots/x-pb_register_vote/00003.png deleted file mode 100644 index 1e96ed22..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00004.png b/tests_zemu/snapshots/x-pb_register_vote/00004.png deleted file mode 100644 index 0a0b3ec1..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00005.png b/tests_zemu/snapshots/x-pb_register_vote/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_register_vote/00006.png b/tests_zemu/snapshots/x-pb_register_vote/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_register_vote/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00000.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00001.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00001.png deleted file mode 100644 index 0d62dfcc..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00002.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00002.png deleted file mode 100644 index cf3affa5..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00003.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00003.png deleted file mode 100644 index 54c6f669..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00004.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00004.png deleted file mode 100644 index fc58dfb6..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00005.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00005.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_remove_hotkey/00006.png b/tests_zemu/snapshots/x-pb_remove_hotkey/00006.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_remove_hotkey/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00000.png b/tests_zemu/snapshots/x-pb_sign_update_call/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00001.png b/tests_zemu/snapshots/x-pb_sign_update_call/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00002.png b/tests_zemu/snapshots/x-pb_sign_update_call/00002.png deleted file mode 100644 index 41e9e067..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00003.png b/tests_zemu/snapshots/x-pb_sign_update_call/00003.png deleted file mode 100644 index 167a57eb..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00004.png b/tests_zemu/snapshots/x-pb_sign_update_call/00004.png deleted file mode 100644 index dc782e8f..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00005.png b/tests_zemu/snapshots/x-pb_sign_update_call/00005.png deleted file mode 100644 index 8b3176ea..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00006.png b/tests_zemu/snapshots/x-pb_sign_update_call/00006.png deleted file mode 100644 index d38d11c6..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00007.png b/tests_zemu/snapshots/x-pb_sign_update_call/00007.png deleted file mode 100644 index afeeff26..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00008.png b/tests_zemu/snapshots/x-pb_sign_update_call/00008.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00009.png b/tests_zemu/snapshots/x-pb_sign_update_call/00009.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_sign_update_call/00010.png b/tests_zemu/snapshots/x-pb_sign_update_call/00010.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_sign_update_call/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00000.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00001.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00001.png deleted file mode 100644 index 827476c4..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00002.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00002.png deleted file mode 100644 index 16c4d7ba..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00003.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00003.png deleted file mode 100644 index 344a1fea..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00004.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00004.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_spawn_neuron/00005.png b/tests_zemu/snapshots/x-pb_spawn_neuron/00005.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_spawn_neuron/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00000.png b/tests_zemu/snapshots/x-pb_stake_neuron/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00001.png b/tests_zemu/snapshots/x-pb_stake_neuron/00001.png deleted file mode 100644 index efc4171b..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00002.png b/tests_zemu/snapshots/x-pb_stake_neuron/00002.png deleted file mode 100644 index 41e9e067..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00003.png b/tests_zemu/snapshots/x-pb_stake_neuron/00003.png deleted file mode 100644 index 167a57eb..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00004.png b/tests_zemu/snapshots/x-pb_stake_neuron/00004.png deleted file mode 100644 index 1da9ce14..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00005.png b/tests_zemu/snapshots/x-pb_stake_neuron/00005.png deleted file mode 100644 index afeeff26..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00006.png b/tests_zemu/snapshots/x-pb_stake_neuron/00006.png deleted file mode 100644 index 829b1e02..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00007.png b/tests_zemu/snapshots/x-pb_stake_neuron/00007.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stake_neuron/00008.png b/tests_zemu/snapshots/x-pb_stake_neuron/00008.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_stake_neuron/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_start_dissolve/00000.png b/tests_zemu/snapshots/x-pb_start_dissolve/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_start_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_start_dissolve/00001.png b/tests_zemu/snapshots/x-pb_start_dissolve/00001.png deleted file mode 100644 index df8203cb..00000000 Binary files a/tests_zemu/snapshots/x-pb_start_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_start_dissolve/00002.png b/tests_zemu/snapshots/x-pb_start_dissolve/00002.png deleted file mode 100644 index 4d4f4494..00000000 Binary files a/tests_zemu/snapshots/x-pb_start_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_start_dissolve/00003.png b/tests_zemu/snapshots/x-pb_start_dissolve/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_start_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_start_dissolve/00004.png b/tests_zemu/snapshots/x-pb_start_dissolve/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_start_dissolve/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stop_dissolve/00000.png b/tests_zemu/snapshots/x-pb_stop_dissolve/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-pb_stop_dissolve/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stop_dissolve/00001.png b/tests_zemu/snapshots/x-pb_stop_dissolve/00001.png deleted file mode 100644 index 4c841e1d..00000000 Binary files a/tests_zemu/snapshots/x-pb_stop_dissolve/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stop_dissolve/00002.png b/tests_zemu/snapshots/x-pb_stop_dissolve/00002.png deleted file mode 100644 index 4d4f4494..00000000 Binary files a/tests_zemu/snapshots/x-pb_stop_dissolve/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stop_dissolve/00003.png b/tests_zemu/snapshots/x-pb_stop_dissolve/00003.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-pb_stop_dissolve/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-pb_stop_dissolve/00004.png b/tests_zemu/snapshots/x-pb_stop_dissolve/00004.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-pb_stop_dissolve/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00000.png b/tests_zemu/snapshots/x-sign_basic_expert/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00001.png b/tests_zemu/snapshots/x-sign_basic_expert/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00002.png b/tests_zemu/snapshots/x-sign_basic_expert/00002.png deleted file mode 100644 index d0010466..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00003.png b/tests_zemu/snapshots/x-sign_basic_expert/00003.png deleted file mode 100644 index b0579ca6..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00004.png b/tests_zemu/snapshots/x-sign_basic_expert/00004.png deleted file mode 100644 index 5f87255f..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00005.png b/tests_zemu/snapshots/x-sign_basic_expert/00005.png deleted file mode 100644 index 86287518..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00006.png b/tests_zemu/snapshots/x-sign_basic_expert/00006.png deleted file mode 100644 index 7050bd94..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00007.png b/tests_zemu/snapshots/x-sign_basic_expert/00007.png deleted file mode 100644 index 5cd43ab2..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00008.png b/tests_zemu/snapshots/x-sign_basic_expert/00008.png deleted file mode 100644 index 828ec671..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00009.png b/tests_zemu/snapshots/x-sign_basic_expert/00009.png deleted file mode 100644 index 2e38100b..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00010.png b/tests_zemu/snapshots/x-sign_basic_expert/00010.png deleted file mode 100644 index 68986d11..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00010.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00011.png b/tests_zemu/snapshots/x-sign_basic_expert/00011.png deleted file mode 100644 index 0e4a6001..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00011.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00012.png b/tests_zemu/snapshots/x-sign_basic_expert/00012.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00012.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00013.png b/tests_zemu/snapshots/x-sign_basic_expert/00013.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00013.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_expert/00014.png b/tests_zemu/snapshots/x-sign_basic_expert/00014.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_expert/00014.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00000.png b/tests_zemu/snapshots/x-sign_basic_normal/00000.png deleted file mode 100644 index 8d0c3cbd..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00001.png b/tests_zemu/snapshots/x-sign_basic_normal/00001.png deleted file mode 100644 index 76706da3..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00002.png b/tests_zemu/snapshots/x-sign_basic_normal/00002.png deleted file mode 100644 index 7050bd94..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00003.png b/tests_zemu/snapshots/x-sign_basic_normal/00003.png deleted file mode 100644 index 5cd43ab2..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00004.png b/tests_zemu/snapshots/x-sign_basic_normal/00004.png deleted file mode 100644 index 828ec671..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00005.png b/tests_zemu/snapshots/x-sign_basic_normal/00005.png deleted file mode 100644 index 2e38100b..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00006.png b/tests_zemu/snapshots/x-sign_basic_normal/00006.png deleted file mode 100644 index 68986d11..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00007.png b/tests_zemu/snapshots/x-sign_basic_normal/00007.png deleted file mode 100644 index 0e4a6001..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00008.png b/tests_zemu/snapshots/x-sign_basic_normal/00008.png deleted file mode 100644 index ffebc72b..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00009.png b/tests_zemu/snapshots/x-sign_basic_normal/00009.png deleted file mode 100644 index 1e4be699..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00009.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign_basic_normal/00010.png b/tests_zemu/snapshots/x-sign_basic_normal/00010.png deleted file mode 100644 index 4c3747ed..00000000 Binary files a/tests_zemu/snapshots/x-sign_basic_normal/00010.png and /dev/null differ diff --git a/tests_zemu/tests/candid.test.ts b/tests_zemu/tests/candid.test.ts index ba12b0b6..8ae4aea5 100644 --- a/tests_zemu/tests/candid.test.ts +++ b/tests_zemu/tests/candid.test.ts @@ -202,24 +202,3 @@ describe.each(STAKE_TXS)('CANDID_STAKE', function (data) { } }) }) - -test.concurrent.each(DEVICE_MODELS)('spawn neuron candid-protobuf invalid transactions', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - const txBlobStr = - 'd9d9f7a167636f6e74656e74a76361726750620a10bcc7f5c8a3f293fb47220218326b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b172e706d8c61d2806b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f7062656e6f6e63655000000184eb5a7ffab5d56eb72b8a04df6c726571756573745f747970656463616c6c6673656e646572581df1305df1b074e88adb99dc2f56f12d63208165f24dea7e60ae6cf6cf02' - - const txBlob = Buffer.from(txBlobStr, 'hex') - - const signatureResponse = await app.sign(path, txBlob, SIGN_VALUES_P2.DEFAULT) - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x6984) - expect(signatureResponse.errorMessage).toEqual('Data is invalid : Unexpected value') - } finally { - await sim.close() - } -}) diff --git a/tests_zemu/tests/protobuf.test.ts b/tests_zemu/tests/protobuf.test.ts deleted file mode 100644 index 33a7fe30..00000000 --- a/tests_zemu/tests/protobuf.test.ts +++ /dev/null @@ -1,221 +0,0 @@ -/** - ******************************************************************************* - * (c) 2020 Zondax GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************* - */ - -import InternetComputerApp, { SIGN_VALUES_P2 } from '@zondax/ledger-icp' -import Zemu from '@zondax/zemu' -import { sha256 } from 'js-sha256' -import * as secp256k1 from 'secp256k1' - -import { DEFAULT_OPTIONS, DEVICE_MODELS } from './common' - -jest.setTimeout(180000) - -const path = "m/44'/223'/0'/0/0" -const PB_TXNS = [ - { - name: 'pb_check_status', - blob: 'd9d9f7a167636f6e74656e74a46e696e67726573735f6578706972791b16792e73143c0b0065706174687381824e726571756573745f7374617475735820a740262068c4b22efed0cc67095fc9ce46c883182c09aa045b4c0396060105d26c726571756573745f747970656a726561645f73746174656673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_increase_dissolve_delay', - blob: 'd9d9f7a367636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e636550732123f52b79b4a4de9b89e0cc3de7586e696e67726573735f6578706972791b1674db8a3bb843006673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000101016b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f7062636172674c0a02107b12060a040880a3056d73656e6465725f7075626b657958583056301006072a8648ce3d020106052b8104000a03420004e1142e1fbc940344d9161709196bb8bd151f94379c48dd507ab99a0776109128b94b5303cf2b2d28e25a779da175b62f8a975599b20c63d5193202640576ec5e6a73656e6465725f7369675840953620923534b8840d057341bfaf4511dfa73f57372e7946aed83bfde737e44c5c3005b6f19d4342b9e46c78b2c6fa4f67cf203d6a7cab51a84aa486b459536b', - }, - { - name: 'pb_add_hotkey', - blob: 'd9d9f7a167636f6e74656e74a6636172675832620b10b98488e0c7a8cec9bd01122322210a1f0a1d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b1698b4cd1475e3c06b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_remove_hotkey', - blob: 'd9d9f7a167636f6e74656e74a6636172675832620b10b98488e0c7a8cec9bd0112232a210a1f0a1d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b1698b5366ada7f006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_start_dissolve', - blob: 'd9d9f7a167636f6e74656e74a66361726751620b10e387b497ee96e3a8f201120212006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b1698b7b6ae33de406b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_stop_dissolve', - blob: 'd9d9f7a167636f6e74656e74a66361726751620b10e387b497ee96e3a8f20112021a006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b1698b7bc219b61006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_disburse', - blob: 'd9d9f7a167636f6e74656e74a6636172675839620a10a7d18aaad3a2a2c6131a2b0a0508959aef3a12220a2068d518e2fd2be6566e62c36611b9794dfcbc04eb4227eefb73ab3c7a2d0ae5776b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b169bc8985c330d006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_list_neurons', - blob: 'd9d9f7a167636f6e74656e74a6636172674210016b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b169bc0d5904b7e806b6d6574686f645f6e616d656f6c6973745f6e6575726f6e735f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_spawn_neuron', - blob: 'd9d9f7a167636f6e74656e74a6636172674f620b10f5c88584a9f98ded910122006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b169bc108342f99006b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_register_vote', - blob: 'd9d9f7a167636f6e74656e74a6636172674d620310c8033a060a02087b10016b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16abc427b2b658406b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_follow', - blob: 'd9d9f7a167636f6e74656e74a663617267546202107b2a0e120310c80312031095061202107b6b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16abfff247c1f9c06b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, - { - name: 'pb_claim_neurons', - blob: 'd9d9f7a167636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e6365505833a6590c6d2b601e3a24557cfbb4336e696e67726573735f6578706972791b16bad506bb4ca0f06673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000601016b6d6574686f645f6e616d656d636c61696d5f6e6575726f6e7363617267588b4449444c000171820130343139623066656363356639613164353162393033643262363234346430356531326134386661386233353731396538313262623635643966393035613365613965356137323362363537616665393136313236396431663134633164383034376530323230616461633434653731313630323531656364616662613064636535', - }, - { - name: 'pb_join_community_fund', - blob: 'd9d9f7a167636f6e74656e74a663617267486202107b12023a006b63616e69737465725f69644a000000000000000101016e696e67726573735f6578706972791b16ba67d2b864bf406b6d6574686f645f6e616d65706d616e6167655f6e6575726f6e5f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - }, -] - -describe.each(PB_TXNS)('PROTOBUF TRANSACTIONS', function (data) { - test.concurrent.each(DEVICE_MODELS)(`Test: ${data.name}`, async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - const respAddr = await app.getAddressAndPubKey(path) - - const txBlob = Buffer.from(data.blob, 'hex') - - const respRequest = app.sign(path, txBlob, SIGN_VALUES_P2.DEFAULT) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-${data.name}`) - - const signatureResponse = await respRequest - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - - // Verify signature - const hash = sha256.hex(signatureResponse.preSignHash ?? []) - - const hexPubkey = respAddr.publicKey ?? Buffer.alloc(0) - const pk = Uint8Array.from(hexPubkey) - expect(pk.byteLength).toEqual(65) - - const digest = Uint8Array.from(Buffer.from(hash, 'hex')) - const signature = Uint8Array.from(signatureResponse.signatureRS ?? []) - expect(signature.byteLength).toEqual(64) - - const signatureOk = secp256k1.ecdsaVerify(signature, digest, pk) - expect(signatureOk).toEqual(true) - } finally { - await sim.close() - } - }) -}) - -test.concurrent.each(DEVICE_MODELS)(`protobuf stake_neuron`, async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - const respAddr = await app.getAddressAndPubKey(path) - - const txBlob = Buffer.from( - 'd9d9f7a167636f6e74656e74a663617267583e0a0a08f2d4a0eca697869f0812070a050880c2d72f1a0308904e2a220a20a8a1abecdb66f57eb6eba44c3b5f11a6c433fe932680a9519b064b80ca8794e16b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16985a582755f1806b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302', - 'hex', - ) - - const respRequest = app.sign(path, txBlob, SIGN_VALUES_P2.STAKE_TX) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-pb_stake_neuron`) - - const signatureResponse = await respRequest - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - - // Verify signature - const hash = sha256.hex(signatureResponse.preSignHash ?? []) - - const hexPubkey = respAddr.publicKey ?? Buffer.alloc(0) - const pk = Uint8Array.from(hexPubkey) - expect(pk.byteLength).toEqual(65) - - const digest = Uint8Array.from(Buffer.from(hash, 'hex')) - const signature = Uint8Array.from(signatureResponse.signatureRS ?? []) - expect(signature.byteLength).toEqual(64) - - const signatureOk = secp256k1.ecdsaVerify(signature, digest, pk) - expect(signatureOk).toEqual(true) - } finally { - await sim.close() - } -}) - -test.concurrent.each(DEVICE_MODELS)('sign combined_tx', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - const txBlobStr_read = - 'd9d9f7a167636f6e74656e74a46e696e67726573735f6578706972791b16bc685267142b8065706174687381824e726571756573745f73746174757358208d304d294d3f611f992b3f2b184d32b9b3c058d918d7a7ab1946614b13ba0a496c726571756573745f747970656a726561645f73746174656673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302' - const txBlob_read = Buffer.from(txBlobStr_read, 'hex') - - const txBlobStr_request = - 'd9d9f7a167636f6e74656e74a66361726758320a0012050a0308904e1a0308904e2a220a20a2a794c66495083317e4be5197eb655b1e63015469d769e2338af3d3e3f3aa866b63616e69737465725f69644a000000000000000201016e696e67726573735f6578706972791b16bc685084d14ec06b6d6574686f645f6e616d656773656e645f70626c726571756573745f747970656463616c6c6673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e302' - const txBlob_request = Buffer.from(txBlobStr_request, 'hex') - - const respRequest = app.signUpdateCall("m/44'/223'/0'/0/0", txBlob_request, txBlob_read, SIGN_VALUES_P2.DEFAULT) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-pb_sign_update_call`) - - const signatureResponse = await respRequest - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - - const pk = Uint8Array.from( - Buffer.from( - '0410d34980a51af89d3331ad5fa80fe30d8868ad87526460b3b3e15596ee58e812422987d8589ba61098264df5bb9c2d3ff6fe061746b4b31a44ec26636632b835', - 'hex', - ), - ) - - const digest_request = Uint8Array.from(signatureResponse.RequestHash ?? []) - const signature_request = Uint8Array.from(signatureResponse.RequestSignatureRS ?? []) - expect(signature_request.byteLength).toEqual(64) - - const signatureOk = secp256k1.ecdsaVerify(signature_request, digest_request, pk) - expect(signatureOk).toEqual(true) - - const digest_statusread = Uint8Array.from(signatureResponse.StatusReadHash ?? []) - const signature_statusread = Uint8Array.from(signatureResponse.StatusReadSignatureRS ?? []) - expect(signature_request.byteLength).toEqual(64) - - const signatureOk_statusread = secp256k1.ecdsaVerify(signature_statusread, digest_statusread, pk) - expect(signatureOk_statusread).toEqual(true) - } finally { - await sim.close() - } -}) diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index 3f8b44dc..87bdb8eb 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -15,12 +15,9 @@ ******************************************************************************* */ import Zemu, { ButtonKind, zondaxMainmenuNavigation } from '@zondax/zemu' -import InternetComputerApp, { SIGN_VALUES_P2 } from '@zondax/ledger-icp' -import * as secp256k1 from 'secp256k1' +import InternetComputerApp from '@zondax/ledger-icp' import { DEFAULT_OPTIONS, DEVICE_MODELS } from './common' -import { sha256 } from 'js-sha256' - jest.setTimeout(180000) describe('Standard', function () { @@ -162,116 +159,4 @@ describe('Standard', function () { await sim.close() } }) - - test.concurrent.each(DEVICE_MODELS)('sign normal -- token transfer', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - const respAddr = await app.getAddressAndPubKey("m/44'/223'/0'/0/0") - console.log(respAddr) - - expect(respAddr.returnCode).toEqual(0x9000) - expect(respAddr.errorMessage).toEqual('No errors') - - const expected_pk = - '0410d34980a51af89d3331ad5fa80fe30d8868ad87526460b3b3e15596ee58e812422987d8589ba61098264df5bb9c2d3ff6fe061746b4b31a44ec26636632b835' - expect((respAddr.publicKey ?? []).toString('hex')).toEqual(expected_pk) - - const txBlobStr = - 'd9d9f7a367636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e636550f5390d960c6e52f489155a4309da03da6e696e67726573735f6578706972791b1674c5e29ec9c2106673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000201016b6d6574686f645f6e616d656773656e645f70626361726758560a0012050a0308e8071a0308890122220a2001010101010101010101010101010101010101010101010101010101010101012a220a2035548ec29e9d85305850e87a2d2642fe7214ff4bb36334070deafc3345c3b1276d73656e6465725f7075626b657958583056301006072a8648ce3d020106052b8104000a03420004e1142e1fbc940344d9161709196bb8bd151f94379c48dd507ab99a0776109128b94b5303cf2b2d28e25a779da175b62f8a975599b20c63d5193202640576ec5e6a73656e6465725f7369675840de5bccbb0a0173c432cd58ea4495d4d1e122d6ce04e31dcf63217f3d3a9b73130dc9bbf3b10e61c8db8bf8800bb4649e27786e5bc9418838c95864be28487a6a' - - const txBlob = Buffer.from(txBlobStr, 'hex') - - const respRequest = app.sign("m/44'/223'/0'/0/0", txBlob, SIGN_VALUES_P2.DEFAULT) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-sign_basic_normal`) - - const signatureResponse = await respRequest - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - - const expected_preHash = '0a69632d7265717565737438d75af52910efe58a5c32b61d3343ad1a40f32d335e88cab5843ec69d7bdf6a' - expect((signatureResponse.preSignHash ?? []).toString('hex')).toEqual(expected_preHash) - - const expected_hash = '3797e39b76c78c7b33f724ba7b44b28721c6318a32e608ccee3940f3cba49de3' - const hash = sha256.hex(signatureResponse.preSignHash ?? []) - expect(hash).toEqual(expected_hash) - - const pk = Uint8Array.from(respAddr.publicKey ?? []) - expect(pk.byteLength).toEqual(65) - const digest = Uint8Array.from(Buffer.from(hash, 'hex')) - const signature = Uint8Array.from(signatureResponse.signatureRS ?? []) - //const signature = secp256k1.signatureImport(Uint8Array.from(signatureResponse.signatureDER)); - expect(signature.byteLength).toEqual(64) - - const signatureOk = secp256k1.ecdsaVerify(signature, digest, pk) - expect(signatureOk).toEqual(true) - } finally { - await sim.close() - } - }) - - test.concurrent.each(DEVICE_MODELS)('sign expert -- token transfer', async function (m) { - const sim = new Zemu(m.path) - try { - await sim.start({ ...DEFAULT_OPTIONS, model: m.name, startText: m.name === 'stax' ? '' : 'Computer' }) - const app = new InternetComputerApp(sim.getTransport()) - - // Enable expert mode - console.log('Set expert mode') - await sim.toggleExpertMode() - - // Get public key - const respAddr = await app.getAddressAndPubKey("m/44'/223'/0'/0/0") - console.log(respAddr) - expect(respAddr.returnCode).toEqual(0x9000) - expect(respAddr.errorMessage).toEqual('No errors') - const expected_pk = - '0410d34980a51af89d3331ad5fa80fe30d8868ad87526460b3b3e15596ee58e812422987d8589ba61098264df5bb9c2d3ff6fe061746b4b31a44ec26636632b835' - expect((respAddr.publicKey ?? []).toString('hex')).toEqual(expected_pk) - - // Sign blob - const txBlobStr = - 'd9d9f7a367636f6e74656e74a76c726571756573745f747970656463616c6c656e6f6e636550f5390d960c6e52f489155a4309da03da6e696e67726573735f6578706972791b1674c5e29ec9c2106673656e646572581d19aa3d42c048dd7d14f0cfa0df69a1c1381780f6e9a137abaa6a82e3026b63616e69737465725f69644a000000000000000201016b6d6574686f645f6e616d656773656e645f70626361726758560a0012050a0308e8071a0308890122220a2001010101010101010101010101010101010101010101010101010101010101012a220a2035548ec29e9d85305850e87a2d2642fe7214ff4bb36334070deafc3345c3b1276d73656e6465725f7075626b657958583056301006072a8648ce3d020106052b8104000a03420004e1142e1fbc940344d9161709196bb8bd151f94379c48dd507ab99a0776109128b94b5303cf2b2d28e25a779da175b62f8a975599b20c63d5193202640576ec5e6a73656e6465725f7369675840de5bccbb0a0173c432cd58ea4495d4d1e122d6ce04e31dcf63217f3d3a9b73130dc9bbf3b10e61c8db8bf8800bb4649e27786e5bc9418838c95864be28487a6a' - const txBlob = Buffer.from(txBlobStr, 'hex') - const respRequest = app.sign("m/44'/223'/0'/0/0", txBlob, SIGN_VALUES_P2.DEFAULT) - - // Wait until we are not in the main menu - await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) - - await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-sign_basic_expert`) - - const signatureResponse = await respRequest - console.log(signatureResponse) - - expect(signatureResponse.returnCode).toEqual(0x9000) - expect(signatureResponse.errorMessage).toEqual('No errors') - - const expected_preHash = '0a69632d7265717565737438d75af52910efe58a5c32b61d3343ad1a40f32d335e88cab5843ec69d7bdf6a' - expect((signatureResponse.preSignHash ?? []).toString('hex')).toEqual(expected_preHash) - - const expected_hash = '3797e39b76c78c7b33f724ba7b44b28721c6318a32e608ccee3940f3cba49de3' - const hash = sha256.hex(signatureResponse.preSignHash ?? []) - expect(hash).toEqual(expected_hash) - - const pk = Uint8Array.from(respAddr.publicKey ?? []) - expect(pk.byteLength).toEqual(65) - const digest = Uint8Array.from(Buffer.from(hash, 'hex')) - const signature = Uint8Array.from(signatureResponse.signatureRS ?? []) - //const signature = secp256k1.signatureImport(Uint8Array.from(signatureResponse.signatureDER)); - expect(signature.byteLength).toEqual(64) - - const signatureOk = secp256k1.ecdsaVerify(signature, digest, pk) - expect(signatureOk).toEqual(true) - } finally { - await sim.close() - } - }) })