0

Got this runtime error while implementing assets pallet

1002: Verification Error: Runtime error: Execution failed: ApiError(FailedToConvertParameter

More info about error:

1002: Verification Error: Runtime error: Execution failed: ApiError(FailedToConvertParameter { function: "validate_transaction", parameter: "tx", error: Error { cause: Some(Error { cause: Some(Error { cause: None, desc: "Not enough data to fill buffer" }), desc: "Could not decode Call::create.2" }), desc: "Could not decode Call::Assets.0" } }): RuntimeApi, Execution failed: ApiError, FailedToConvertParameter { function: "validate_transaction", parameter: "tx", error: Error { cause: Some, Error { cause: Some, Error { cause: None, desc: "Not enough data to fill buffer" }, desc: "Could not…

Implementation of assets pallet config trait:

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>;
  
}
James Z
  • 12,209
  • 10
  • 24
  • 44
  • this looks like an API error. Can you provide the way you are sending this extrinsic? – Nuke Jul 20 '21 at 17:37
  • Sure .... I will head over to polkadot.js-->Developer Tab-->Extrinsics-->In the drop down box available i will select assets – Makam Aravind Jul 21 '21 at 03:46
  • The API many have been updated is the version of your node. It is best to match the dependencies of Polkadot for substrate, typically that is the master branch of substrate. what node are you running? One based on a version of the node template? – Nuke Jul 21 '21 at 22:29
  • Seach for other 1002 errors here on SO, and you will find many are due to mismatched or undefined types: https://polkadot.js.org/docs/api/start/types.extend – Nuke Jul 21 '21 at 22:30
  • @NukeManDan in substrate node for assets pallet it used v4.0.0 and if i follow the same way I am getting internal dependency errors. So , I have changed all pallets and dependencies version to v4.0.0 and then also i am getting errors. Please tell me a way to resolve this error in substrate node template. – Makam Aravind Jul 23 '21 at 04:53

0 Answers0