基材:来自polkadot.js用户界面的固有外部提交错误

时间:2019-08-30 06:50:44

标签: parity substrate

编辑:当我在私有Chromium窗口(ref)中重新打开Polkadot应用程序时,错误消失了。

我正在关注substratekitties substrate tutorial,并想使用存储空间。我定义了以下模块,该模块存储可以递增或递减的counter

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帐户提交外部信息:

"extrinsic submission" tab of the polkadot.js UI

然后单击“提交(无签名)”:

"extrinsic submission" popup of the polkadot.js UI

但是提交失败并出现以下错误:RPC-CORE: submitAndWatchExtrinsic (extrinsic: Extrinsic): ExtrinsicStatus:: 1002: execution error (Error(Clie)

error after extrinsic submission

此错误是什么意思?以及如何解决?

1 个答案:

答案 0 :(得分:0)

在使用勇敢的polkadot {.js}扩展名安装时,我遇到了类似的问题(不确定是什么原因和错误),切换到Chromium(无扩展名)后,一切都很好