Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test suite for Aff Interface - utxosAt
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Test.AffInterface where | ||
|
||
import Prelude | ||
import Control.Monad.Reader.Trans (runReaderT) | ||
import Data.Argonaut as Json | ||
import Data.Array as Array | ||
import Effect.Aff (Aff, launchAff_) | ||
import Effect.Class (liftEffect) | ||
import Effect.Exception (error) | ||
import Effect.Exception.Unsafe (unsafeThrowException) | ||
import Test.Spec.Assertions (shouldSatisfy, shouldNotSatisfy) | ||
import TestM (TestPlanM, ValidationM, runValidationM) | ||
import Mote (group, test) | ||
import Ogmios (mkOgmiosWebSocketAff, utxosAt) | ||
|
||
testnet_addr :: String | ||
testnet_addr = | ||
"addr_test1qr7g8nrv76fc7k4ueqwecljxx9jfwvsgawhl55hck3n8uwaz26mpcwu58zdkhpdnc6nuq3fa8vylc8ak9qvns7r2dsysp7ll4d" | ||
|
||
-- note: currently this suite relies on Ogmios being open and running against the | ||
-- testnet, and does not directly test outputs, as this suite is intended to | ||
-- help verify that the Aff interface for websockets itself works, | ||
-- not that the data represents expected values, as that would depend on chain | ||
-- state, and ogmios itself. | ||
suite :: TestPlanM Unit | ||
suite = do | ||
group "Aff Int" $ | ||
test "UtxosAt" $ do | ||
ws <- mkOgmiosWebSocketAff "ws:127.0.0.1:1337" | ||
(runReaderT | ||
(do | ||
utxoqr <- utxosAt testnet_addr | ||
pure unit | ||
)) | ||
{ ws } | ||
|
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