git.delta.rocks / unique-network / refs/commits / 53f656702159

difftreelog

Add instrcutions for re-enabling Ink! contracts

Greg Zaitsev2021-07-08parent: #b18a5cf.patch.diff
in: master

1 file changed

modifiedREADME.mddiffbeforeafterboth
250### Check code style in tests250### Check code style in tests
251```bash251```bash
252cd tests && yarn eslint --ext .ts,.js src/252cd tests && yarn eslint --ext .ts,.js src/
253```253```
254
255## Re-Enabling Ink! Contracts
256
257Uncomment following lies:
2581. In node/rpc/Cargo.toml
259```
260# pallet-contracts-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
261```
262
2632. In node/rpc/src/lib.rs
264```
265// C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber, Hash>,
266...
267// use pallet_contracts_rpc::{Contracts, ContractsApi};
268...
269// io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone())));
270
271```
272
2733. In runtime/Cargo.toml
274```
275 # 'pallet-contracts/std',
276 # 'pallet-contracts-primitives/std',
277 # 'pallet-contracts-rpc-runtime-api/std',
278 # 'pallet-contract-helpers/std',
279...
280 # [dependencies.pallet-contracts]
281 # git = 'https://github.com/paritytech/substrate.git'
282 # default-features = false
283 # branch = 'polkadot-v0.9.7'
284 # version = '3.0.0'
285
286 # [dependencies.pallet-contracts-primitives]
287 # git = 'https://github.com/paritytech/substrate.git'
288 # default-features = false
289 # branch = 'polkadot-v0.9.7'
290 # version = '3.0.0'
291
292 # [dependencies.pallet-contracts-rpc-runtime-api]
293 # git = 'https://github.com/paritytech/substrate.git'
294 # default-features = false
295 # branch = 'polkadot-v0.9.7'
296 # version = '3.0.0'
297...
298 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
299```
300
3014. runtime/src/lib.rs
302```
303// use pallet_contracts::weights::WeightInfo;
304...
305// use pallet_contracts::chain_extension::UncheckedFrom;
306...
307// pub use pallet_timestamp::Call as TimestampCall;
308...
309// mod chain_extension;
310// use crate::chain_extension::{NFTExtension, Imbalance};
311...
312/*
313parameter_types! {
314 pub TombstoneDeposit: Balance = deposit(
315 ...
316}
317*/
318...
319//pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
320...
321// impl pallet_contract_helpers::Config for Runtime {}
322...
323// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
324...
325// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},
326...
327//pallet_contract_helpers::ContractHelpersExtension<Runtime>,
328...
329/*
330 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>
331 for Runtime
332 {
333 ...
334 }
335*/
336
337```
338