Skip to content

Commit

Permalink
Accept None chain ID
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas committed Dec 11, 2020
1 parent 8932a86 commit 2ca1d1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ impl<T: Trait> frame_support::unsigned::ValidateUnsigned for Module<T> {

fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity {
if let Call::transact(transaction) = call {
if transaction.signature.chain_id().unwrap_or_default() != T::ChainId::get() {
return InvalidTransaction::Custom(TransactionValidationError::InvalidChainId as u8).into();
if let Some(chain_id) = transaction.signature.chain_id() {
if chain_id != T::ChainId::get() {
return InvalidTransaction::Custom(TransactionValidationError::InvalidChainId as u8).into();
}
}

let origin = Self::recover_signer(&transaction)
Expand Down

1 comment on commit 2ca1d1b

@sorpaas
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed making this a PR. Sorry! For anyone wondering about this commit -- accept None chain ID is the default behavior in Ethereum.

Please sign in to comment.