Skip to content

Commit

Permalink
[fix] Fix mint types (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhath-labs authored Feb 14, 2024
1 parent 325e095 commit e546b15
Show file tree
Hide file tree
Showing 23 changed files with 1,220 additions and 392 deletions.
27 changes: 1 addition & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ split-debuginfo = "unpacked"
members = [
'parachain',
'runtime/bitgreen',
'pallets/*',
'pallets/carbon-credits',
'pallets/assets',
'pallets/dex',
'pallets/general-storage',
'pallets/kyc',
'pallets/vesting-contract',
'pallets/transaction-pause',
'primitives',
]
exclude = ['rpc']
1 change: 1 addition & 0 deletions pallets/assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
primitives = { package = 'bitgreen-primitives', path = '../../primitives', default-features = false }

[dev-dependencies]
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand Down
6 changes: 6 additions & 0 deletions pallets/assets/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,12 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
maybe_need_admin: Option<T::AccountId>,
f: TransferFlags,
) -> Result<T::Balance, DispatchError> {
T::VerifyCarbonAssetTransfer::is_transfer_allowed(
source.clone(),
dest.clone(),
id.clone(),
amount.clone(),
)?;
let (balance, died) =
Self::transfer_and_die(id.clone(), source, dest, amount, maybe_need_admin, f)?;
if let Some(Remove) = died {
Expand Down
8 changes: 8 additions & 0 deletions pallets/assets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ use frame_support::{
},
};
use frame_system::Config as SystemConfig;
use primitives::VerifyCarbonAssetTransfer;

pub use pallet::*;
pub use weights::WeightInfo;
Expand Down Expand Up @@ -320,6 +321,13 @@ pub mod pallet {
/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;

/// Carbon asset transfer verifier
type VerifyCarbonAssetTransfer: VerifyCarbonAssetTransfer<
Self::AccountId,
Self::AssetId,
Self::Balance,
>;

/// Helper trait for benchmarks.
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper: BenchmarkHelper<Self::AssetIdParameter>;
Expand Down
1 change: 1 addition & 0 deletions pallets/assets/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl Config for Test {
type CallbackHandle = AssetsCallbackHandle;
type Extra = ();
type RemoveItemsLimit = ConstU32<5>;
type VerifyCarbonAssetTransfer = ();
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}
Expand Down
Loading

0 comments on commit e546b15

Please sign in to comment.