Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

[CDEC-285] Remove field accessors for FakeTxsHistory data type #3168

Merged
merged 1 commit into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions tools/src/dbgen/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _exampleSpec = GenSpec
{ accounts = 1
, accountSpec = AccountSpec { addresses = 100 }
, fakeUtxoCoinDistr = RangeDistribution { amount = 1000, range = 100 }
, fakeTxsHistory = SimpleTxsHistory { txsCount = 100, numOutgoingAddress = 3 }
, fakeTxsHistory = SimpleTxsHistory 100 3
}
, wallets = 1
}
Expand Down Expand Up @@ -146,11 +146,10 @@ data FakeTxsHistory
= NoHistory
-- ^ Do not generate fake history.
| SimpleTxsHistory
{ txsCount :: !Integer
!Integer
-- ^ Number of txs we want to generate.
, numOutgoingAddress :: !NumOfOutgoingAddresses
!NumOfOutgoingAddresses
-- ^ Number of outgoing addreses of a single @Tx@.
}
-- ^ Simple tx history generation.
-- TODO(ks): For now KISS, we can add more generation strategies.
deriving (Show, Eq, Generic)
Expand Down Expand Up @@ -237,8 +236,8 @@ generateWalletDB CLI{..} spec@GenSpec{..} = do

-- | Here we generate fake txs. For now it's a simple arbitrary generation.
generateFakeTxs :: FakeTxsHistory -> AccountId -> UberMonad ()
generateFakeTxs NoHistory _ = pure ()
generateFakeTxs SimpleTxsHistory{..} aId = do
generateFakeTxs NoHistory _ = pure ()
generateFakeTxs (SimpleTxsHistory txsCount numOutgoingAddress) aId = do
-- Get the number of txs we need to generate.
let txsNumber = fromIntegral txsCount

Expand Down