multiasset.rs 30 KiB
Newer Older
			few_assets.push((GeneralIndex(i as u128), 1u128).into());
		}
		let encoded = few_assets.encode();
		assert!(MultiAssets::decode(&mut &encoded[..]).is_ok());

		// Having lots of different assets will not work
		let mut too_many_different_assets: MultiAssets = Vec::new().into();
		for i in 0..MAX_ITEMS_IN_MULTIASSETS + 1 {
			too_many_different_assets.push((GeneralIndex(i as u128), 1u128).into());
		}
		let encoded = too_many_different_assets.encode();
		assert!(MultiAssets::decode(&mut &encoded[..]).is_err());
	}
Gavin Wood's avatar
Gavin Wood committed
}