From f1e80a8c501303aaefe8b7f8be33b6165bd816c2 Mon Sep 17 00:00:00 2001 From: Nimrod Weiss Date: Wed, 4 Dec 2024 13:54:03 +0200 Subject: [PATCH] feat(native_blockifier): allow deserialization of python l1_data_gas --- crates/native_blockifier/src/py_transaction.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/native_blockifier/src/py_transaction.rs b/crates/native_blockifier/src/py_transaction.rs index b29ee76377..65b89e81a1 100644 --- a/crates/native_blockifier/src/py_transaction.rs +++ b/crates/native_blockifier/src/py_transaction.rs @@ -30,6 +30,7 @@ pub(crate) const PY_TX_PARSING_ERR: &str = "Failed parsing Py transaction."; #[derive(Clone, Eq, Ord, PartialEq, PartialOrd)] pub enum PyResource { L1Gas, + L1DataGas, L2Gas, } @@ -38,6 +39,7 @@ impl From for Resource { match py_resource { PyResource::L1Gas => Resource::L1Gas, PyResource::L2Gas => Resource::L2Gas, + PyResource::L1DataGas => Resource::L1DataGas, } } } @@ -48,6 +50,7 @@ impl FromPyObject<'_> for PyResource { match resource_name { "L1_GAS" => Ok(PyResource::L1Gas), "L2_GAS" => Ok(PyResource::L2Gas), + "L1_DATA_GAS" => Ok(PyResource::L1DataGas), _ => Err(PyValueError::new_err(format!("Invalid resource: {resource_name}"))), } }