Skip to content

Commit

Permalink
🩹 Fixed SimpleMap query
Browse files Browse the repository at this point in the history
  • Loading branch information
PsicoThePato committed Oct 14, 2024
1 parent 19c573a commit 1e8f8a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,14 @@ export class SimpleMap implements ChainEntry {
constructor(private readonly entry: [StorageKey<AnyTuple>, Codec][]) {}

queryStorage() {
const modules_map = Object.fromEntries(
this.entry.map((value, index) => [index, value[1].toPrimitive()]),
);
return modules_map as Record<string, string>;
const storageData: Record<string, string> = {};
this.entry.forEach(entry => {
const key = entry[0].args[0]?.toPrimitive() as string;
const value = entry[1].toPrimitive() as string;
storageData[key] = value;
}
)
return storageData;
}
}

Expand Down

0 comments on commit 1e8f8a5

Please sign in to comment.