Trait IOContext
Source pub trait IOContext {
type Offchain: GetScriptsData + InitGovernance + GetDParam + UpsertDParam + Deregister + Register + GetPermissionedCandidates + UpsertPermissionedCandidates;
Show 19 methods
// Required methods
fn run_command(&self, cmd: &str) -> Result<String>;
fn current_executable(&self) -> Result<String>;
fn print(&self, msg: &str);
fn eprint(&self, msg: &str);
fn enewline(&self);
fn prompt(&self, prompt: &str, default: Option<&str>) -> String;
fn prompt_yes_no(&self, prompt: &str, default: bool) -> bool;
fn prompt_multi_option(&self, msg: &str, options: Vec<String>) -> String;
fn write_file(&self, path: &str, content: &str);
fn new_tmp_file(&self, content: &str) -> TempPath;
fn new_tmp_dir(&self) -> PathBuf;
fn read_file(&self, path: &str) -> Option<String>;
fn file_exists(&self, path: &str) -> bool;
fn list_directory(&self, path: &str) -> Result<Option<Vec<String>>>;
fn delete_file(&self, path: &str) -> Result<()>;
fn set_env_var(&self, key: &str, value: &str);
fn current_timestamp(&self) -> Timestamp;
fn ogmios_rpc(
&self,
config: &ServiceConfig,
req: OgmiosRequest,
) -> Result<OgmiosResponse>;
fn offchain_impl(
&self,
ogmios_config: &ServiceConfig,
) -> Result<Self::Offchain>;
}
It should implement all the required traits for offchain operations