Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terran-one/cosmwasm-vm-js",
"version": "0.1.14",
"version": "0.1.15",
"license": "MIT",
"author": "TerranOne",
"main": "dist/index.js",
Expand Down
8 changes: 8 additions & 0 deletions src/backend/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export interface IStorage {
set(key: Uint8Array, value: Uint8Array): void;

remove(key: Uint8Array): void;

keys(): Iterable<Uint8Array>;
}

export class Record {
Expand Down Expand Up @@ -42,6 +44,12 @@ export interface IIterStorage {
export class BasicKVStorage implements IStorage {
// TODO: Add binary uint / typed Addr maps for cw-storage-plus compatibility
constructor(public dict: Immutable.Map<string, string> = Immutable.Map()) {}

*keys() {
for (const key of this.dict.keys()) {
yield fromBase64(key);
}
}

get(key: Uint8Array): Uint8Array | null {
const keyStr = toBase64(key);
Expand Down