Hi,
I am a blockchain researcher who is new to Substrate and Polkadot platform. I wanted to add contracts-pallet to my runtime, but I get errors when I want to config my runtime/src/lib.rs file.
Below is the code snippet I add to my lib.rs file:
type Time: Time;
type Randomness: Randomness<Self::Hash, BlockNumberFor<Self>>;
type Currency: Inspect<Self::AccountId> + Mutate<Self::AccountId> + MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type RuntimeCall: Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo + Decode + IsType<<Self as Config>::RuntimeCall>;
type RuntimeHoldReason: From<HoldReason>;
type CallFilter: Contains<<Self as Config>::RuntimeCall>;
type WeightPrice: Convert<Weight, <<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type WeightInfo: WeightInfo;
type ChainExtension: ChainExtension<Self> + Default;
type Schedule: Get<Schedule<Self>>;
type CallStack: Array<Item = Frame<Self>>;
type DepositPerByte: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type DefaultDepositLimit: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type DepositPerItem: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type CodeHashLockupDepositPercent: Get<Perbill>;
type AddressGenerator: AddressGenerator<Self>;
type MaxCodeLen: Get<u32>;
type MaxStorageKeyLen: Get<u32>;
type MaxTransientStorageSize: Get<u32>;
type MaxDelegateDependencies: Get<u32>;
type UnsafeUnstableInterface: Get<bool>;
type MaxDebugBufferLen: Get<u32>;
type UploadOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type InstantiateOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = Self::AccountId>;
type Migrations: MigrateSequence;
type Debug: Debugger<Self>;
type Environment: Get<Environment<Self>>;
type ApiVersion: Get<ApiVersion>;
type Xcm: Controller<OriginFor<Self>, <Self as Config>::RuntimeCall, BlockNumberFor<Self>>;
}
When I add this to my file, I get this error:
|
280 | type Migrations: MigrateSequence;
| ^^^^^^^^^^^^^^^
error: associated type in impl
without body
→ /home/saeed/Desktop/substrate-node-template/runtime/src/lib.rs:281:5
|
281 | type Debug: Debugger;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: provide a definition for the type: = <type>;
.
.
.
.
.
.
.
.
.
Some errors have detailed explanations: E0152, E0405, E0412.
For more information about an error, try rustc --explain E0152
.
error: could not compile node-template-runtime
(lib) due to 120 previous errors.
For pretty much all the types defined here, an error is thrown. What should I do?