fn check_encoded_size(&self, max_tx_size: usize) -> Result<(), SerializationTransactionError> {
        // since `abi_encoding_len` returns 32-byte words multiplication on 32 is needed
        let tx_size = self.abi_encoding_len() * 32;
        if tx_size > max_tx_size {
            return Err(SerializationTransactionError::OversizedData(
                max_tx_size,
                tx_size,
            ));
        };
        Ok(())
    }
Ensures that encoded transaction size is not greater than `max_tx_size`.
core/lib/types/src/transaction_request.rs