-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avm-simulator): error stack tracking in AVM to match ACVM/ACIR-SIM
- Loading branch information
Showing
9 changed files
with
157 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
import { type Fr } from '@aztec/foundation/fields'; | ||
|
||
import { type AvmRevertReason } from './errors.js'; | ||
|
||
/** | ||
* Results of an contract call's execution in the AVM. | ||
*/ | ||
export class AvmContractCallResults { | ||
public readonly reverted: boolean; | ||
public readonly output: Fr[]; | ||
|
||
/** For exceptional halts */ | ||
public readonly revertReason: Error | undefined; | ||
|
||
constructor(reverted: boolean, output: Fr[], revertReason?: Error) { | ||
this.reverted = reverted; | ||
this.output = output; | ||
this.revertReason = revertReason; | ||
} | ||
constructor(public reverted: boolean, public output: Fr[], public revertReason?: AvmRevertReason) {} | ||
|
||
/** | ||
* Generate a string representation of call results. | ||
*/ | ||
toString(): string { | ||
let resultsStr = `reverted: ${this.reverted}, output: ${this.output}`; | ||
let resultsString = `reverted: ${this.reverted}, output: ${this.output}`; | ||
if (this.revertReason) { | ||
resultsStr += `, revertReason: ${this.revertReason}`; | ||
resultsString += `, revertReason: ${this.revertReason!.message}`; | ||
} | ||
return resultsStr; | ||
return resultsString; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.