Closed
Description
Describe the bug
Added library to a smart contract that is compatible with wasm32-unknown-unknown.
Deploy it to the blockchain and call a single method. Virtual machine initialization failed with a FunctionCallError(CompilationError(PrepareError(Instantiate)))
To Reproduce
// lib.rs
use near_sdk::{
borsh::{self, BorshDeserialize, BorshSerialize},
};
use vodozemac::megolm::{GroupSession, InboundGroupSession, SessionKey};
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, Default)]
pub struct Key {}
#[near_bindgen]
impl Key {
pub fn key(&self) -> String {
"Name".to_owned()
}
}
# Cargo.toml
[package]
name = "key"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
near-sdk = "4.0.0"
near-contract-standards = "4.0.0"
near-units = "0.2.0"
serde = { version = "1", features = ["derive"] }
vodozemac = { version = "0.2.0", features = ["js"] }
Deploy a smart contract and call a key function.
near view <accountId> key
Output: wasm execution failed with error: FunctionCallError(CompilationError(PrepareError(Instantiate)))
Expected behavior
At least tell where exactly the error happens, which part of the used libraries is not compatible
Version (please complete the following information):
- rust version 1.62.1
- testnet