Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
return amount of space left
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield committed Apr 15, 2024
1 parent 1600221 commit f3445c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chain/CacheManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ contract CacheManager {
}

/// Evicts entries until enough space exists in the cache, reverting if payment is insufficient.
/// Returns the new amount of space available on success.
/// Note: will only make up to 5Mb of space. Call repeatedly for more.
function makeSpace(uint64 size) external payable {
function makeSpace(uint64 size) external payable returns (uint64 space) {
if (size > MAX_MAKE_SPACE) {
size = MAX_MAKE_SPACE;
}
_makeSpace(size);
return cacheSize - queueSize;
}

/// Evicts entries until enough space exists in the cache, reverting if payment is insufficient.
Expand Down

0 comments on commit f3445c0

Please sign in to comment.