WIP (BlockchainLocal working)
Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { type IStorage } from './interface';
|
||||
|
||||
/**
|
||||
* This exists for testing. It is not intended for actual use and will likely be removed.
|
||||
*/
|
||||
export class StorageMemory implements IStorage {
|
||||
storage: { [key: string]: any } = {};
|
||||
|
||||
async start() {}
|
||||
|
||||
async stop() {}
|
||||
|
||||
async get(key: string) {
|
||||
return this.storage[key];
|
||||
}
|
||||
|
||||
async set<T>(key: string, value: T) {
|
||||
this.storage[key] = value;
|
||||
}
|
||||
|
||||
async delete(key: string) {
|
||||
delete this.storage[key];
|
||||
}
|
||||
|
||||
async clear() {
|
||||
this.storage = {};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user