Skip to content

Commit

Permalink
Merge pull request #72 from algorandfoundation/refactor-voter-params
Browse files Browse the repository at this point in the history
refactor: accept Account or uint64 as parameter to VoterParams functions
  • Loading branch information
boblat authored Jan 10, 2025
2 parents 55818ef + 4e49f83 commit fb957ba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion langspec.puya.json
Original file line number Diff line number Diff line change
Expand Up @@ -6307,7 +6307,7 @@
"stack_inputs": [
{
"name": "A",
"stack_type": "any",
"stack_type": "address_or_index",
"doc": null
}
],
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/algo-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algorandfoundation/algorand-typescript",
"version": "0.0.1-alpha.24",
"version": "0.0.1-alpha.25",
"description": "This package contains definitions for the types which comprise Algorand TypeScript which can be compiled to run on the Algorand Virtual Machine using the Puya compiler.",
"private": false,
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/algo-ts/src/op-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3009,13 +3009,13 @@ export type VoterParamsType = {
* Online stake in microalgos
* Min AVM version: 6
*/
voterBalance(a: uint64 | bytes): readonly [uint64, boolean]
voterBalance(a: Account | uint64): readonly [uint64, boolean]

/**
* Had this account opted into block payouts
* Min AVM version: 11
*/
voterIncentiveEligible(a: uint64 | bytes): readonly [boolean, boolean]
voterIncentiveEligible(a: Account | uint64): readonly [boolean, boolean]
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/awst_build/op-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4901,7 +4901,7 @@ export const OP_METADATA: Record<string, IntrinsicOpMapping | IntrinsicOpGroupin
{
argNames: ['a'],
immediateArgs: ['VoterBalance'],
stackArgs: [{ name: 'a', ptypes: [ptypes.uint64PType, ptypes.bytesPType] }],
stackArgs: [{ name: 'a', ptypes: [ptypes.accountPType, ptypes.uint64PType] }],
returnType: new ptypes.TuplePType({ items: [ptypes.uint64PType, ptypes.boolPType] }),
},
],
Expand All @@ -4913,7 +4913,7 @@ export const OP_METADATA: Record<string, IntrinsicOpMapping | IntrinsicOpGroupin
{
argNames: ['a'],
immediateArgs: ['VoterIncentiveEligible'],
stackArgs: [{ name: 'a', ptypes: [ptypes.uint64PType, ptypes.bytesPType] }],
stackArgs: [{ name: 'a', ptypes: [ptypes.accountPType, ptypes.uint64PType] }],
returnType: new ptypes.TuplePType({ items: [ptypes.boolPType, ptypes.boolPType] }),
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function cli() {
.choices(['0', '1', '2'])
.default(defaultPuyaOptions.optimizationLevel),
)
.addOption(new Option('--target-avm-version [version]', '').choices(['10']).default(10))
.addOption(new Option('--target-avm-version [version]', '').choices(['10', '11']).default(10))
.addOption(
new Option(
'--cli-template-definitions <...definitions>',
Expand Down

0 comments on commit fb957ba

Please sign in to comment.