pub fn hash(&self) -> anyhow::Result<H256> {
        Ok(match self {
            Self::L1 {
                tx, factory_deps, ..
            } => {
                // verify data integrity
                let factory_deps_hashes: Vec<_> = factory_deps
                    .iter()
                    .map(|b| BytecodeHash::for_bytecode(b).value_u256())
                    .collect();
                anyhow::ensure!(tx.factory_deps == factory_deps_hashes);
                tx.hash()
            }
            Self::L2(raw) => TransactionRequest::from_bytes_unverified(raw)?.1,
        })
    }
Canonical hash of the transaction.
Returns an error if data is inconsistent.
Note that currently not all of the transaction
content is included in the hash.
core/lib/types/src/abi.rs