@@ -1936,42 +1936,17 @@ proc doSlashingExport(conf: BeaconNodeConf) {.raises: [IOError, Defect].}=
19361936 # TODO : Make it read-only https://github.com/status-im/nim-eth/issues/312
19371937 let db = SlashingProtectionDB .loadUnchecked (dir, filetrunc, readOnly = false )
19381938
1939- let interchange = block :
1940- if conf.interchangeFile.isSome ():
1941- string (conf.interchangeFile.unsafeGet ())
1942- else :
1943- conf.validatorsDir () & " /" & " interchange-" & " " & " .json"
1944-
1945- db.exportSlashingInterchange (interchange)
1939+ let interchange = conf.exportedInterchangeFile.string
1940+ db.exportSlashingInterchange (interchange, conf.exportedValidators)
19461941 echo " Export finished: '" , dir/ filetrunc & " .sqlite3" , " ' into '" , interchange, " '"
19471942
1948- proc doSlashingPartialExport (conf: BeaconNodeConf ) {.raises : [IOError , Defect ].} =
1949- let
1950- dir = conf.validatorsDir ()
1951- filetrunc = SlashingDbName
1952- # TODO : Make it read-only https://github.com/status-im/nim-eth/issues/312
1953- let db = SlashingProtectionDB .loadUnchecked (dir, filetrunc, readOnly = false )
1954-
1955- let interchange = block :
1956- if conf.interchangeFile.isSome ():
1957- string (conf.interchangeFile.unsafeGet ())
1958- else :
1959- conf.validatorsDir () & " /" & " interchange-" & " " & " .json"
1960-
1961- db.exportPartialSlashingInterchange (conf.validators, interchange)
1962- echo " Partial export finished: '" , dir/ filetrunc/ " .sqlite3" , " ' into '" , interchange, " '"
1963-
19641943proc doSlashingImport (conf: BeaconNodeConf ) {.raises : [SerializationError , IOError , Defect ].} =
19651944 let
19661945 dir = conf.validatorsDir ()
19671946 filetrunc = SlashingDbName
19681947 # TODO : Make it read-only https://github.com/status-im/nim-eth/issues/312
19691948
1970- let interchange = block :
1971- if conf.interchangeFile.isSome ():
1972- string (conf.interchangeFile.unsafeGet ())
1973- else :
1974- conf.validatorsDir () & " /" & " interchange-" & " " & " .json"
1949+ let interchange = conf.importedInterchangeFile.string
19751950
19761951 var spdir: SPDIR
19771952 try :
@@ -2003,10 +1978,8 @@ proc doSlashingImport(conf: BeaconNodeConf) {.raises: [SerializationError, IOErr
20031978proc doSlashingInterchange (conf: BeaconNodeConf ) {.raises : [Defect , CatchableError ].} =
20041979 doAssert conf.cmd == slashingdb
20051980 case conf.slashingdbCmd
2006- of SlashProtCmd .exportAll:
2007- conf.doSlashingExport ()
20081981 of SlashProtCmd .`export`:
2009- conf.doSlashingPartialExport ()
1982+ conf.doSlashingExport ()
20101983 of SlashProtCmd .`import`:
20111984 conf.doSlashingImport ()
20121985
0 commit comments