diff --git a/core/host_api/host_api.hpp b/core/host_api/host_api.hpp index 11e3eb0d81..093f073277 100644 --- a/core/host_api/host_api.hpp +++ b/core/host_api/host_api.hpp @@ -413,7 +413,7 @@ namespace kagome::host_api { [[nodiscard]] virtual runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1(runtime::WasmSize key_type, runtime::WasmPointer key, - runtime::WasmSpan msg_data) = 0; + runtime::WasmPointer msg_data) = 0; /** * @brief Generates an ecdsa key for the given key type using an optional diff --git a/core/host_api/impl/crypto_extension.cpp b/core/host_api/impl/crypto_extension.cpp index 01b1d730ca..53f025baec 100644 --- a/core/host_api/impl/crypto_extension.cpp +++ b/core/host_api/impl/crypto_extension.cpp @@ -616,14 +616,14 @@ namespace kagome::host_api { runtime::WasmSpan CryptoExtension::ext_crypto_ecdsa_sign_prehashed_version_1( runtime::WasmPointer key_type_ptr, runtime::WasmPointer key, - runtime::WasmSpan msg) { + runtime::WasmPointer msg_data) { using ResultType = std::optional; crypto::KeyType key_type = loadKeyType(key_type_ptr); checkIfKeyIsSupported(key_type, logger_); auto public_buffer = getMemory().loadN(key, sizeof(crypto::EcdsaPublicKey)); - auto [msg_data, msg_len] = runtime::PtrSize(msg); + runtime::WasmSize msg_len = 32; auto msg_buffer = getMemory().loadN(msg_data, msg_len); crypto::EcdsaPublicKey pk; diff --git a/core/host_api/impl/crypto_extension.hpp b/core/host_api/impl/crypto_extension.hpp index 9e3265746b..00e2d2ac83 100644 --- a/core/host_api/impl/crypto_extension.hpp +++ b/core/host_api/impl/crypto_extension.hpp @@ -213,7 +213,7 @@ namespace kagome::host_api { runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1( runtime::WasmPointer key_type, runtime::WasmPointer key, - runtime::WasmSpan msg); + runtime::WasmPointer msg); /** * @see HostApi::ext_crypto_ecdsa_generate diff --git a/core/host_api/impl/host_api_impl.cpp b/core/host_api/impl/host_api_impl.cpp index dc0ca510d4..2199d75b08 100644 --- a/core/host_api/impl/host_api_impl.cpp +++ b/core/host_api/impl/host_api_impl.cpp @@ -341,7 +341,7 @@ namespace kagome::host_api { runtime::WasmSpan HostApiImpl::ext_crypto_ecdsa_sign_prehashed_version_1( runtime::WasmSize key_type, runtime::WasmPointer key, - runtime::WasmSpan msg_data) { + runtime::WasmPointer msg_data) { return crypto_ext_.ext_crypto_ecdsa_sign_prehashed_version_1( key_type, key, msg_data); } diff --git a/core/host_api/impl/host_api_impl.hpp b/core/host_api/impl/host_api_impl.hpp index 8a55217057..c0d5f39ba8 100644 --- a/core/host_api/impl/host_api_impl.hpp +++ b/core/host_api/impl/host_api_impl.hpp @@ -190,7 +190,7 @@ namespace kagome::host_api { runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1( runtime::WasmSize key_type, runtime::WasmPointer key, - runtime::WasmSpan msg_data) override; + runtime::WasmPointer msg_data) override; runtime::WasmPointer ext_crypto_ecdsa_generate_version_1( runtime::WasmSize key_type_id, runtime::WasmSpan seed) override; diff --git a/core/runtime/common/register_host_api.hpp b/core/runtime/common/register_host_api.hpp index 8879adb9b1..fa852f1a88 100644 --- a/core/runtime/common/register_host_api.hpp +++ b/core/runtime/common/register_host_api.hpp @@ -35,7 +35,7 @@ REGISTER_HOST_METHOD(int32_t, ext_crypto_sr25519_verify_version_2, int32_t, int64_t, int32_t) \ REGISTER_HOST_METHOD(int64_t, ext_crypto_ecdsa_public_keys_version_1, int32_t) \ REGISTER_HOST_METHOD(int64_t, ext_crypto_ecdsa_sign_version_1, int32_t, int32_t, int64_t) \ - REGISTER_HOST_METHOD(int64_t, ext_crypto_ecdsa_sign_prehashed_version_1, int32_t, int32_t, int64_t) \ + REGISTER_HOST_METHOD(int64_t, ext_crypto_ecdsa_sign_prehashed_version_1, int32_t, int32_t, int32_t) \ REGISTER_HOST_METHOD(int32_t, ext_crypto_ecdsa_generate_version_1, int32_t, int64_t) \ REGISTER_HOST_METHOD(int32_t, ext_crypto_ecdsa_verify_version_1, int32_t, int64_t, int32_t) \ REGISTER_HOST_METHOD(int32_t, ext_crypto_ecdsa_verify_prehashed_version_1, int32_t, int32_t, int32_t) \ diff --git a/test/mock/core/host_api/host_api_mock.hpp b/test/mock/core/host_api/host_api_mock.hpp index 0a7bf4b8b2..6e338acdf5 100644 --- a/test/mock/core/host_api/host_api_mock.hpp +++ b/test/mock/core/host_api/host_api_mock.hpp @@ -290,7 +290,7 @@ namespace kagome::host_api { ext_crypto_ecdsa_sign_prehashed_version_1, (runtime::WasmSize key_type, runtime::WasmPointer key, - runtime::WasmSpan msg_data), + runtime::WasmPointer msg_data), (override)); MOCK_METHOD(runtime::WasmPointer,