Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use another stake pool with metadata in STAKE_POOL_LIST_04 #1169

Merged
merged 1 commit into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
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
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