diff --git a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal index 8aa5bbd4e3..69f2ddf12e 100644 --- a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal +++ b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal @@ -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, diff --git a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs index 20b578beb1..0abdfc287e 100644 --- a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs +++ b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs @@ -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 @@ -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 @@ -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)) @@ -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