编辑:当我在私有 Chromium 窗口( ref)中重新打开 Polkadot 应用程序时,错误消失了。
我正在关注substratekitties 基板教程,并想玩弄存储。我已经定义了以下模块,该模块存储counter
可以递增或递减的 a。
use support::{decl_storage, decl_module, dispatch::Result, StorageValue};
use system::{ensure_inherent};
pub trait Trait: system::Trait {}
decl_storage! {
trait Store for Module<T: Trait> as KittyStorage {
pub Counter config(counter): i64;
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
/// Increment the module's counter.
fn increment(origin) -> Result {
let _sender = ensure_inherent(origin)?;
let counter = <Counter<T>>::get() ;
if counter == i64::max_value() {
Err("counter already reached its max value")
} else {
<Counter<T>>::put(counter + 1);
Ok(())
}
}
/// Decrement the module's counter
fn decrement(origin) -> Result {
let _sender = ensure_inherent(origin)?;
let counter = <Counter<T>>::get() ;
if counter == i64::min_value() {
Err("counter already reached its min value")
} else {
<Counter<T>>::put(counter - 1);
Ok(())
}
}
}
}
我想使用https://polkadot.js.org/apps UI进行尝试,但外部提交失败并显示一条神秘的错误消息,如下面的屏幕截图所示。
我先选择 Alice 账户提交外挂:
然后点击“提交(无签名)”:
但提交失败并出现以下错误:RPC-CORE: submitAndWatchExtrinsic (extrinsic: Extrinsic): ExtrinsicStatus:: 1002: execution error (Error(Clie)
这个错误是什么意思?以及如何解决?