-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat 30: V1 Endpoints support - v1 to v0 UTxO conversion function to …
…assert equality
- Loading branch information
1 parent
c598820
commit 4f6095e
Showing
5 changed files
with
59 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
module Maestro.Run.Address where | ||
|
||
import Control.Monad (when) | ||
import Data.List (sort) | ||
import Maestro.Client.Env | ||
import qualified Maestro.Client.V0 as V0 | ||
import qualified Maestro.Client.V1 as V1 | ||
import qualified Maestro.Client.V0 as V0 | ||
import qualified Maestro.Client.V1 as V1 | ||
import Maestro.Types.V1.Common (v1UtxoToV0) | ||
|
||
runAddressAPI :: MaestroEnv 'V0 -> IO () | ||
runAddressAPI mEnv = undefined | ||
runAddressAPI :: MaestroEnv 'V0 -> MaestroEnv 'V1 -> IO () | ||
runAddressAPI mEnvV0 mEnvV1 = do | ||
let addrs = undefined -- Mention list of addresses. | ||
utxos <- V0.allPages $ flip (V0.utxosAtMultiAddresses mEnvV0 Nothing Nothing) addrs | ||
let utxosSorted = sort utxos | ||
utxos' <- fmap (fmap v1UtxoToV0) $ V1.allPages $ flip (V1.utxosAtMultiAddresses mEnvV1 Nothing Nothing) addrs | ||
let utxos'Sorted = sort utxos' | ||
when (utxosSorted == utxos'Sorted) $ putStrLn "Yes" |
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