penumbra_sdk_auction/
state_key.rs

1pub mod parameters {
2    pub fn key() -> &'static str {
3        "auction/parameters"
4    }
5
6    pub fn updated_flag() -> &'static str {
7        "auction/parameters/updated"
8    }
9}
10
11pub mod value_balance {
12    use penumbra_sdk_asset::asset;
13
14    #[allow(dead_code)] // For some reason, this shows up as unused
15    pub fn prefix() -> &'static str {
16        "auction/value_breaker/"
17    }
18
19    #[allow(dead_code)] // For some reason, this shows up as unused
20    pub fn for_asset(asset_id: &asset::Id) -> String {
21        format!("{}{asset_id}", prefix())
22    }
23}
24
25pub mod auction_store {
26    use crate::auction::id::AuctionId;
27
28    pub fn prefix() -> &'static str {
29        "auction/auction_store/"
30    }
31
32    pub fn by_id(auction_id: AuctionId) -> String {
33        format!("{}{auction_id}", prefix())
34    }
35}
36
37pub mod dutch {
38    pub mod trigger {
39        use crate::auction::id::AuctionId;
40
41        pub fn prefix() -> &'static str {
42            "auction/dutch/trigger/"
43        }
44
45        pub fn by_height(trigger_height: u64) -> String {
46            format!("{}{trigger_height:020}/", prefix())
47        }
48
49        pub fn auction_at_height(auction_id: AuctionId, trigger_height: u64) -> String {
50            format!("{}{auction_id}", by_height(trigger_height))
51        }
52    }
53}
54
55#[cfg(test)]
56mod tests {}