Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Oct 14, 2020
1 parent 85db62e commit 03d31a3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/shelley/bench/Restore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,7 @@ cardanoRestoreBench tr c socketFile = do
-> (WalletId, WalletName, s)
walletRnd wname mkState =
let
seed = SomeMnemonic @24
$ entropyToMnemonic
$ unsafeMkEntropy @256
$ BS.take 256
$ blake2b256
$ T.encodeUtf8 wname
seed = dummySeedFromName wname
xprv = Byron.generateKeyFromSeed seed mempty
wid = WalletId $ digest $ publicKey xprv
rngSeed = 0
Expand All @@ -307,12 +302,7 @@ cardanoRestoreBench tr c socketFile = do
-> (WalletId, WalletName, s)
walletSeq wname mkState =
let
seed = SomeMnemonic @24
$ entropyToMnemonic
$ unsafeMkEntropy @256
$ BS.take 256
$ blake2b256
$ T.encodeUtf8 wname
seed = dummySeedFromName wname
xprv = Shelley.generateKeyFromSeed (seed, Nothing) mempty
wid = WalletId $ digest $ publicKey xprv
Right gap = mkAddressPoolGap 20
Expand Down Expand Up @@ -462,7 +452,8 @@ benchmarksRnd _ w wid wname restoreTime = do
([], getState cp)
[1..n]
where
xprv = undefined --Byron.generateKeyFromSeed seed mempty
seed = dummySeedFromName $ getWalletName wname
xprv = Byron.generateKeyFromSeed seed mempty

data BenchSeqResults = BenchSeqResults
{ benchName :: Text
Expand Down Expand Up @@ -587,7 +578,7 @@ bench_restoration proxy tr socket np vData wallets traceToDisk targetSync benchm
db

forM_ wallets $ \(wid, wname, s) -> do
unsafeRunExceptT $ W.createWallet w wid wname s
_ <- unsafeRunExceptT $ W.createWallet w wid wname s
void $ forkIO $ unsafeRunExceptT $ W.restoreWallet @_ @s @t @k w wid

-- NOTE: This is now the time to restore /all/ wallets.
Expand Down Expand Up @@ -622,6 +613,15 @@ dummyAddress
| otherwise =
Address $ BS.pack $ 1 : replicate 56 0

-- | Hash the given text, and construct a mnemonic from it.
dummySeedFromName :: Text -> SomeMnemonic
dummySeedFromName = SomeMnemonic @24
. entropyToMnemonic
. unsafeMkEntropy @256
. BS.take 256
. blake2b256
. T.encodeUtf8

traceProgressForPlotting :: Tracer IO Text -> Tracer IO WalletLog
traceProgressForPlotting tr = Tracer $ \case
MsgFollow (MsgApplyBlocks bs) -> do
Expand Down Expand Up @@ -674,8 +674,8 @@ prepareNode tr proxy socketPath np vData = do
waitForNodeSync tr nw
traceWith tr $ MsgSyncCompleted proxy sl

-- | Regularly poll the wallet to monitor it's syncing progress. Block until the
-- wallet reaches 100%.
-- | Regularly poll the wallets to monitor syncing progress. Block until all
-- wallets reach the given percentage.
waitForWalletsSyncTo
:: forall s t k n. (NetworkDiscriminantVal n)
=> Percentage
Expand Down

0 comments on commit 03d31a3

Please sign in to comment.