Skip to content

Commit

Permalink
updated mesh date types mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
leonlai257 committed Dec 3, 2024
1 parent d4182dc commit 79f25d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions snippet-extension/src/data/typeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export const jsonTypeMap = {
};

export const meshTypeMap = {
string: "ByteString",
bigint: "Integer",
MBool: "Bool",
bytestring: "string",
int: "bigint",
bool: "MBool",
tuple: "MTuple",
keyhash: "pubKeyHash",
address: "scriptAddress",
};
3 changes: 2 additions & 1 deletion snippet-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ export function activate(context: vscode.ExtensionContext) {
}
} else {
for (const key in meshTypeMap) {
if (type.includes(key)) {
console.log(key, mappedType.toLowerCase());
if (mappedType.toLowerCase().includes(key)) {
mappedType =
meshTypeMap[key as keyof typeof meshTypeMap];
break;
Expand Down

0 comments on commit 79f25d6

Please sign in to comment.