Skip to content

Commit

Permalink
Added support for latest linkers debug map
Browse files Browse the repository at this point in the history
  • Loading branch information
30mb1 committed Nov 6, 2023
1 parent 63a3eb9 commit e9f2f82
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locklift",
"version": "2.9.1",
"version": "2.9.2",
"description": "Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
6 changes: 5 additions & 1 deletion src/internal/factory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ export class Factory<T extends FactoryType> {
}

const abi = utils.loadJSONFromFile(path.resolve(resolvedPath, (name as string) + ".abi.json"));
const map = utils.loadJSONFromFile(path.resolve(resolvedPath, (name as string) + ".map.json"));
let map = utils.loadJSONFromFile(path.resolve(resolvedPath, (name as string) + ".map.json"));

if ("map" in map) {
map = map.map;
}

if (!abi) {
throw new Error(`Not found ABI of Contract ${name as string}`);
Expand Down
4 changes: 2 additions & 2 deletions src/internal/tracing/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const throwTrace = (trace: Trace) => {
if (tx.compute.status === "vm" && !tx.compute.success) {
// last vm step is the error position
const lastStep = vmTraces.pop() as EngineTraceInfo;
errPosition = contract.map.map[lastStep.cmdCodeCellHash][lastStep.cmdCodeOffset];
errPosition = contract.map[lastStep.cmdCodeCellHash][lastStep.cmdCodeOffset];
if (errPosition === undefined) throw new Error(mainErrorMsg);
}
// ACTION PHASE ERROR
Expand All @@ -143,7 +143,7 @@ export const throwTrace = (trace: Trace) => {
if (Number(tx.action.resultCode) === 33) failedAction = 255;

const failedActionStep = actionsSent[failedAction];
errPosition = contract.map.map[failedActionStep.cmdCodeCellHash][failedActionStep.cmdCodeOffset];
errPosition = contract.map[failedActionStep.cmdCodeCellHash][failedActionStep.cmdCodeOffset];
if (errPosition === undefined) throw new Error(mainErrorMsg);
}

Expand Down

0 comments on commit e9f2f82

Please sign in to comment.