Skip to content

Commit

Permalink
use another stake pool with metadata in STAKE_POOL_LIST_04
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed Dec 12, 2019
1 parent 4941a45 commit 1172bd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,17 @@ nextFaucet owner = liftIO (takeMVar faucet) >>= \case
faucetAmt :: Int
faucetAmt = 10000

-- | corresponds with metadata stored in:
-- lib/jormungandr/test/data/jormungandr/stake_pools/registry/test-integration-registry.zip
{-# NOINLINE faucetWithMetadata #-}
faucetWithMetadata :: MVar [(String, String, String)]
faucetWithMetadata = unsafePerformIO $ newMVar
[ ( "ed25519_sk1qm2de9sa6w5ccvrrh7dh7fgpzeupulsjkz3fdqanm2w7e6h0rgasxex46t"
[ -- ticker: SWIM
( "ed25519_sk1qm2de9sa6w5ccvrrh7dh7fgpzeupulsjkz3fdqanm2w7e6h0rgasxex46t"
, "ed25519_pk1kpudvc46w3nnwjfw5zzsrj7jxqwm4znhltkas8yzx9lcezs5e8cswtvx8t"
, "account1skc834nzhf6xwd6f96sg2qwt6gcpmw52wlawmkqusgchlry2znylzam4v5a"
)
-- ticker: LIVER
, ( "ed25519_sk103yerx2fq2juzpjda2c0ghz5646cwezd0gvmtxa2jg9qj7hgj0es604myw"
, "ed25519_pk1577ny3x5etp748l09l594t4lh3tlhxpekalhw0j4fe5ava2jam3shm08mf"
, "account1sknm6vjy6n9v865lauh7sk4wh77907uc8xmh7ae7248xn4n42thwxlc0c70"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,25 @@ spec = do

(poolIdA, poolAOwner) <- registerStakePool ctx WithMetadata
(poolIdB, _poolBOwner) <- registerStakePool ctx WithoutMetadata
(poolIdC, poolCOwner) <- registerStakePool ctx WithMetadata

waitForNextEpoch ctx
waitForNextEpoch ctx
(_, pools') <- eventually $
unsafeRequest @[ApiStakePool] ctx listStakePoolsEp Empty

nWithoutMetadata pools' `shouldBe` nWithoutMetadata pools + 1
nWithMetadata pools' `shouldBe` nWithMetadata pools + 1
nWithMetadata pools' `shouldBe` nWithMetadata pools + 2

let (Just poolA) = find ((== ApiT poolIdA) . view #id) pools'
fmap (view #owner) (poolA ^. #metadata) `shouldBe` Just poolAOwner

let (Just poolB) = find ((== ApiT poolIdB) . view #id) pools'
(poolB ^. #metadata) `shouldBe` Nothing

let (Just poolC) = find ((== ApiT poolIdC) . view #id) pools'
fmap (view #owner) (poolC ^. #metadata) `shouldBe` Just poolCOwner

it "STAKE_POOLS_JOIN_01 - Can join a stakepool" $ \ctx -> do
w <- fixtureWallet ctx
(_, p:_) <- eventually $
Expand Down

0 comments on commit 1172bd8

Please sign in to comment.