Skip to content

Commit

Permalink
Fix quote not in args regex and fetch class hash abi
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Jul 11, 2023
1 parent ed5e834 commit a3fd377
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { bn2hex, bn2uint, hex2str, str2hex } from "../../utils/hexUtils";

export const contractCallRegex =
/(?<contractAddress>(0x)?[a-z0-9]+)\.(?<selector>[a-z_0-9]+)\((?<args>[a-z0-9[\]{},;: ]*)\)/i;
/(?<contractAddress>(0x)?[a-z0-9]+)\.(?<selector>[a-z_0-9]+)\((?<args>[a-z0-9[\]{},;: "']*)\)/i;
export const cellNameRegex = /^[a-z]\d+$/i;
export const hexStringRegex = /^(0x)?[a-f0-9]+$/i;

Expand Down
7 changes: 6 additions & 1 deletion packages/starksheet-webapp/src/provider/StarknetProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,14 @@ export class StarknetProvider implements ChainProvider {
return abi;
}

let isContract = await this.addressAlreadyDeployed(address);
let response;
try {
response = await this.provider.getClassAt(address);
if (isContract) {
response = await this.provider.getClassAt(address);
} else {
response = await this.provider.getClassByHash(address);
}
} catch (error) {
response = { abi: [] };
}
Expand Down

0 comments on commit a3fd377

Please sign in to comment.