From bf26f36c49ac9c1a111772dd55d4b0fc955a7ab1 Mon Sep 17 00:00:00 2001 From: Trinketer22 <109865562+Trinketer22@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:05:12 +0300 Subject: [PATCH] feat: add hash to build artifact --- src/build.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/build.ts b/src/build.ts index 1da36bf..b064509 100644 --- a/src/build.ts +++ b/src/build.ts @@ -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)}`);