pub fn save<T: Trait>(
	original_code: Vec<u8>,
	schedule: &Schedule,
) -> Result<HashFor<T>, &'static str> {
	let prefab_module = prepare::prepare_contract::<Env>(&original_code, schedule)?;
	let code_hash = T::Hashing::hash(&original_code);

	<CodeStorage<T>>::insert(code_hash, prefab_module);
	<PristineCode<T>>::insert(code_hash, original_code);

	Ok(code_hash)
}
/// Put code in the storage. The hash of code is used as a key and is returned
/// as a result of this function.
///
/// This function instruments the given code and caches it in the storage.
Put code in the storage. The hash of code is used as a key and is returned
as a result of this function.

This function instruments the given code and caches it in the storage.
Put code in the storage . The hash of code is used as a key and is returned as a result of this function . This function instruments the given code and caches it in the storage .
pub fn save<T: Trait>(
	original_code: Vec<u8>,
	schedule: &Schedule,
) -> Result<HashFor<T>, &'static str> {
	let prefab_module = prepare::prepare_contract::<Env>(&original_code, schedule)?;
	let code_hash = T::Hashing::hash(&original_code);
	<CodeStorage<T>>::insert(code_hash, prefab_module);
	<PristineCode<T>>::insert(code_hash, original_code);
	Ok(code_hash)
}
pub fn save < T : Trait > ( original_code : Vec < u8 > , schedule : & Schedule , ) -> Result < HashFor < T > , & ' static str > { let prefab_module = prepare :: prepare_contract :: < Env > ( & original_code , schedule ) ? ; let code_hash = T :: Hashing :: hash ( & original_code ) ; < CodeStorage < T > > :: insert ( code_hash , prefab_module ) ; < PristineCode < T > > :: insert ( code_hash , original_code ) ; Ok ( code_hash ) }
Put code in the storage.
Put code in the storage .
original_code
Vec<u8>
schedule
&Schedule
original_code
Vec<u8>
schedule
&Schedule