Skip to content

Commit 45511a9

Browse files
authored
Merge pull request #95 from algorandfoundation/update-langspec
feat: update langspec to v4.3.0
2 parents 9495cc9 + 38e0c38 commit 45511a9

File tree

14 files changed

+184
-15
lines changed

14 files changed

+184
-15
lines changed

docs/coverage.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,4 @@ See which `algorand-typescript` stubs are implemented by the `algorand-typescrip
151151
| op.sqrt | Native |
152152
| op.substring | Native |
153153
| op.vrfVerify | Mockable |
154+
| op.falconVerify | Mockable |

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
"vitest": "3.2.4"
6969
},
7070
"dependencies": {
71-
"@algorandfoundation/algorand-typescript": "1.0.0-alpha.83",
72-
"@algorandfoundation/puya-ts": "1.0.0-alpha.83",
71+
"@algorandfoundation/algorand-typescript": "1.0.0-alpha.84",
72+
"@algorandfoundation/puya-ts": "1.0.0-alpha.84",
7373
"elliptic": "^6.6.1",
7474
"js-sha256": "^0.11.0",
7575
"js-sha3": "^0.9.3",

src/impl/app-params.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,8 @@ export const AppParams: typeof op.AppParams = {
7171
const app = getApp(a)
7272
return app === undefined ? [Account(), false] : [app.address, true]
7373
},
74+
appVersion: function (a: ApplicationType | uint64): readonly [uint64, boolean] {
75+
const app = getApp(a)
76+
return app === undefined ? [Uint64(0), false] : [app.version, true]
77+
},
7478
}

src/impl/crypto.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ export const mimc = (_c: MimcConfigurations, _a: StubBytesCompat): bytes => {
147147
throw new NotImplementedError('mimc')
148148
}
149149

150+
/** @internal */
151+
export const falconVerify = (_a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): boolean => {
152+
throw new NotImplementedError('falconVerify')
153+
}
154+
150155
const curveMap = {
151156
[Ecdsa.Secp256k1]: 'secp256k1',
152157
[Ecdsa.Secp256r1]: 'p256',

src/impl/gtxn.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export const GTxn: typeof op.GTxn = {
197197
lastLog(t: StubUint64Compat): bytes {
198198
return lazyContext.activeGroup.getApplicationCallTransaction(asUint64(t)).lastLog
199199
},
200-
stateProofPk(t: StubUint64Compat): bytes {
200+
stateProofPk(t: StubUint64Compat): bytes<64> {
201201
return lazyContext.activeGroup.getKeyRegistrationTransaction(asUint64(t)).stateProofKey
202202
},
203203
approvalProgramPages(a: StubUint64Compat, b: StubUint64Compat): bytes {
@@ -212,6 +212,9 @@ export const GTxn: typeof op.GTxn = {
212212
numClearStateProgramPages(t: StubUint64Compat): uint64 {
213213
return lazyContext.activeGroup.getApplicationCallTransaction(asUint64(t)).numClearStateProgramPages
214214
},
215+
rejectVersion: function (a: uint64): uint64 {
216+
return lazyContext.activeGroup.getApplicationCallTransaction(asUint64(a)).rejectVersion
217+
},
215218
}
216219

217220
/** @internal */

src/impl/itxn.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const GITxn: typeof op.GITxn = {
243243
lastLog: function (t: StubUint64Compat): bytes {
244244
return getApplicationCallInnerTxn(t).lastLog
245245
},
246-
stateProofPk: function (t: StubUint64Compat): bytes {
246+
stateProofPk: function (t: StubUint64Compat): bytes<64> {
247247
return getKeyRegistrationInnerTxn(t).stateProofKey
248248
},
249249
approvalProgramPages: function (t: StubUint64Compat, a: StubUint64Compat): bytes {
@@ -258,6 +258,9 @@ export const GITxn: typeof op.GITxn = {
258258
numClearStateProgramPages: function (t: StubUint64Compat): uint64 {
259259
return getApplicationCallInnerTxn(t).numClearStateProgramPages
260260
},
261+
rejectVersion: function (t: StubUint64Compat): uint64 {
262+
return getApplicationCallInnerTxn(t).rejectVersion
263+
},
261264
}
262265
/** @internal */
263266
export const ITxn: typeof op.ITxn = {
@@ -643,7 +646,7 @@ export const ITxn: typeof op.ITxn = {
643646
/**
644647
* 64 byte state proof public key
645648
*/
646-
get stateProofPk(): bytes {
649+
get stateProofPk(): bytes<64> {
647650
return lazyContext.activeGroup.getItxnGroup().getKeyRegistrationInnerTxn().stateProofKey
648651
},
649652
/**
@@ -670,6 +673,9 @@ export const ITxn: typeof op.ITxn = {
670673
get numClearStateProgramPages(): uint64 {
671674
return lazyContext.activeGroup.getItxnGroup().getApplicationCallInnerTxn().numClearStateProgramPages
672675
},
676+
get rejectVersion(): uint64 {
677+
return lazyContext.activeGroup.getItxnGroup().getApplicationCallInnerTxn().rejectVersion
678+
},
673679
}
674680

675681
const setConstructingItxnField = (fields: Partial<InnerTxnFields>): void => {
@@ -862,6 +868,9 @@ export const ITxnCreate: typeof op.ITxnCreate = {
862868
pages.push(asBytes(a))
863869
setConstructingItxnField({ clearStateProgram: pages })
864870
},
871+
setRejectVersion: function (a: StubUint64Compat): void {
872+
setConstructingItxnField({ rejectVersion: asUint64(a) })
873+
},
865874
next: function (): void {
866875
lazyContext.activeGroup.appendInnerTransactionGroup()
867876
},

src/impl/reference.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export class ApplicationData {
168168
localStateMaps: new BytesMap(),
169169
boxes: new BytesMap(),
170170
materialisedBoxes: new BytesMap(),
171+
version: 0,
171172
}
172173
}
173174
}
@@ -221,6 +222,9 @@ export class ApplicationCls extends Uint64BackedCls implements ApplicationType {
221222
}
222223
return result
223224
}
225+
get version(): uint64 {
226+
return this.data.application.version
227+
}
224228
}
225229

226230
export type AssetData = Mutable<Omit<AssetType, 'id' | 'balance' | 'frozen'>>

src/impl/transactions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export class ApplicationCallTransaction extends TransactionBase implements gtxn.
253253
#clearStateProgramPages: Array<bytes>
254254
#appLogs: Array<bytes>
255255
#appId: ApplicationType
256+
#rejectVersion: uint64
256257

257258
/** @internal */
258259
protected constructor(fields: ApplicationCallTransactionFields) {
@@ -272,6 +273,7 @@ export class ApplicationCallTransaction extends TransactionBase implements gtxn.
272273
this.#apps = fields.apps ?? []
273274
this.#approvalProgramPages = fields.approvalProgramPages ?? (fields.approvalProgram ? [fields.approvalProgram] : [])
274275
this.#clearStateProgramPages = fields.clearStateProgramPages ?? (fields.clearStateProgram ? [fields.clearStateProgram] : [])
276+
this.#rejectVersion = fields.rejectVersion ?? Uint64(0)
275277
Object.entries(fields.scratchSpace ?? {}).forEach(([k, v]) => this.setScratchSlot(Number(k), v))
276278
}
277279

@@ -335,6 +337,9 @@ export class ApplicationCallTransaction extends TransactionBase implements gtxn.
335337
get apfa() {
336338
return this.#apps
337339
}
340+
get rejectVersion() {
341+
return this.#rejectVersion
342+
}
338343
appArgs(index: Uint64Compat): bytes {
339344
return toBytes(this.args[asNumber(index)])
340345
}

src/impl/txn.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ export const Txn: typeof op.Txn = {
462462
/**
463463
* 64 byte state proof public key
464464
*/
465-
get stateProofPk(): bytes {
465+
get stateProofPk(): bytes<64> {
466466
return lazyContext.activeGroup.getKeyRegistrationTransaction().stateProofKey
467467
},
468468

@@ -493,4 +493,7 @@ export const Txn: typeof op.Txn = {
493493
get numClearStateProgramPages(): uint64 {
494494
return lazyContext.activeGroup.getApplicationCallTransaction().numClearStateProgramPages
495495
},
496+
get rejectVersion(): uint64 {
497+
return lazyContext.activeGroup.getApplicationCallTransaction().rejectVersion
498+
},
496499
}

0 commit comments

Comments
 (0)