substrate-node-template icon indicating copy to clipboard operation
substrate-node-template copied to clipboard

improve(node): update clone client to avoid borrowed

Open rv64m opened this issue 3 years ago • 0 comments

In this description of Substrate tutorials

module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(Contracts::new(client.clone()).into_rpc())?; // Add this line

However, client does not actually have clone, and there will got value borrowed here after move error when compiling.

https://github.com/substrate-developer-hub/substrate-node-template/blob/6a8b2b12371395979099d2c79ccc1860531b0449/node/src/rpc.rs#L49

So, I want to add client.clone() to avoid this error :)

rv64m avatar Sep 01 '22 06:09 rv64m