diff --git a/.cargo/config.toml b/.cargo/config.toml index ceef3bb..137250c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [env] -CONTRACTS_PATH = {value = "tests/contrats", relative = true} \ No newline at end of file +CONTRACTS_PATH = {value = "tests/contracts", relative = true} \ No newline at end of file diff --git a/build.rs b/build.rs index f5e0574..64f3df7 100644 --- a/build.rs +++ b/build.rs @@ -50,7 +50,7 @@ fn transition_to_rust_function(transition: &Transition) -> String { let transition_name_snake = transition.name.to_case(convert_case::Case::Snake); format!( r#" - pub fn {transition_name_snake}(&self {}) -> RefMut<'_, transition_call::TransitionCall> {{ + pub fn {transition_name_snake}(&self {}) -> core::cell::RefMut<'_, transition_call::TransitionCall> {{ self.{transition_name_snake}.borrow_mut().args(vec![{}]); self.{transition_name_snake}.borrow_mut() }} @@ -103,7 +103,12 @@ fn field_to_function_param(field: &Field) -> String { fn transitions_as_struct_fields(transitions: &Vec) -> String { transitions .iter() - .map(|tr| format!("{}: RefCell>,", tr.name.to_case(convert_case::Case::Snake))) + .map(|tr| { + format!( + "{}: core::cell::RefCell>,", + tr.name.to_case(convert_case::Case::Snake) + ) + }) .reduce(|acc, e| format!("{acc}\n {e}")) .unwrap_or_default() } @@ -140,7 +145,7 @@ fn transitions_to_transition_call_object(transitions: &Vec) -> Strin .iter() .map(|tr| { format!( - "{}: RefCell::new(TransitionCall::new(\"{}\", &base.address, base.client.clone())),", + "{}: core::cell::RefCell::new(TransitionCall::new(\"{}\", &base.address, base.client.clone())),", tr.name.to_case(convert_case::Case::Snake), tr.name ) diff --git a/src/contract/mod.rs b/src/contract/mod.rs index f69b769..cd66695 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -170,7 +170,6 @@ pub mod factory; pub mod scilla_value; pub mod transition_call; -use core::cell::{RefCell, RefMut}; use std::{ops::Deref, str::FromStr, sync::Arc}; pub use factory::Factory as ContractFactory;