Skip to content

Allow differentiation of existent and non-existent keys in Storage.remove #290

Open
@webmaster128

Description

@webmaster128

The current interface

pub trait Storage: ReadonlyStorage {
    // ...

    fn remove(&mut self, key: &[u8]) -> StdResult<()>;
}

doen't allow to differentiate if a key existed before removal or not. If this becomes an interesting information, the trait and its implementations can be changed to

pub trait Storage: ReadonlyStorage {
    // ...

    /// Returns true iff an removal happened, i.e. the key existed before.
    fn remove(&mut self, key: &[u8]) -> StdResult<bool>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    maybestdcosmwasm-std cratevmcosmwasm-vm crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions