Skip to content

Commit

Permalink
Added example query
Browse files Browse the repository at this point in the history
  • Loading branch information
crocodile-dentist committed Oct 21, 2024
1 parent 0775a7b commit c130c9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ library unstable-shelley-testlib
cardano-ledger-shelley-ma-test,
cardano-ledger-shelley-test,
cardano-protocol-tpraos:{cardano-protocol-tpraos, testlib},
cardano-slotting,
cardano-strict-containers,
containers,
generic-random,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ module Test.Consensus.Shelley.Examples (
, examplesShelley
) where

import qualified Data.List.NonEmpty as NE

import qualified Cardano.Ledger.Block as SL
import Cardano.Ledger.Crypto (Crypto)
import qualified Cardano.Protocol.TPraos.BHeader as SL
import Cardano.Slotting.Slot
import Data.Coerce (coerce)
import qualified Data.Set as Set
import Ouroboros.Consensus.Block
Expand All @@ -43,6 +46,8 @@ import Ouroboros.Consensus.Shelley.Ledger.Query.Types
import Ouroboros.Consensus.Shelley.Protocol.TPraos ()
import Ouroboros.Consensus.Storage.Serialisation
import Ouroboros.Network.Block (Serialised (..))
import Ouroboros.Network.PeerSelection.LedgerPeers.Type
import Ouroboros.Network.PeerSelection.RelayAccessPoint
import Test.Cardano.Ledger.Allegra.Examples.Consensus
(ledgerExamplesAllegra)
import Test.Cardano.Ledger.Alonzo.Examples.Consensus
Expand Down Expand Up @@ -109,6 +114,7 @@ fromShelleyLedgerExamples ShelleyLedgerExamples {
, ("GetStakeDistribution", SomeSecond GetStakeDistribution)
, ("GetNonMyopicMemberRewards", SomeSecond $ GetNonMyopicMemberRewards sleRewardsCredentials)
, ("GetGenesisConfig", SomeSecond GetGenesisConfig)
, ("GetBigLedgerPeerSnapshot", SomeSecond GetBigLedgerPeerSnapshot)
]
results = labelled [
("LedgerTip", SomeResult GetLedgerTip (blockPoint blk))
Expand All @@ -119,6 +125,13 @@ fromShelleyLedgerExamples ShelleyLedgerExamples {
, ("NonMyopicMemberRewards", SomeResult (GetNonMyopicMemberRewards Set.empty)
(NonMyopicMemberRewards $ sreNonMyopicRewards))
, ("GenesisConfig", SomeResult GetGenesisConfig (compactGenesis sreShelleyGenesis))
, ("GetBigLedgerPeerSnapshot",
SomeResult GetBigLedgerPeerSnapshot
(LedgerPeerSnapshot (At slotNo, [(AccPoolStake 0.9
, (PoolStake 0.9
, NE.singleton $
RelayAccessAddress (IPv4 "1.1.1.1")
1234))])))
]
annTip = AnnTip {
annTipSlotNo = SlotNo 14
Expand Down

0 comments on commit c130c9f

Please sign in to comment.