Skip to content

Commit

Permalink
fix: correct the readonly handling
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Nov 11, 2024
1 parent e7ec65a commit 65c4e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/transaction/transaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,14 @@ const tests = (version: 8 | 9) => () => {
})

test('addressBalance', async () => {
appClient.send.call({
const result = await appClient.send.call({
method: 'addressBalance',
args: [algosdk.generateAccount().addr],
onComplete: algosdk.OnApplicationComplete.NoOpOC,
})

// Ensure the transaction was not sent via simulate
await fixture.context.waitForIndexerTransaction(result.txIds[0])
})
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/app-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@ export class AppClient {
call: async (params: AppClientMethodCallParams & CallOnComplete & SendParams) => {
// Read-only call - do it via simulate
if (
params.onComplete === OnApplicationComplete.NoOpOC ||
(!params.onComplete && getArc56Method(params.method, this._appSpec).method.readonly)
(params.onComplete === OnApplicationComplete.NoOpOC || !params.onComplete) &&
getArc56Method(params.method, this._appSpec).method.readonly
) {
const result = await this._algorand
.newGroup()
Expand Down

0 comments on commit 65c4e36

Please sign in to comment.