-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tx-generator: towards stand-alone selftest
- Loading branch information
1 parent
2c0687f
commit a47b3ad
Showing
5 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,5 +224,3 @@ newWallet n = do | |
name <- WalletName <$> newIdentifier n | ||
emit $ InitWallet name | ||
return name | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
bench/tx-generator/src/Cardano/Benchmarking/Script/Selftest.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module Cardano.Benchmarking.Script.Selftest | ||
where | ||
import Data.Dependent.Sum ( (==>) ) | ||
import Data.String | ||
|
||
import Cardano.Api | ||
|
||
import Cardano.Benchmarking.Types | ||
import Cardano.Benchmarking.Script.Setters | ||
import Cardano.Benchmarking.Script.Store | ||
import Cardano.Benchmarking.Script.Types | ||
|
||
testScript :: FilePath [Action] | ||
testScript protocolFile = | ||
[ SetProtocolParameters (UseLocalProtocolFile protocolFile) | ||
, Set (TNumberOfInputsPerTx ==> 2) | ||
, Set (TNumberOfOutputsPerTx ==> 2) | ||
, Set (TTxAdditionalSize ==> 39) | ||
, Set (TFee ==> (Lovelace 212345)) | ||
, Set (TMinValuePerUTxO ==> (Lovelace 1000000)) | ||
, Set (TTTL ==> (SlotNo 1000000)) | ||
, Set (TEra ==> (AnyCardanoEra AllegraEra)) | ||
, Set (TNetworkId ==> (Testnet (NetworkMagic {unNetworkMagic = 42}))) | ||
, InitWallet wallet | ||
, DefineSigningKey key | ||
(TextEnvelope { teType = TextEnvelopeType "GenesisUTxOSigningKey_ed25519" | ||
, teDescription = fromString "Genesis Initial UTxO Signing Key" | ||
, teRawCBOR = "X \vl1~\182\201v(\152\250A\202\157h0\ETX\248h\153\171\SI/m\186\242D\228\NAK\182(&\162"}) | ||
, AddFund wallet | ||
(TxIn "900fc5da77a0747da53f7675cbb7d149d46779346dea2f879ab811ccc72a2162" (TxIx 0)) | ||
(Lovelace 90000000000000) key | ||
, createChange 2200000000000 10 | ||
, createChange 70000000000 300 | ||
, createChange 2300000000 9000 | ||
, RunBenchmark wallet | ||
output | ||
SpendOutput | ||
(ThreadName "walletBasedBenchmark") 4000 (TPSRate 10.0) | ||
] | ||
where | ||
wallet = WalletName "test-wallet" | ||
key = KeyName "pass-partout" | ||
output = DumpToFile "/tmp/txs.txt" | ||
addr = PayToAddr key | ||
createChange val count | ||
= CreateChange wallet wallet output addr (Lovelace val) count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters