Commit 0272a536 authored by Kelvin Fichter's avatar Kelvin Fichter

feat: add commit hash to genesis file

parent d270b457
---
'@eth-optimism/contracts': patch
---
Adds a git commit hash to the output of make-genesis.ts
/* External Imports */ /* External Imports */
import { promisify } from 'util'
import { exec } from 'child_process'
import { import {
computeStorageSlots, computeStorageSlots,
getStorageLayout, getStorageLayout,
...@@ -127,7 +129,18 @@ export const makeL2GenesisFile = async ( ...@@ -127,7 +129,18 @@ export const makeL2GenesisFile = async (
} }
} }
// Grab the commit hash so we can stick it in the genesis file.
let commit: string
try {
const { stdout } = await promisify(exec)('git rev-parse HEAD')
commit = stdout.replace('\n', '')
} catch {
console.log('unable to get commit hash, using empty hash instead')
commit = '0000000000000000000000000000000000000000'
}
return { return {
commit,
config: { config: {
chainId: cfg.l2ChainId, chainId: cfg.l2ChainId,
homesteadBlock: 0, homesteadBlock: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment