From cf7de250e63256f352109f15757ffa162a06d16e Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Mon, 18 Dec 2023 15:30:00 -0500 Subject: [PATCH 1/3] Regenerate algod and indexer models --- src/client/v2/algod/models/types.ts | 28 +++++++++++++++++++++++++++ src/client/v2/indexer/models/types.ts | 17 ++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/client/v2/algod/models/types.ts b/src/client/v2/algod/models/types.ts index 3392591e0..e29ce620c 100644 --- a/src/client/v2/algod/models/types.ts +++ b/src/client/v2/algod/models/types.ts @@ -4931,6 +4931,19 @@ export class SimulationTransactionExecTrace extends BaseModel { */ public clearStateProgramTrace?: SimulationOpcodeTraceUnit[]; + /** + * If true, indicates that the clear state program failed and any persistent state + * changes it produced should be reverted once the program exits. + */ + public clearStateRollback?: boolean; + + /** + * The error message explaining why the clear state program failed. This field will + * only be populated if clear-state-rollback is true and the failure was due to an + * execution error. + */ + public clearStateRollbackError?: string; + /** * An array of SimulationTransactionExecTrace representing the execution trace of * any inner transactions executed. @@ -4953,6 +4966,11 @@ export class SimulationTransactionExecTrace extends BaseModel { * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program. * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction. * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program. + * @param clearStateRollback - If true, indicates that the clear state program failed and any persistent state + * changes it produced should be reverted once the program exits. + * @param clearStateRollbackError - The error message explaining why the clear state program failed. This field will + * only be populated if clear-state-rollback is true and the failure was due to an + * execution error. * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of * any inner transactions executed. * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction. @@ -4963,6 +4981,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, + clearStateRollback, + clearStateRollbackError, innerTrace, logicSigHash, logicSigTrace, @@ -4971,6 +4991,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace?: SimulationOpcodeTraceUnit[]; clearStateProgramHash?: string | Uint8Array; clearStateProgramTrace?: SimulationOpcodeTraceUnit[]; + clearStateRollback?: boolean; + clearStateRollbackError?: string; innerTrace?: SimulationTransactionExecTrace[]; logicSigHash?: string | Uint8Array; logicSigTrace?: SimulationOpcodeTraceUnit[]; @@ -4986,6 +5008,8 @@ export class SimulationTransactionExecTrace extends BaseModel { ? new Uint8Array(Buffer.from(clearStateProgramHash, 'base64')) : clearStateProgramHash; this.clearStateProgramTrace = clearStateProgramTrace; + this.clearStateRollback = clearStateRollback; + this.clearStateRollbackError = clearStateRollbackError; this.innerTrace = innerTrace; this.logicSigHash = typeof logicSigHash === 'string' @@ -4998,6 +5022,8 @@ export class SimulationTransactionExecTrace extends BaseModel { approvalProgramTrace: 'approval-program-trace', clearStateProgramHash: 'clear-state-program-hash', clearStateProgramTrace: 'clear-state-program-trace', + clearStateRollback: 'clear-state-rollback', + clearStateRollbackError: 'clear-state-rollback-error', innerTrace: 'inner-trace', logicSigHash: 'logic-sig-hash', logicSigTrace: 'logic-sig-trace', @@ -5024,6 +5050,8 @@ export class SimulationTransactionExecTrace extends BaseModel { SimulationOpcodeTraceUnit.from_obj_for_encoding ) : undefined, + clearStateRollback: data['clear-state-rollback'], + clearStateRollbackError: data['clear-state-rollback-error'], innerTrace: typeof data['inner-trace'] !== 'undefined' ? data['inner-trace'].map( diff --git a/src/client/v2/indexer/models/types.ts b/src/client/v2/indexer/models/types.ts index 12b0555f4..88af12561 100644 --- a/src/client/v2/indexer/models/types.ts +++ b/src/client/v2/indexer/models/types.ts @@ -2653,6 +2653,11 @@ export class Box extends BaseModel { */ public name: Uint8Array; + /** + * The round for which this information is relevant + */ + public round: number | bigint; + /** * (value) box value, base64 encoded. */ @@ -2661,13 +2666,16 @@ export class Box extends BaseModel { /** * Creates a new `Box` object. * @param name - (name) box name, base64 encoded + * @param round - The round for which this information is relevant * @param value - (value) box value, base64 encoded. */ constructor({ name, + round, value, }: { name: string | Uint8Array; + round: number | bigint; value: string | Uint8Array; }) { super(); @@ -2675,6 +2683,7 @@ export class Box extends BaseModel { typeof name === 'string' ? new Uint8Array(Buffer.from(name, 'base64')) : name; + this.round = round; this.value = typeof value === 'string' ? new Uint8Array(Buffer.from(value, 'base64')) @@ -2682,6 +2691,7 @@ export class Box extends BaseModel { this.attribute_map = { name: 'name', + round: 'round', value: 'value', }; } @@ -2691,10 +2701,13 @@ export class Box extends BaseModel { /* eslint-disable dot-notation */ if (typeof data['name'] === 'undefined') throw new Error(`Response is missing required field 'name': ${data}`); + if (typeof data['round'] === 'undefined') + throw new Error(`Response is missing required field 'round': ${data}`); if (typeof data['value'] === 'undefined') throw new Error(`Response is missing required field 'value': ${data}`); return new Box({ name: data['name'], + round: data['round'], value: data['value'], }); /* eslint-enable dot-notation */ @@ -4892,7 +4905,7 @@ export class TransactionAssetTransfer extends BaseModel { public receiver: string; /** - * Number of assets transfered to the close-to account as part of the transaction. + * Number of assets transferred to the close-to account as part of the transaction. */ public closeAmount?: number | bigint; @@ -4916,7 +4929,7 @@ export class TransactionAssetTransfer extends BaseModel { * that asset in the account's Assets map. * @param assetId - (xaid) ID of the asset being transferred. * @param receiver - (arcv) Recipient address of the transfer. - * @param closeAmount - Number of assets transfered to the close-to account as part of the transaction. + * @param closeAmount - Number of assets transferred to the close-to account as part of the transaction. * @param closeTo - (aclose) Indicates that the asset should be removed from the account's Assets * map, and specifies where the remaining asset holdings should be transferred. * It's always valid to transfer remaining asset holdings to the creator account. From 350421fb5c6fc32fa85dd7bf08130e149fe7e90d Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Mon, 18 Dec 2023 15:57:46 -0500 Subject: [PATCH 2/3] Use fix-js-github-action branch of generator --- .github/workflows/codegen.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index 7b397ba54..c1f706b8b 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -1,5 +1,7 @@ name: "SDK Code Generation" on: + pull_request: + workflow_dispatch: schedule: - cron: '20 23 * * *' permissions: @@ -12,7 +14,7 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - name: Generate and PR - uses: algorand/generator/.github/actions/sdk-codegen/@master + uses: algorand/generator/.github/actions/sdk-codegen/@fix-js-github-action with: args: "-k JS" env: From 93b3c806c7a094036ad96bb09bdd8d240826f9ca Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Mon, 18 Dec 2023 16:30:28 -0500 Subject: [PATCH 3/3] revert codegen job changes --- .github/workflows/codegen.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index c1f706b8b..7b397ba54 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -1,7 +1,5 @@ name: "SDK Code Generation" on: - pull_request: - workflow_dispatch: schedule: - cron: '20 23 * * *' permissions: @@ -14,7 +12,7 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - name: Generate and PR - uses: algorand/generator/.github/actions/sdk-codegen/@fix-js-github-action + uses: algorand/generator/.github/actions/sdk-codegen/@master with: args: "-k JS" env: