部署简单合约
#[near_bindgen]
impl Contract {
pub fn hello() -> String {
String::from("hello")
}
pub fn num() -> u8 {
8
}
}
试图通过调用视图方法
near view crossword.hilonom.testnet num
并且有错误
View call: crossword.hilonom.testnet.num()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(HostError(ProhibitedInView { method_name: "attached_deposit" })).
{
"error": "wasm execution failed with error: FunctionCallError(HostError(ProhibitedInView { method_name: \"attached_deposit\" }))",
"logs": [],
"block_height": 74645352,
"block_hash": "2eoywDD9s62T3swiJCNuXGwwxjhGFdFJuxTiMZ29JFxY"
}
我怎样才能避免这个错误?