Skip to content

Commit

Permalink
feat: add hash to build artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinketer22 authored Feb 26, 2024
1 parent 4f5864f commit bf26f36
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ export async function buildOne(contract: string, ui?: UIProvider) {
}

const cell = result.code;
const rHash = cell.hash();
const res = {
hash: rHash.toString('hex'),
hashBase64: rHash.toString('base64'),
hex: cell.toBoc().toString('hex')
};
ui?.clearActionPrompt();
ui?.write('\n✅ Compiled successfully! Cell BOC hex result:\n\n');
ui?.write(cell.toBoc().toString('hex'));
ui?.write('\n✅ Compiled successfully! Cell BOC result:\n\n');
ui?.write(JSON.stringify(res, null, 2));

await fs.mkdir(BUILD_DIR, { recursive: true });

await fs.writeFile(
buildArtifactPath,
JSON.stringify({
hex: cell.toBoc().toString('hex'),
}),
JSON.stringify(res)
);

ui?.write(`\n✅ Wrote compilation artifact to ${path.relative(process.cwd(), buildArtifactPath)}`);
Expand Down

0 comments on commit bf26f36

Please sign in to comment.