fn on_finalize(_n: T::BlockNumber) {
			for ((asset_1, asset_2), count) in ExchangeAssetsIntentionCount::<T>::iter() {
				// If no intention registered for asset1/2, move onto next one
				if count == 0u32 {
					continue;
				}
				let pair = AssetPair {
					asset_in: asset_1,
					asset_out: asset_2,
				};

				let pair_account = T::AMMPool::get_pair_id(pair);

				let asset_a_ins = <ExchangeAssetsIntentions<T>>::get((asset_2, asset_1));
				let asset_b_ins = <ExchangeAssetsIntentions<T>>::get((asset_1, asset_2));

				//TODO: we can short circuit here if nothing in asset_b_sells and just resolve asset_a sells.

				Self::process_exchange_intentions(&pair_account, &asset_a_ins, &asset_b_ins);
			}

			ExchangeAssetsIntentionCount::<T>::remove_all();
			ExchangeAssetsIntentions::<T>::remove_all();
		}
/// Finalize and resolve all registered intentions.
/// Group/match intentions which can be directly traded.
Finalize and resolve all registered intentions.
Group/match intentions which can be directly traded.
Finalize and resolve all registered intentions . Group / match intentions which can be directly traded .
fn on_finalize(_n: T::BlockNumber) {
			for ((asset_1, asset_2), count) in ExchangeAssetsIntentionCount::<T>::iter() {
				// If no intention registered for asset1/2, move onto next one
				if count == 0u32 {
					continue;
				}
				let pair = AssetPair {
					asset_in: asset_1,
					asset_out: asset_2,
				};
				let pair_account = T::AMMPool::get_pair_id(pair);
				let asset_a_ins = <ExchangeAssetsIntentions<T>>::get((asset_2, asset_1));
				let asset_b_ins = <ExchangeAssetsIntentions<T>>::get((asset_1, asset_2));
				//TODO: we can short circuit here if nothing in asset_b_sells and just resolve asset_a sells.
				Self::process_exchange_intentions(&pair_account, &asset_a_ins, &asset_b_ins);
			}
			ExchangeAssetsIntentionCount::<T>::remove_all();
			ExchangeAssetsIntentions::<T>::remove_all();
		}
fn on_finalize ( _n : T :: BlockNumber ) { for ( ( asset_1 , asset_2 ) , count ) in ExchangeAssetsIntentionCount :: < T > :: iter ( ) { // If no intention registered for asset1/2, move onto next one if count == 0u32 { continue ; } let pair = AssetPair { asset_in : asset_1 , asset_out : asset_2 , } ; let pair_account = T :: AMMPool :: get_pair_id ( pair ) ; let asset_a_ins = < ExchangeAssetsIntentions < T > > :: get ( ( asset_2 , asset_1 ) ) ; let asset_b_ins = < ExchangeAssetsIntentions < T > > :: get ( ( asset_1 , asset_2 ) ) ; //TODO: we can short circuit here if nothing in asset_b_sells and just resolve asset_a sells. Self :: process_exchange_intentions ( & pair_account , & asset_a_ins , & asset_b_ins ) ; } ExchangeAssetsIntentionCount :: < T > :: remove_all ( ) ; ExchangeAssetsIntentions :: < T > :: remove_all ( ) ; }
Finalize and resolve all registered intentions.
Finalize and resolve all registered intentions .
_n
T::BlockNumber