diff --git a/contracts/os/andromeda-vfs/src/query.rs b/contracts/os/andromeda-vfs/src/query.rs index d6cb8b4d8..2457d0f8e 100644 --- a/contracts/os/andromeda-vfs/src/query.rs +++ b/contracts/os/andromeda-vfs/src/query.rs @@ -1,10 +1,9 @@ -use andromeda_std::os::vfs::{validate_path_name, SubDirBound}; +use andromeda_std::os::vfs::{validate_path_name, PathInfo, SubDirBound}; use andromeda_std::{amp::AndrAddr, error::ContractError}; use cosmwasm_std::{Addr, Deps}; use crate::state::{ - get_paths, get_subdir, resolve_pathname, resolve_symlink, PathInfo, ADDRESS_LIBRARY, - ADDRESS_USERNAME, + get_paths, get_subdir, resolve_pathname, resolve_symlink, ADDRESS_LIBRARY, ADDRESS_USERNAME, }; pub fn resolve_path(deps: Deps, path: AndrAddr) -> Result { diff --git a/contracts/os/andromeda-vfs/src/state.rs b/contracts/os/andromeda-vfs/src/state.rs index 3d824196c..34b04e8d9 100644 --- a/contracts/os/andromeda-vfs/src/state.rs +++ b/contracts/os/andromeda-vfs/src/state.rs @@ -1,19 +1,10 @@ use andromeda_std::{ amp::AndrAddr, error::ContractError, - os::vfs::{validate_path_name, SubDirBound}, + os::vfs::{validate_path_name, PathInfo, SubDirBound}, }; use cosmwasm_std::{ensure, Addr, Api, Storage}; use cw_storage_plus::{Bound, Index, IndexList, IndexedMap, Map, MultiIndex}; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] -pub struct PathInfo { - pub name: String, - pub address: Addr, - pub parent_address: Addr, - pub symlink: Option, -} pub struct PathIndices<'a> { /// PK: parent_address + component_name diff --git a/contracts/os/andromeda-vfs/src/testing/tests.rs b/contracts/os/andromeda-vfs/src/testing/tests.rs index e6369b1cb..7d2f9b71f 100644 --- a/contracts/os/andromeda-vfs/src/testing/tests.rs +++ b/contracts/os/andromeda-vfs/src/testing/tests.rs @@ -1,13 +1,13 @@ use crate::{ contract::{execute, instantiate, query}, - state::{add_pathname, resolve_pathname, PathInfo, ADDRESS_LIBRARY, ADDRESS_USERNAME, USERS}, + state::{add_pathname, resolve_pathname, ADDRESS_LIBRARY, ADDRESS_USERNAME, USERS}, }; use andromeda_std::{ amp::AndrAddr, os::{ kernel::{ExecuteMsg as KernelExecuteMsg, InternalMsg}, - vfs::{ExecuteMsg, InstantiateMsg}, + vfs::{ExecuteMsg, InstantiateMsg, PathInfo}, }, testing::mock_querier::{ mock_dependencies_custom, MOCK_APP_CONTRACT, MOCK_FAKE_KERNEL_CONTRACT, diff --git a/packages/std/src/os/vfs.rs b/packages/std/src/os/vfs.rs index 58cdad62d..dd7dfbb07 100644 --- a/packages/std/src/os/vfs.rs +++ b/packages/std/src/os/vfs.rs @@ -198,12 +198,20 @@ impl From for (Addr, String) { } } +#[cw_serde] +pub struct PathInfo { + pub name: String, + pub address: Addr, + pub parent_address: Addr, + pub symlink: Option, +} + #[cw_serde] #[derive(QueryResponses)] pub enum QueryMsg { #[returns(Addr)] ResolvePath { path: AndrAddr }, - #[returns(Vec)] + #[returns(Vec)] SubDir { path: AndrAddr, min: Option,