diff --git a/Cargo.toml b/Cargo.toml index 5627c156ad..1e57ce9eee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,13 +18,13 @@ edition = "2021" homepage = "https://fuel.network/" license = "BUSL-1.1" repository = "https://github.com/FuelLabs/fuel-vm" -version = "0.31.1" +version = "0.31.2" [workspace.dependencies] -fuel-asm = { version = "0.31.1", path = "./fuel-asm", default-features = false } -fuel-crypto = { version = "0.31.1", path = "./fuel-crypto", default-features = false } -fuel-merkle = { version = "0.31.1", path = "./fuel-merkle", default-features = false } -fuel-storage = { version = "0.31.1", path = "./fuel-storage", default-features = false } -fuel-tx = { version = "0.31.1", path = "./fuel-tx", default-features = false } -fuel-types = { version = "0.31.1", path = "./fuel-types", default-features = false } +fuel-asm = { version = "0.31.2", path = "./fuel-asm", default-features = false } +fuel-crypto = { version = "0.31.2", path = "./fuel-crypto", default-features = false } +fuel-merkle = { version = "0.31.2", path = "./fuel-merkle", default-features = false } +fuel-storage = { version = "0.31.2", path = "./fuel-storage", default-features = false } +fuel-tx = { version = "0.31.2", path = "./fuel-tx", default-features = false } +fuel-types = { version = "0.31.2", path = "./fuel-types", default-features = false } bincode = { version = "1.3", default-features = false } diff --git a/fuel-tx/src/transaction/types/input.rs b/fuel-tx/src/transaction/types/input.rs index 8eb7001fef..4b26a8a2f5 100644 --- a/fuel-tx/src/transaction/types/input.rs +++ b/fuel-tx/src/transaction/types/input.rs @@ -439,6 +439,15 @@ impl Input { } } + pub fn input_data_len(&self) -> Option { + match self { + Input::MessageDataSigned(MessageDataSigned { data, .. }) + | Input::MessageDataPredicate(MessageDataPredicate { data, .. }) => Some(data.len()), + Input::MessageCoinSigned(_) | Input::MessageCoinPredicate(_) => Some(0), + _ => None, + } + } + pub fn input_predicate(&self) -> Option<&[u8]> { match self { Input::CoinPredicate(CoinPredicate { predicate, .. }) diff --git a/fuel-vm/src/interpreter/metadata.rs b/fuel-vm/src/interpreter/metadata.rs index e8e947e16a..e9c877af41 100644 --- a/fuel-vm/src/interpreter/metadata.rs +++ b/fuel-vm/src/interpreter/metadata.rs @@ -331,9 +331,8 @@ impl GTFInput<'_, Tx> { .inputs() .get(b) .filter(|i| i.is_message()) - .and_then(Input::input_data) - .map(|d| d.len() as Word) - .ok_or(PanicReason::InputNotFound)?, + .and_then(Input::input_data_len) + .ok_or(PanicReason::InputNotFound)? as Word, GTFArgs::InputMessagePredicateLength => tx .inputs() .get(b)