Skip to content

Commit

Permalink
Merge pull request #76 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 13, 2025
2 parents aff7644 + 6f39186 commit e816012
Show file tree
Hide file tree
Showing 40 changed files with 42 additions and 42 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": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/abi-decorators/BaseAbi.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/abi-decorators/SubAbi.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/abi-decorators/SubAbi2.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/accounts/AccountsContract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/arc-28-events/EventEmitter.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/arc4-struct/StructDemo.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/avm11/AVM11Contract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/implicit-create/NoBare.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/implicit-create/NoNoOp.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/jsdoc/JSDocDemo.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/local-state/LocalStateDemo.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/named-types/MyContract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/precompiled-apps/Hello.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/state-totals/BaseWithState.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/approvals/out/strings/StringContract.arc56.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"compiler": "puya",
"compilerVersion": {
"major": 4,
"minor": 0,
"minor": 1,
"patch": 0
}
},
Expand Down

0 comments on commit e816012

Please sign in to comment.