fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity {
		// Firstly let's check that we call the right function.
		if let Call::submit_validator_set(ref payload, ref signature) = call {
			let signature_valid =
				SignedPayload::<T>::verify::<T::AppCrypto>(payload, signature.clone());
			if !signature_valid {
				return InvalidTransaction::BadProof.into();
			}
			Self::validate_transaction_parameters(
				&payload.block_number,
				&payload.val_set,
				payload.public.clone().into_account(),
			)
		} else {
			InvalidTransaction::Call.into()
		}
	}
/// Validate unsigned call to this module.
///
/// By default unsigned transactions are disallowed, but implementing the validator
/// here we make sure that some particular calls (the ones produced by offchain worker)
/// are being whitelisted and marked as valid.
Validate unsigned call to this module.
By default unsigned transactions are disallowed, but implementing the validator
here we make sure that some particular calls (the ones produced by offchain worker)
are being whitelisted and marked as valid.
Validate unsigned call to this module . By default unsigned transactions are disallowed but implementing the validator here we make sure that some particular calls ( the ones produced by offchain worker ) are being whitelisted and marked as valid .
fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity {
		// Firstly let's check that we call the right function.
		if let Call::submit_validator_set(ref payload, ref signature) = call {
			let signature_valid =
				SignedPayload::<T>::verify::<T::AppCrypto>(payload, signature.clone());
			if !signature_valid {
				return InvalidTransaction::BadProof.into();
			}
			Self::validate_transaction_parameters(
				&payload.block_number,
				&payload.val_set,
				payload.public.clone().into_account(),
			)
		} else {
			InvalidTransaction::Call.into()
		}
	}
fn validate_unsigned ( _source : TransactionSource , call : & Self :: Call ) -> TransactionValidity { // Firstly let's check that we call the right function. if let Call :: submit_validator_set ( ref payload , ref signature ) = call { let signature_valid = SignedPayload :: < T > :: verify :: < T :: AppCrypto > ( payload , signature . clone ( ) ) ; if ! signature_valid { return InvalidTransaction :: BadProof . into ( ) ; } Self :: validate_transaction_parameters ( & payload . block_number , & payload . val_set , payload . public . clone ( ) . into_account ( ) , ) } else { InvalidTransaction :: Call . into ( ) } }
Validate unsigned call to this module.
Validate unsigned call to this module .
_source
TransactionSource
call
&Self::Call
_source
TransactionSource
call
&Self::Call