Skip to content

Commit

Permalink
Switch LedgerService to use range-based BudgetTracker.
Browse files Browse the repository at this point in the history
Change-Id: I7bbae4742c67eab2a4f206abd1c5ec3ed8640514
  • Loading branch information
rakshita-tandon committed Nov 7, 2024
1 parent f88ecc5 commit e609fb5
Show file tree
Hide file tree
Showing 5 changed files with 655 additions and 1,130 deletions.
1 change: 1 addition & 0 deletions ledger_service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ rust_library(
"@oak//oak_restricted_kernel_sdk",
"@oak_crates_index//:anyhow",
"@oak_crates_index//:coset",
"@oak_crates_index//:hashbrown",
"@oak_crates_index//:hpke",
"@oak_crates_index//:p256",
"@oak_crates_index//:prost",
Expand Down
6 changes: 3 additions & 3 deletions ledger_service/src/blobid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub struct BlobId {
}

impl BlobId {
const MIN: BlobId = BlobId { id: u128::MIN };
const MAX: BlobId = BlobId { id: u128::MAX };
pub const MIN: BlobId = BlobId { id: u128::MIN };
pub const MAX: BlobId = BlobId { id: u128::MAX - 1 };

pub fn from_bytes(s: &[u8]) -> Result<Self> {
if s.len() > BLOB_ID_SIZE {
Expand Down Expand Up @@ -123,7 +123,7 @@ mod tests {
#[test]
#[should_panic]
fn test_add_one_panic() {
BlobId::add_one(&BlobId::MAX);
BlobId::add_one(&BlobId::MAX.add_one());
}

#[test]
Expand Down
Loading

0 comments on commit e609fb5

Please sign in to comment.