Skip to content

Commit

Permalink
Remove DupCache
Browse files Browse the repository at this point in the history
  • Loading branch information
birchmd committed Apr 15, 2022
1 parent 430afd6 commit 0ee5e0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 57 deletions.
13 changes: 13 additions & 0 deletions engine-sdk/src/caching.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use aurora_engine_types::BTreeMap;

/// A naive cache storing all key-value pairs it learns about..
#[derive(Default)]
pub struct FullCache<K, V> {
inner: BTreeMap<K, V>,
}

impl<K: Ord, V> FullCache<K, V> {
pub fn get_or_insert_with<F: FnOnce() -> V>(&mut self, k: K, f: F) -> &mut V {
self.inner.entry(k).or_insert_with(f)
}
}
55 changes: 0 additions & 55 deletions engine-sdk/src/dup_cache.rs

This file was deleted.

2 changes: 1 addition & 1 deletion engine-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::prelude::Address;
use crate::prelude::{H256, STORAGE_PRICE_PER_BYTE};
pub use types::keccak;

pub mod dup_cache;
pub mod caching;
pub mod env;
pub mod error;
pub mod io;
Expand Down
2 changes: 1 addition & 1 deletion engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use evm::{Config, CreateScheme, ExitError, ExitFatal, ExitReason};

use crate::connector::EthConnectorContract;
use crate::map::BijectionMap;
use aurora_engine_sdk::dup_cache::FullCache;
use aurora_engine_sdk::caching::FullCache;
use aurora_engine_sdk::env::Env;
use aurora_engine_sdk::io::{StorageIntermediate, IO};
use aurora_engine_sdk::promise::{PromiseHandler, PromiseId};
Expand Down

0 comments on commit 0ee5e0b

Please sign in to comment.