diff --git a/jest.config.js b/jest.config.js index 3fb65370..00cec43c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,7 +13,8 @@ module.exports = { }, rootDir: '.', setupFilesAfterEnv: ['/test/setup.ts'], - testEnvironment: 'jest-environment-node', + // testEnvironment: 'jest-environment-node', // TODO: this is required for the ARC0200Contract tests, otherwise the algosdk fails + testEnvironment: 'jsdom', transform: { '^.+\\.tsx?$': [ 'ts-jest', diff --git a/src/extension/contracts/BaseContract/BaseContract.ts b/src/extension/contracts/BaseContract/BaseContract.ts index 8c32bae7..3aa48bec 100644 --- a/src/extension/contracts/BaseContract/BaseContract.ts +++ b/src/extension/contracts/BaseContract/BaseContract.ts @@ -252,30 +252,26 @@ export default class BaseContract { ); let request: algosdk.modelsv2.SimulateRequest; - try { - assignGroupID(transactions); - - request = new algosdk.modelsv2.SimulateRequest({ - allowUnnamedResources: true, - allowEmptySignatures: true, - txnGroups: [ - new algosdk.modelsv2.SimulateRequestTransactionGroup({ - txns: transactions.map( - (value) => - decodeObj( - encodeUnsignedSimulateTransaction(value) - ) as EncodedSignedTransaction - ), - }), - ], - }); - return await this.algodClient - .simulateTransactions(request) - .setIntDecoding(IntDecoding.BIGINT) - .do(); - } catch (error) { - throw error; - } + assignGroupID(transactions); + + request = new algosdk.modelsv2.SimulateRequest({ + allowUnnamedResources: true, + allowEmptySignatures: true, + txnGroups: [ + new algosdk.modelsv2.SimulateRequestTransactionGroup({ + txns: transactions.map( + (value) => + decodeObj( + encodeUnsignedSimulateTransaction(value) + ) as EncodedSignedTransaction + ), + }), + ], + }); + return await this.algodClient + .simulateTransactions(request) + .setIntDecoding(IntDecoding.BIGINT) + .do(); } /**