0

实现资产托盘时出现此运行时错误

1002:验证错误:运行时错误:执行失败:ApiError(FailedToConvertParameter

有关错误的更多信息:

1002:验证错误:运行时错误:执行失败:ApiError(FailedToConvertParameter {函数:“validate_transaction”,参数:“tx”,错误:错误{原因:某些(错误{原因:某些(错误{原因:无,描述:“没有足够的数据来填充缓冲区”}),描述:“无法解码Call::create.2”}),描述:“无法解码Call::Assets.0”}}):RuntimeApi,执行失败:ApiError,FailedToConvertParameter { 函数:“validate_transaction”,参数:“tx ", error: Error { cause: Some, Error { cause: Some, Error { cause: None, desc: "没有足够的数据来填充缓冲区" }, desc: "不能……</p>

资产托盘配置特征的实现:

lib.rs

parameter_types!{
    pub const StringLimit: u32 = 50;
    pub const MetadataDepositBase: Balance = 2 * DOLLARS ;
    pub const MetaDataDepositPerByte: Balance = 2 * DOLLARS ;
    //pub const AssetDepositBase: Balance = 2;
    pub const AssetDepositPerZombie: Balance = 2 * DOLLARS;
    pub const AssetDeposit: Balance = 2 * DOLLARS ;
    pub const ApprovalDeposit: Balance = 2 * DOLLARS ;
}


impl pallet_assets::pallet::Config for Runtime {
    // The ubiquitous event type.
    type Event= Event;
    type Balance= Balance;
    type AssetId= u32;
    type Currency = Balances;
    type ForceOrigin = EnsureRoot<AccountId>;
    type AssetDeposit = AssetDeposit;
    type ApprovalDeposit = ApprovalDeposit;
    type StringLimit = StringLimit;  
    //type AssetDepositBase=AssetDepositBase;
    //type AssetDepositPerZombie= AssetDepositPerZombie;
    type MetadataDepositBase = MetadataDepositBase;
    type MetadataDepositPerByte = MetaDataDepositPerByte;
    type Freezer = ();
    type Extra = ();
    type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>;
  
}
4

0 回答 0