Skip to content

Commit

Permalink
fix(solidity-devops): always add verifier options to forge script (#…
Browse files Browse the repository at this point in the history
…3254)

* refactor: better naming

* fix: always add verifier options to `forge script`

* ci: no-op GasBenchmark test
  • Loading branch information
ChiTimesChi authored Oct 9, 2024
1 parent 6dd94ca commit a3fd580
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/solidity-devops/js/forgeScriptRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs')

const {
readChainSpecificOptions,
readChainVerificationOptions,
logWallet,
isVerifierEnabled,
} = require('./utils/chain.js')
Expand All @@ -18,7 +19,7 @@ const { logInfo } = require('./utils/logger.js')
const {
parseCommandLineArgs,
isBroadcasted,
addVerifyOptions,
addVerifyIfNotPresent,
addOptions,
} = require('./utils/options.js')
const { assertCondition } = require('./utils/utils.js')
Expand Down Expand Up @@ -47,7 +48,11 @@ let forgeOptions = addOptions(
forgeOptions = addOptions(forgeOptions, readChainSpecificOptions(chainName))
forgeOptions = addOptions(forgeOptions, options)
if (isBroadcast && isVerifierEnabled(chainName)) {
forgeOptions = addVerifyOptions(forgeOptions)
forgeOptions = addOptions(
forgeOptions,
readChainVerificationOptions(chainName)
)
forgeOptions = addVerifyIfNotPresent(forgeOptions)
}

const currentTimestamp = Date.now()
Expand Down
4 changes: 2 additions & 2 deletions packages/solidity-devops/js/utils/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const isBroadcasted = (options) => {
return options.includes('--broadcast')
}

const addVerifyOptions = (options) => {
const addVerifyIfNotPresent = (options) => {
return options.includes('--verify') ? options : `${options} --verify`
}

Expand All @@ -39,6 +39,6 @@ const addOptions = (options, newOptions) => {
module.exports = {
parseCommandLineArgs,
isBroadcasted,
addVerifyOptions,
addVerifyIfNotPresent,
addOptions,
}

0 comments on commit a3fd580

Please sign in to comment.