substrate-node-template
substrate-node-template copied to clipboard
improve(node): update clone client to avoid borrowed
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 :)