generated from okp4/template-rust
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
use schemars::JsonSchema; | ||
use cosmwasm_std::Uint128; | ||
use cw_storage_plus::Item; | ||
use serde::{Deserialize, Serialize}; | ||
use cosmwasm_schema::cw_serde; | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] | ||
pub struct Bucket { | ||
/// The name of the bucket. | ||
pub name: String, | ||
/// The limits of the bucket. | ||
pub limits: BucketLimits, | ||
} | ||
|
||
/// BucketLimits is the type of the limits of a bucket. | ||
/// | ||
/// The limits are optional and if not set, there is no limit. | ||
#[cw_serde] | ||
#[derive(Eq)] | ||
pub struct BucketLimits { | ||
/// The maximum total size of the objects in the bucket. | ||
pub max_total_size: Option<Uint128>, | ||
/// The maximum number of objects in the bucket. | ||
pub max_objects: Option<Uint128>, | ||
/// The maximum size of the objects in the bucket. | ||
pub max_object_size: Option<Uint128>, | ||
/// The maximum number of pins in the bucket for an object. | ||
pub max_object_pins: Option<Uint128>, | ||
} | ||
|
||
pub const BUCKET: Item<'_, Bucket> = Item::new("bucket"); |