temporarily comment out PersistenceCmd until `prover` is back in

This commit is contained in:
Eric 2024-02-22 14:04:18 +11:00
parent 3b2bbc294c
commit 8bb35af7ac
No known key found for this signature in database
2 changed files with 28 additions and 23 deletions

View File

@ -21,7 +21,8 @@ type
configs*: seq[CodexConfig]
CodexConfig* = object
cliOptions: Table[StartUpCmd, Table[string, CliOption]]
cliPersistenceOptions: Table[PersistenceCmd, Table[string, CliOption]]
# TODO: uncomment once PersistenceCmd is added
# cliPersistenceOptions: Table[PersistenceCmd, Table[string, CliOption]]
debugEnabled*: bool
CodexConfigError* = object of CatchableError
@ -63,22 +64,24 @@ proc buildConfig(
## TODO: remove once proper exception handling added to nim-confutils
raiseCodexConfigError msg & e.msg.postFix
proc addCliOption*(
config: var CodexConfig,
group = PersistenceCmd.noCmd,
cliOption: CliOption) {.raises: [CodexConfigError].} =
# TODO: uncomment once PersistenceCmd is added
# proc addCliOption*(
# config: var CodexConfig,
# group = PersistenceCmd.noCmd,
# cliOption: CliOption) {.raises: [CodexConfigError].} =
var options = config.cliPersistenceOptions.getOrDefault(group)
options[cliOption.key] = cliOption # overwrite if already exists
config.cliPersistenceOptions[group] = options
discard config.buildConfig("Invalid cli arg " & $cliOption)
# var options = config.cliPersistenceOptions.getOrDefault(group)
# options[cliOption.key] = cliOption # overwrite if already exists
# config.cliPersistenceOptions[group] = options
# discard config.buildConfig("Invalid cli arg " & $cliOption)
proc addCliOption*(
config: var CodexConfig,
group = PersistenceCmd.noCmd,
key: string, value = "") {.raises: [CodexConfigError].} =
# TODO: uncomment once PersistenceCmd is added
# proc addCliOption*(
# config: var CodexConfig,
# group = PersistenceCmd.noCmd,
# key: string, value = "") {.raises: [CodexConfigError].} =
config.addCliOption(group, CliOption(key: key, value: value))
# config.addCliOption(group, CliOption(key: key, value: value))
proc addCliOption*(
config: var CodexConfig,
@ -123,12 +126,13 @@ proc cliArgs*(
var opts = config.cliOptions[cmd].values.toSeq
args = args.concat( opts.map(o => $o) )
for cmd in PersistenceCmd:
if config.cliPersistenceOptions.hasKey(cmd):
if cmd != PersistenceCmd.noCmd:
args.add $cmd
var opts = config.cliPersistenceOptions[cmd].values.toSeq
args = args.concat( opts.map(o => $o) )
# TODO: uncomment once PersistenceCmd is added
# for cmd in PersistenceCmd:
# if config.cliPersistenceOptions.hasKey(cmd):
# if cmd != PersistenceCmd.noCmd:
# args.add $cmd
# var opts = config.cliPersistenceOptions[cmd].values.toSeq
# args = args.concat( opts.map(o => $o) )
return args

View File

@ -204,9 +204,10 @@ template multinodesuite*(name: string, body: untyped) =
var config = conf
config.addCliOption("--bootstrap-node", bootstrap)
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
config.addCliOption(PersistenceCmd.prover, "--circom-r1cs", "tests/circuits/fixtures/proof_main.r1cs")
config.addCliOption(PersistenceCmd.prover, "--circom-wasm", "tests/circuits/fixtures/proof_main.wasm")
config.addCliOption(PersistenceCmd.prover, "--circom-zkey", "tests/circuits/fixtures/proof_main.zkey")
# TODO: uncomment once PersistenceCmd is added
# config.addCliOption(PersistenceCmd.prover, "--circom-r1cs", "tests/circuits/fixtures/proof_main.r1cs")
# config.addCliOption(PersistenceCmd.prover, "--circom-wasm", "tests/circuits/fixtures/proof_main.wasm")
# config.addCliOption(PersistenceCmd.prover, "--circom-zkey", "tests/circuits/fixtures/proof_main.zkey")
return await newCodexProcess(providerIdx, config, Role.Provider)