WIP (BlockchainLocal working)

Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
James Zuccon
2024-09-12 21:33:11 +10:00
parent 52da32ad4d
commit e308206d9f
33 changed files with 1274 additions and 397 deletions
@@ -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 = {};
}
}