Skip to content

Commit a772080

Browse files
authored
Merge pull request #1519 from PhilippeR26/fix-fastExecute
2 parents 99dbc78 + c783cb2 commit a772080

File tree

3 files changed

+7
-32
lines changed

3 files changed

+7
-32
lines changed

__tests__/account.test.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -391,23 +391,6 @@ describe('deploy and test Account', () => {
391391
});
392392

393393
describe('fastExecute()', () => {
394-
test('Only Rpc X', async () => {
395-
const provider08 = new RpcProvider({
396-
nodeUrl: 'dummy',
397-
blockIdentifier: BlockTag.PRE_CONFIRMED,
398-
specVersion: '0.10.0',
399-
});
400-
const testAccount = new Account({
401-
provider: provider08,
402-
address: '0x123',
403-
signer: '0x456',
404-
});
405-
const myCall: Call = { contractAddress: '0x036', entrypoint: 'withdraw', calldata: [] };
406-
await expect(testAccount.fastExecute(myCall)).rejects.toThrow(
407-
'Wrong Rpc version in Provider. At least Rpc v0.9 required.'
408-
);
409-
});
410-
411394
test('Only provider with PRE_CONFIRMED blockIdentifier', async () => {
412395
const providerLatest = new RpcProvider({
413396
nodeUrl: 'dummy',

src/account/default.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ import { assertPaymasterTransactionSafety } from '../utils/paymaster';
9090
import assert from '../utils/assert';
9191
import { defaultDeployer, Deployer } from '../deployer';
9292
import type { TipType } from '../provider/modules/tip';
93-
import { RPC09 } from '../channel';
9493

9594
export class Account extends Provider implements AccountInterface {
9695
public signer: SignerInterface;
@@ -365,10 +364,6 @@ export class Account extends Provider implements AccountInterface {
365364
transactionsDetail: UniversalDetails = {},
366365
waitDetail: fastWaitForTransactionOptions = {}
367366
): Promise<fastExecuteResponse> {
368-
assert(
369-
this.channel instanceof RPC09.RpcChannel,
370-
'Wrong Rpc version in Provider. At least Rpc v0.9 required.'
371-
);
372367
assert(
373368
this.channel.blockIdentifier === BlockTag.PRE_CONFIRMED,
374369
'Provider needs to be initialized with `pre_confirmed` blockIdentifier option.'

src/provider/rpc.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,13 @@ export class RpcProvider implements ProviderInterface {
344344
initNonce: BigNumberish,
345345
options?: fastWaitForTransactionOptions
346346
): Promise<boolean> {
347-
if (this.channel instanceof RPC09.RpcChannel) {
348-
const isSuccess = await this.channel.fastWaitForTransaction(
349-
txHash,
350-
address,
351-
initNonce,
352-
options
353-
);
354-
return isSuccess;
355-
}
356-
throw new Error('Unsupported channel type');
347+
const isSuccess = await this.channel.fastWaitForTransaction(
348+
txHash,
349+
address,
350+
initNonce,
351+
options
352+
);
353+
return isSuccess;
357354
}
358355

359356
public async getStorageAt(

0 commit comments

Comments
 (0)