-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This PR adds support for restoration from a given chainpoint for shelley wallets. - [x] Add RestorationMode optional field to the API specs - [x] Add RestorationMode and API counterpart haskell type - [x] Add some datatype to transport the mode to the DBLayer (StartRestorationPoint) - [x] Add a datatype to hold the initial state of a wallet (InitialState) - [x] Update JSON golden for WalletPostData - [x] Implement the database support for the mode ADP-106
- Loading branch information
Showing
43 changed files
with
1,580 additions
and
401 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
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
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
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
42 changes: 42 additions & 0 deletions
42
lib/integration/framework/Test/Integration/Framework/DSL/Network.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,42 @@ | ||
{-# LANGUAGE OverloadedLabels #-} | ||
{-# LANGUAGE PatternSynonyms #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
|
||
module Test.Integration.Framework.DSL.Network where | ||
|
||
import Prelude | ||
|
||
import Cardano.Wallet.Api.Types | ||
( ApiNetworkInformation | ||
) | ||
import Cardano.Wallet.Primitive.Types | ||
( EpochNo | ||
) | ||
import Control.Lens | ||
( (^.) | ||
) | ||
import Test.Hspec.Expectations.Lifted | ||
( shouldSatisfy | ||
) | ||
import Test.Integration.Framework.DSL | ||
( eventually | ||
) | ||
import Test.Integration.Framework.DSL.TestM | ||
( TestM | ||
, pattern Partial | ||
, request | ||
) | ||
|
||
import qualified Cardano.Wallet.Api.Clients.Testnet.Network as C | ||
|
||
tipInfo :: TestM EpochNo | ||
tipInfo = do | ||
Partial (netInfo :: ApiNetworkInformation) <- request C.networkInformation | ||
pure $ netInfo ^. #nodeTip . #slotId . #epochNumber . #getApiT | ||
|
||
waitSomeEpochs :: Int -> TestM () | ||
waitSomeEpochs n = do | ||
now <- tipInfo | ||
eventually "Waiting some epochs" $ do | ||
current <- tipInfo | ||
current `shouldSatisfy` (>= now + fromIntegral n) |
Oops, something went wrong.