chore: Write tests for pinning

This commit is contained in:
Zomatree
2024-07-21 22:22:46 +01:00
parent c50435d499
commit 87a9fb79f2
6 changed files with 186 additions and 6 deletions

View File

@@ -18,6 +18,10 @@ static TOKEN_CACHE: Lazy<Mutex<lru::LruCache<String, ()>>> =
Lazy::new(|| Mutex::new(lru::LruCache::new(NonZeroUsize::new(1000).unwrap())));
impl IdempotencyKey {
pub fn unchecked_from_string(key: String) -> Self {
Self { key }
}
// Backwards compatibility.
// Issue #109
pub async fn consume_nonce(&mut self, v: Option<String>) -> Result<()> {