anvil_zksync_api_decl/namespaces/
config.rs

1use anvil_zksync_types::{LogLevel, ShowGasDetails, ShowStorageLogs, ShowVMDetails};
2use jsonrpsee::core::RpcResult;
3use jsonrpsee::proc_macros::rpc;
4
5#[rpc(server, namespace = "config")]
6pub trait ConfigNamespace {
7    /// Get the InMemoryNodeInner's current_timestamp property
8    ///
9    /// # Returns
10    /// The current `current_timestamp` value for the InMemoryNodeInner.
11    #[method(name = "getCurrentTimestamp")]
12    async fn get_current_timestamp(&self) -> RpcResult<u64>;
13
14    /// Set show_storage_logs for the InMemoryNodeInner
15    ///
16    /// # Parameters
17    /// - `value`: A ShowStorageLogs enum to update show_storage_logs to
18    ///
19    /// # Returns
20    /// The updated/current `show_storage_logs` value for the InMemoryNodeInner.
21    #[method(name = "setShowStorageLogs")]
22    async fn set_show_storage_logs(&self, value: ShowStorageLogs) -> RpcResult<String>;
23
24    /// Set show_vm_details for the InMemoryNodeInner
25    ///
26    /// # Parameters
27    /// - `value`: A ShowVMDetails enum to update show_vm_details to
28    ///
29    /// # Returns
30    /// The updated/current `show_vm_details` value for the InMemoryNodeInner.
31    #[method(name = "setShowVmDetails")]
32    async fn set_show_vm_details(&self, value: ShowVMDetails) -> RpcResult<String>;
33
34    /// Set show_gas_details for the InMemoryNodeInner
35    ///
36    /// # Parameters
37    /// - `value`: A ShowGasDetails enum to update show_gas_details to
38    ///
39    /// # Returns
40    /// The updated/current `show_gas_details` value for the InMemoryNodeInner.
41    #[method(name = "setShowGasDetails")]
42    async fn set_show_gas_details(&self, value: ShowGasDetails) -> RpcResult<String>;
43
44    /// Set show_node_config for the InMemoryNodeInner
45    ///
46    /// # Parameters
47    /// - `value`: A bool to update show_node_config to
48    ///
49    /// # Returns
50    /// The updated/current `show_node_config` value for the InMemoryNodeInner.
51    #[method(name = "setShowNodeConfig")]
52    async fn set_show_node_config(&self, value: bool) -> RpcResult<bool>;
53
54    /// Set the logging for the InMemoryNodeInner
55    ///
56    /// # Parameters
57    /// - `level`: The log level to set. One of: ["trace", "debug", "info", "warn", "error"]
58    ///
59    /// # Returns
60    /// `true` if the operation succeeded, `false` otherwise.
61    #[method(name = "setLogLevel")]
62    async fn set_log_level(&self, level: LogLevel) -> RpcResult<bool>;
63
64    /// Set the logging for the InMemoryNodeInner
65    ///
66    /// # Parameters
67    /// - `level`: The logging directive to set. Example:
68    ///     * "my_crate=debug"
69    ///     * "my_crate::module=trace"
70    ///     * "my_crate=debug,other_crate=warn"
71    ///
72    /// # Returns
73    /// `true` if the operation succeeded, `false` otherwise.
74    #[method(name = "setLogging")]
75    async fn set_logging(&self, directive: String) -> RpcResult<bool>;
76}