fn apply_extrinsic_with_len(uxt: Block::Extrinsic, encoded_len: usize, to_note: Option<Vec<u8>>) -> result::Result<internal::ApplyOutcome, internal::ApplyError> {
		// Verify the signature is good.
		let xt = uxt.check(&Default::default()).map_err(internal::ApplyError::BadSignature)?;

		// Check the size of the block if that extrinsic is applied.
		if <system::Module<System>>::all_extrinsics_len() + encoded_len as u32 > internal::MAX_TRANSACTIONS_SIZE {
			return Err(internal::ApplyError::FullBlock);
		}

		if let (Some(sender), Some(index)) = (xt.sender(), xt.index()) {
			// check index
			let expected_index = <system::Module<System>>::account_nonce(sender);
			if index != &expected_index { return Err(
				if index < &expected_index { internal::ApplyError::Stale } else { internal::ApplyError::Future }
			) }

			// pay any fees.
			Payment::make_payment(sender, encoded_len).map_err(|_| internal::ApplyError::CantPay)?;

			// AUDIT: Under no circumstances may this function panic from here onwards.

			// increment nonce in storage
			<system::Module<System>>::inc_account_nonce(sender);
		}

		// make sure to `note_extrinsic` only after we know it's going to be executed
		// to prevent it from leaking in storage.
		if let Some(encoded) = to_note {
			<system::Module<System>>::note_extrinsic(encoded);
		}

		// decode parameters and dispatch
		let (f, s) = xt.deconstruct();
		let r = f.dispatch(s.into());
		<system::Module<System>>::note_applied_extrinsic(&r, encoded_len as u32);

		r.map(|_| internal::ApplyOutcome::Success).or_else(|e| match e {
			primitives::BLOCK_FULL => Err(internal::ApplyError::FullBlock),
			e => Ok(internal::ApplyOutcome::Fail(e))
		})
	}
/// Actually apply an extrinsic given its `encoded_len`; this doesn't note its hash.
Actually apply an extrinsic given its `encoded_len`; this doesn't note its hash.
Actually apply an extrinsic given its ` encoded_len ` ; this doesn ' t note its hash .
fn apply_extrinsic_with_len(uxt: Block::Extrinsic, encoded_len: usize, to_note: Option<Vec<u8>>) -> result::Result<internal::ApplyOutcome, internal::ApplyError> {
		// Verify the signature is good.
		let xt = uxt.check(&Default::default()).map_err(internal::ApplyError::BadSignature)?;
		// Check the size of the block if that extrinsic is applied.
		if <system::Module<System>>::all_extrinsics_len() + encoded_len as u32 > internal::MAX_TRANSACTIONS_SIZE {
			return Err(internal::ApplyError::FullBlock);
		}
		if let (Some(sender), Some(index)) = (xt.sender(), xt.index()) {
			// check index
			let expected_index = <system::Module<System>>::account_nonce(sender);
			if index != &expected_index { return Err(
				if index < &expected_index { internal::ApplyError::Stale } else { internal::ApplyError::Future }
			) }
			// pay any fees.
			Payment::make_payment(sender, encoded_len).map_err(|_| internal::ApplyError::CantPay)?;
			// AUDIT: Under no circumstances may this function panic from here onwards.
			// increment nonce in storage
			<system::Module<System>>::inc_account_nonce(sender);
		}
		// make sure to `note_extrinsic` only after we know it's going to be executed
		// to prevent it from leaking in storage.
		if let Some(encoded) = to_note {
			<system::Module<System>>::note_extrinsic(encoded);
		}
		// decode parameters and dispatch
		let (f, s) = xt.deconstruct();
		let r = f.dispatch(s.into());
		<system::Module<System>>::note_applied_extrinsic(&r, encoded_len as u32);
		r.map(|_| internal::ApplyOutcome::Success).or_else(|e| match e {
			primitives::BLOCK_FULL => Err(internal::ApplyError::FullBlock),
			e => Ok(internal::ApplyOutcome::Fail(e))
		})
	}
fn apply_extrinsic_with_len ( uxt : Block :: Extrinsic , encoded_len : usize , to_note : Option < Vec < u8 > > ) -> result :: Result < internal :: ApplyOutcome , internal :: ApplyError > { // Verify the signature is good. let xt = uxt . check ( & Default :: default ( ) ) . map_err ( internal :: ApplyError :: BadSignature ) ? ; // Check the size of the block if that extrinsic is applied. if < system :: Module < System > > :: all_extrinsics_len ( ) + encoded_len as u32 > internal :: MAX_TRANSACTIONS_SIZE { return Err ( internal :: ApplyError :: FullBlock ) ; } if let ( Some ( sender ) , Some ( index ) ) = ( xt . sender ( ) , xt . index ( ) ) { // check index let expected_index = < system :: Module < System > > :: account_nonce ( sender ) ; if index != & expected_index { return Err ( if index < & expected_index { internal :: ApplyError :: Stale } else { internal :: ApplyError :: Future } ) } // pay any fees. Payment :: make_payment ( sender , encoded_len ) . map_err ( | _ | internal :: ApplyError :: CantPay ) ? ; // AUDIT: Under no circumstances may this function panic from here onwards. // increment nonce in storage < system :: Module < System > > :: inc_account_nonce ( sender ) ; } // make sure to `note_extrinsic` only after we know it's going to be executed // to prevent it from leaking in storage. if let Some ( encoded ) = to_note { < system :: Module < System > > :: note_extrinsic ( encoded ) ; } // decode parameters and dispatch let ( f , s ) = xt . deconstruct ( ) ; let r = f . dispatch ( s . into ( ) ) ; < system :: Module < System > > :: note_applied_extrinsic ( & r , encoded_len as u32 ) ; r . map ( | _ | internal :: ApplyOutcome :: Success ) . or_else ( | e | match e { primitives :: BLOCK_FULL => Err ( internal :: ApplyError :: FullBlock ) , e => Ok ( internal :: ApplyOutcome :: Fail ( e ) ) } ) }
Actually apply an extrinsic given its `encoded_len`; this doesn't note its hash.
Actually apply an extrinsic given its ` encoded_len ` ; this doesn ' t note its hash .
uxt
Block::Extrinsic
encoded_len
usize
to_note
Option<Vec<u8>>
uxt
Block::Extrinsic
encoded_len
usize
to_note
Option<Vec<u8>>