I am developing a Pallet and I defined this type:
type BalanceOf<T> =
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
and my question is how to add value of this tmp
value with input amount:
let mut tmp:BalanceOf<T>;
pub fn mint(
owner: &T::AccountId,
amount: BalanceOf<T>,
) -> Result<[u8; 3], DispatchError> {
// How to increase tmp value with input amount
}
my Cargo.toml of pallet:
and it caused: Caused by: Dependency 'sp-runtime' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.
[package]
name = 'pallet-nft-wcn'
version = '4.0.0-dev'
description = 'FRAME pallet template for defining custom runtime logic.'
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
homepage = 'https://substrate.io/'
edition = '2021'
license = 'Unlicense'
publish = false
repository = "https://github.com/substrate-developer-hub/substrate-node-template/"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [
"derive",
] }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17"}
frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }
frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17", optional = true }
sp-runtime = { version = "5.0.0"}
serde = { version = "1.0", features = ["derive"] }
sp-std = { default-features = false, version = '3.0.0' }
[dev-dependencies]
sp-core = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }
sp-io = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }
sp-runtime = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }
[features]
default = ["std"]
std = [
"codec/std",
"scale-info/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
#[pallet::storage]