Skip to content

Commit d69a6ce

Browse files
committed
refactor: remove avm version check as algod latest image is now v4
1 parent e9498bf commit d69a6ce

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

tests/avm-invoker.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ const algorandClient = Lazy(() => {
2222

2323
export const INITIAL_BALANCE_MICRO_ALGOS = Number(20e6)
2424

25-
export const getAlgorandAppClientV11 = async (appSpec: AppSpec) => {
26-
if ((await getAlgodMajorVersion()) < 4) {
27-
return undefined
28-
}
29-
const [appClient, _] = await getAlgorandAppClientWithApp(appSpec)
30-
return appClient
31-
}
32-
3325
export const getAlgorandAppClient = async (appSpec: AppSpec) => {
3426
const [appClient, _] = await getAlgorandAppClientWithApp(appSpec)
3527
return appClient

tests/state-op-codes.spec.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ import { StateAcctParamsGetContract } from './artifacts/state-ops/state-acct-par
3838
import {
3939
generateTestAccount,
4040
generateTestAsset,
41-
getAlgodMajorVersion,
4241
getAlgorandAppClient,
43-
getAlgorandAppClientV11,
4442
getAlgorandAppClientWithApp,
4543
getAvmResult,
4644
getLocalNetDefaultAccount,
@@ -49,15 +47,13 @@ import {
4947

5048
describe('State op codes', async () => {
5149
const ctx = new TestExecutionContext()
52-
const algodVersion = await getAlgodMajorVersion()
53-
const isV11Supported = algodVersion > 4
5450

5551
afterEach(() => {
5652
ctx.reset()
5753
})
5854

59-
describe.skipIf(!isV11Supported)('AcctParams', async () => {
60-
const [appClient, dummyAccount] = await Promise.all([getAlgorandAppClientV11(acctParamsAppSpecJson as AppSpec), generateTestAccount()])
55+
describe('AcctParams', async () => {
56+
const [appClient, dummyAccount] = await Promise.all([getAlgorandAppClient(acctParamsAppSpecJson as AppSpec), generateTestAccount()])
6157

6258
test.each([
6359
['verify_acct_balance', INITIAL_BALANCE_MICRO_ALGOS + 100_000],
@@ -90,7 +86,7 @@ describe('State op codes', async () => {
9086
})
9187

9288
const avmResult = await getAvmResult(
93-
{ appClient: appClient!, sendParams: { staticFee: AlgoAmount.Algos(1000) } },
89+
{ appClient, sendParams: { staticFee: AlgoAmount.Algos(1000) } },
9490
methodName,
9591
asUint8Array(dummyAccount.bytes),
9692
)
@@ -113,7 +109,7 @@ describe('State op codes', async () => {
113109
expect(op.AcctParams.acctIncentiveEligible(mockAccount)).toEqual([true, true])
114110
})
115111

116-
await appClient!.algorand.send.onlineKeyRegistration({
112+
await appClient.algorand.send.onlineKeyRegistration({
117113
sender: encodeAddress(asUint8Array(dummyAccount.bytes)),
118114
voteKey: getRandomBytes(32).asUint8Array(),
119115
selectionKey: getRandomBytes(32).asUint8Array(),
@@ -124,7 +120,7 @@ describe('State op codes', async () => {
124120
staticFee: AlgoAmount.Algos(10),
125121
})
126122
const avmResult = await getAvmResult(
127-
{ appClient: appClient!, sendParams: { staticFee: AlgoAmount.Algos(10) } },
123+
{ appClient, sendParams: { staticFee: AlgoAmount.Algos(10) } },
128124
'verify_acct_incentive_eligible',
129125
asUint8Array(dummyAccount.bytes),
130126
)

0 commit comments

Comments
 (0)