Skip to content

Commit

Permalink
chore: prepareInvocations, LibraryError
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Sep 3, 2024
1 parent 5809a6e commit 72c6b67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions __tests__/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('deploy and test Wallet', () => {

describeIfDevnet('declare tests only on devnet', () => {
test('simulate DECLARE - Cairo 0 Contract', async () => {
const invocation = await provider.createBulkInvocations([
const invocation = await provider.prepareInvocations([
{
type: TransactionType.DECLARE,
contract: compiledErc20,
Expand All @@ -261,7 +261,7 @@ describe('deploy and test Wallet', () => {
});

test('simulate DECLARE - Cairo 1 Contract - test if not already declared', async () => {
const invocation = await provider.createBulkInvocations([
const invocation = await provider.prepareInvocations([
{
type: TransactionType.DECLARE,
contract: compiledHelloSierra,
Expand Down Expand Up @@ -767,8 +767,8 @@ describe('deploy and test Wallet', () => {
});
});

test('createBulkInvocations: unordered declare, deploy & multi invoke', async () => {
const invocations = await provider.createBulkInvocations([
test('prepareInvocations: unordered declare, deploy & multi invoke', async () => {
const invocations = await provider.prepareInvocations([
{
type: TransactionType.DEPLOY,
payload: {
Expand Down
7 changes: 5 additions & 2 deletions src/provider/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,10 @@ export class RpcProvider implements ProviderInterface {
const result = await this.getClass(classHash, blockIdentifier);
return result instanceof Object;
} catch (error) {
return false;
if (error instanceof LibraryError) {
return false;
}
throw error;
}
}

Expand All @@ -608,7 +611,7 @@ export class RpcProvider implements ProviderInterface {
* 2. Order declarations first
* @param invocations
*/
public async createBulkInvocations(invocations: Invocations) {
public async prepareInvocations(invocations: Invocations) {
const bulk: Invocations = [];
// Build new ordered array
// eslint-disable-next-line no-restricted-syntax
Expand Down

0 comments on commit 72c6b67

Please sign in to comment.