Skip to content

Commit

Permalink
Update algod models (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpaulos authored Aug 7, 2024
1 parent 7f2e734 commit ad873ad
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/client/v2/algod/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4284,6 +4284,12 @@ export class SimulateRequest extends BaseModel {
*/
public extraOpcodeBudget?: number | bigint;

/**
* If true, signers for transactions that are missing signatures will be fixed
* during evaluation.
*/
public fixSigners?: boolean;

/**
* If provided, specifies the round preceding the simulation. State changes through
* this round will be used to run this simulation. Usually only the 4 most recent
Expand All @@ -4301,6 +4307,8 @@ export class SimulateRequest extends BaseModel {
* @param allowUnnamedResources - Allows access to unnamed resources during simulation.
* @param execTraceConfig - An object that configures simulation execution trace.
* @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
* @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
* during evaluation.
* @param round - If provided, specifies the round preceding the simulation. State changes through
* this round will be used to run this simulation. Usually only the 4 most recent
* rounds will be available (controlled by the node config value MaxAcctLookback).
Expand All @@ -4313,6 +4321,7 @@ export class SimulateRequest extends BaseModel {
allowUnnamedResources,
execTraceConfig,
extraOpcodeBudget,
fixSigners,
round,
}: {
txnGroups: SimulateRequestTransactionGroup[];
Expand All @@ -4321,6 +4330,7 @@ export class SimulateRequest extends BaseModel {
allowUnnamedResources?: boolean;
execTraceConfig?: SimulateTraceConfig;
extraOpcodeBudget?: number | bigint;
fixSigners?: boolean;
round?: number | bigint;
}) {
super();
Expand All @@ -4330,6 +4340,7 @@ export class SimulateRequest extends BaseModel {
this.allowUnnamedResources = allowUnnamedResources;
this.execTraceConfig = execTraceConfig;
this.extraOpcodeBudget = extraOpcodeBudget;
this.fixSigners = fixSigners;
this.round = round;

this.attribute_map = {
Expand All @@ -4339,6 +4350,7 @@ export class SimulateRequest extends BaseModel {
allowUnnamedResources: 'allow-unnamed-resources',
execTraceConfig: 'exec-trace-config',
extraOpcodeBudget: 'extra-opcode-budget',
fixSigners: 'fix-signers',
round: 'round',
};
}
Expand All @@ -4362,6 +4374,7 @@ export class SimulateRequest extends BaseModel {
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
: undefined,
extraOpcodeBudget: data['extra-opcode-budget'],
fixSigners: data['fix-signers'],
round: data['round'],
});
/* eslint-enable dot-notation */
Expand Down Expand Up @@ -4751,6 +4764,12 @@ export class SimulateTransactionResult extends BaseModel {
*/
public execTrace?: SimulationTransactionExecTrace;

/**
* The account that needed to sign this transaction when no signature was provided
* and the provided signer was incorrect.
*/
public fixedSigner?: string;

/**
* Budget used during execution of a logic sig transaction.
*/
Expand All @@ -4777,6 +4796,8 @@ export class SimulateTransactionResult extends BaseModel {
* budged used by inner app calls spawned by this transaction.
* @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
* call trace in a recursive way.
* @param fixedSigner - The account that needed to sign this transaction when no signature was provided
* and the provided signer was incorrect.
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
* @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
* caused failure, but were allowed in simulation. Depending on where this object
Expand All @@ -4792,26 +4813,30 @@ export class SimulateTransactionResult extends BaseModel {
txnResult,
appBudgetConsumed,
execTrace,
fixedSigner,
logicSigBudgetConsumed,
unnamedResourcesAccessed,
}: {
txnResult: PendingTransactionResponse;
appBudgetConsumed?: number | bigint;
execTrace?: SimulationTransactionExecTrace;
fixedSigner?: string;
logicSigBudgetConsumed?: number | bigint;
unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
}) {
super();
this.txnResult = txnResult;
this.appBudgetConsumed = appBudgetConsumed;
this.execTrace = execTrace;
this.fixedSigner = fixedSigner;
this.logicSigBudgetConsumed = logicSigBudgetConsumed;
this.unnamedResourcesAccessed = unnamedResourcesAccessed;

this.attribute_map = {
txnResult: 'txn-result',
appBudgetConsumed: 'app-budget-consumed',
execTrace: 'exec-trace',
fixedSigner: 'fixed-signer',
logicSigBudgetConsumed: 'logic-sig-budget-consumed',
unnamedResourcesAccessed: 'unnamed-resources-accessed',
};
Expand All @@ -4837,6 +4862,7 @@ export class SimulateTransactionResult extends BaseModel {
data['exec-trace']
)
: undefined,
fixedSigner: data['fixed-signer'],
logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
unnamedResourcesAccessed:
typeof data['unnamed-resources-accessed'] !== 'undefined'
Expand Down Expand Up @@ -5006,6 +5032,12 @@ export class SimulationEvalOverrides extends BaseModel {
*/
public extraOpcodeBudget?: number | bigint;

/**
* If true, signers for transactions that are missing signatures will be fixed
* during evaluation.
*/
public fixSigners?: boolean;

/**
* The maximum log calls one can make during simulation
*/
Expand All @@ -5022,33 +5054,39 @@ export class SimulationEvalOverrides extends BaseModel {
* were properly signed.
* @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
* @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
* @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
* during evaluation.
* @param maxLogCalls - The maximum log calls one can make during simulation
* @param maxLogSize - The maximum byte number to log during simulation
*/
constructor({
allowEmptySignatures,
allowUnnamedResources,
extraOpcodeBudget,
fixSigners,
maxLogCalls,
maxLogSize,
}: {
allowEmptySignatures?: boolean;
allowUnnamedResources?: boolean;
extraOpcodeBudget?: number | bigint;
fixSigners?: boolean;
maxLogCalls?: number | bigint;
maxLogSize?: number | bigint;
}) {
super();
this.allowEmptySignatures = allowEmptySignatures;
this.allowUnnamedResources = allowUnnamedResources;
this.extraOpcodeBudget = extraOpcodeBudget;
this.fixSigners = fixSigners;
this.maxLogCalls = maxLogCalls;
this.maxLogSize = maxLogSize;

this.attribute_map = {
allowEmptySignatures: 'allow-empty-signatures',
allowUnnamedResources: 'allow-unnamed-resources',
extraOpcodeBudget: 'extra-opcode-budget',
fixSigners: 'fix-signers',
maxLogCalls: 'max-log-calls',
maxLogSize: 'max-log-size',
};
Expand All @@ -5063,6 +5101,7 @@ export class SimulationEvalOverrides extends BaseModel {
allowEmptySignatures: data['allow-empty-signatures'],
allowUnnamedResources: data['allow-unnamed-resources'],
extraOpcodeBudget: data['extra-opcode-budget'],
fixSigners: data['fix-signers'],
maxLogCalls: data['max-log-calls'],
maxLogSize: data['max-log-size'],
});
Expand Down

0 comments on commit ad873ad

Please sign in to comment.