diff --git a/crates/rs-macro/README.md b/crates/rs-macro/README.md index e407da6..93e5206 100644 --- a/crates/rs-macro/README.md +++ b/crates/rs-macro/README.md @@ -116,7 +116,7 @@ The expansion of the macros generates the following: .await .expect("Call to `get_my_struct` failed"); ``` -- For each **external**, the contract type contains a function with the same arguments. Calling the function return a `starknet::accounts::Execution` type from `starknet-rs`, which allows you to completly customize the fees, doing only a simulation etc... To actually send the transaction, you use the `send()` method on the `Execution` struct. You can find the [associated methods with this struct on starknet-rs repo](https://github.com/xJonathanLEI/starknet-rs/blob/0df9ad3417a5f10d486348737fe75659ca4bcfdc/starknet-accounts/src/account/execution.rs#L118). +- For each **external**, the contract type contains a function with the same arguments. Calling the function return a `starknet::accounts::ExecutionV1` type from `starknet-rs`, which allows you to completly customize the fees, doing only a simulation etc... To actually send the transaction, you use the `send()` method on the `ExecutionV1` struct. You can find the [associated methods with this struct on starknet-rs repo](https://github.com/xJonathanLEI/starknet-rs/blob/0df9ad3417a5f10d486348737fe75659ca4bcfdc/starknet-accounts/src/account/execution.rs#L118). ```rust let my_struct = MyStruct { @@ -135,7 +135,7 @@ The expansion of the macros generates the following: .expect("Call to `set_my_struct` failed"); ``` - To support multicall, currently `Execution` type does not expose the `Call`s. + To support multicall, currently `ExecutionV1` type does not expose the `Call`s. To circumvey this, for each of the external function an other function with `_getcall` suffix is generated: ```rust diff --git a/crates/rs/src/expand/function.rs b/crates/rs/src/expand/function.rs index 88f3658..a360d8a 100644 --- a/crates/rs/src/expand/function.rs +++ b/crates/rs/src/expand/function.rs @@ -12,7 +12,7 @@ //! based on it's state mutability found in the ABI itself. //! //! * `FCall` - Struct for readonly functions. -//! * `Execution` - Struct from starknet-rs for transaction based functions. +//! * `ExecutionV1` - Struct from starknet-rs for transaction based functions. use cainome_parser::tokens::{Function, FunctionOutputKind, StateMutability, Token}; use proc_macro2::TokenStream as TokenStream2; use quote::quote; @@ -102,7 +102,7 @@ impl CairoFunction { } }, StateMutability::External => { - // For now, Execution can't return the list of calls. + // For now, ExecutionV1 can't return the list of calls. // This would be helpful to easily access the calls // without having to add `_getcall()` method. // If starknet-rs provides a way to get the calls, @@ -133,7 +133,7 @@ impl CairoFunction { pub fn #func_name_ident( &self, #(#inputs),* - ) -> starknet::accounts::Execution { + ) -> starknet::accounts::ExecutionV1 { use #ccs::CairoSerde; let mut __calldata = vec![]; @@ -145,7 +145,7 @@ impl CairoFunction { calldata: __calldata, }; - self.account.execute(vec![__call]) + self.account.execute_v1(vec![__call]) } } } diff --git a/examples/simple_get_set.rs b/examples/simple_get_set.rs index a5de7ec..e6a8aa8 100644 --- a/examples/simple_get_set.rs +++ b/examples/simple_get_set.rs @@ -109,7 +109,7 @@ async fn main() { // the full control from starknet-rs library. let _tx_res = contract .account - .execute(vec![set_a_call, set_b_call]) + .execute_v1(vec![set_a_call, set_b_call]) .send() .await .expect("Multicall failed");