Skip to content

Commit

Permalink
feat(storage): add pin count attribute on Object
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Mar 8, 2023
1 parent 88b1be2 commit 04d8bff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/cw-storage/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub mod execute {
id: sha256_hash(&data.0),
owner: info.sender.clone(),
size,
pin_count: if pin { Uint128::one() } else { Uint128::zero() }
};
let res = Response::new()
.add_attribute("action", "store_object")
Expand Down
2 changes: 2 additions & 0 deletions contracts/cw-storage/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ pub struct Object {
pub owner: Addr,
/// The size of the object.
pub size: Uint128,
/// The number of pin on this object.
pub pin_count: Uint128,
}

pub struct ObjectIndexes<'a> {
Expand Down

0 comments on commit 04d8bff

Please sign in to comment.