Removes backendFactory placeholder type
This commit is contained in:
parent
656ce37158
commit
64f4fbcb8f
|
@ -273,9 +273,7 @@ proc new*(
|
|||
engine = BlockExcEngine.new(repoStore, wallet, network, blockDiscovery, advertiser, peerStore, pendingBlocks)
|
||||
store = NetworkStore.new(engine, repoStore)
|
||||
prover = if config.prover:
|
||||
let
|
||||
backendFactory = BackendFactory()
|
||||
backend = backendFactory.initializeBackend(config).expect("Unable to create prover backend.")
|
||||
let backend = config.initializeBackend().expect("Unable to create prover backend.")
|
||||
some Prover.new(store, backend, config)
|
||||
else:
|
||||
none Prover
|
||||
|
|
|
@ -11,9 +11,6 @@ import ../../conf
|
|||
import ./backends
|
||||
import ./backendutils
|
||||
|
||||
type
|
||||
BackendFactory* = object of RootObj
|
||||
|
||||
proc initializeFromConfig(
|
||||
config: CodexConf,
|
||||
utils: BackendUtils): ?!AnyBackend =
|
||||
|
@ -73,7 +70,6 @@ proc suggestDownloadTool(config: CodexConf) =
|
|||
echo "'./" & tokens.join(" ") & "'"
|
||||
|
||||
proc initializeBackend*(
|
||||
self: BackendFactory,
|
||||
config: CodexConf,
|
||||
utils: BackendUtils = BackendUtils()): ?!AnyBackend =
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ suite "Test BackendFactory":
|
|||
let
|
||||
utilsMock = BackendUtilsMock()
|
||||
circuitDir = "testecircuitdir"
|
||||
factory = BackendFactory()
|
||||
|
||||
setup:
|
||||
createDir(circuitDir)
|
||||
|
@ -57,7 +56,7 @@ suite "Test BackendFactory":
|
|||
circomWasm: InputFile("tests/circuits/fixtures/proof_main.wasm"),
|
||||
circomZkey: InputFile("tests/circuits/fixtures/proof_main.zkey")
|
||||
)
|
||||
backend = factory.initializeBackend(config, utilsMock).tryGet
|
||||
backend = config.initializeBackend(utilsMock).tryGet
|
||||
|
||||
check:
|
||||
backend.vkp != nil
|
||||
|
@ -79,7 +78,7 @@ suite "Test BackendFactory":
|
|||
# will be picked up as local files:
|
||||
circuitDir: OutDir("tests/circuits/fixtures")
|
||||
)
|
||||
backend = factory.initializeBackend(config, utilsMock).tryGet
|
||||
backend = config.initializeBackend(utilsMock).tryGet
|
||||
|
||||
check:
|
||||
backend.vkp != nil
|
||||
|
@ -98,7 +97,7 @@ suite "Test BackendFactory":
|
|||
marketplaceAddress: EthAddress.example.some,
|
||||
circuitDir: OutDir(circuitDir)
|
||||
)
|
||||
backendResult = factory.initializeBackend(config, utilsMock)
|
||||
backendResult = config.initializeBackend(utilsMock)
|
||||
|
||||
check:
|
||||
backendResult.isErr
|
||||
|
|
|
@ -52,10 +52,7 @@ suite "Test Prover":
|
|||
circomZkey: InputFile("tests/circuits/fixtures/proof_main.zkey"),
|
||||
numProofSamples: samples
|
||||
)
|
||||
|
||||
let
|
||||
backendFactory = BackendFactory()
|
||||
backend = backendFactory.initializeBackend(config).tryGet()
|
||||
backend = config.initializeBackend().tryGet()
|
||||
|
||||
store = RepoStore.new(repoDs, metaDs)
|
||||
prover = Prover.new(store, backend, config)
|
||||
|
|
Loading…
Reference in New Issue