Skip to content

Commit

Permalink
fixed rebased and compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
nhenin committed Apr 12, 2024
1 parent e84bffa commit 0dda88a
Show file tree
Hide file tree
Showing 39 changed files with 887 additions and 2,038 deletions.
2 changes: 1 addition & 1 deletion libs/cardano-debug/cardano-debug.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ library
, aeson
, base >=4.9 && <5
, bytestring
, cardano-api ^>=8.37
, cardano-api ^>=8.39.2.0
, cardano-ledger-core
, cardano-ledger-shelley
, containers
Expand Down
4 changes: 2 additions & 2 deletions marlowe-integration-tests/marlowe-integration-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ executable marlowe-integration-tests
, marlowe-object:{marlowe-object, gen}
, marlowe-protocols
, marlowe-runtime-web
, marlowe-runtime:{marlowe-runtime, contract, contract-api, sync-api, tx-api}
, marlowe-runtime:{marlowe-runtime, contract, contract-api, sync-api, tx, tx-api}
, marlowe-test
, mtl
, network-uri
, ouroboros-network-protocols ^>=0.8
, pipes ^>=4.3.16
, plutus-ledger-api
, plutus-tx ^>=1.15
, plutus-tx ^>=1.21
, QuickCheck
, resourcet
, servant-client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Language.Marlowe.Runtime.Integration.Common (
getGenesisWallet,
getStakeCredential,
getTip,
getUTxO,
inputsAppliedToTransaction,
retryDelayMicroSeconds,
runIntegrationTest,
Expand Down Expand Up @@ -58,6 +57,11 @@ module Language.Marlowe.Runtime.Integration.Common (
execMarlowe_,
execMarlowe',
runWebClient,
runWebClient',
expectJustM,
waitTillWalletHasFunds,
mkEmptyWallet,
prettyJSON,
) where

import Cardano.Api (
Expand Down Expand Up @@ -149,14 +153,6 @@ import Language.Marlowe.Runtime.ChainSync.Api (
)
import qualified Language.Marlowe.Runtime.ChainSync.Api as Chain
import qualified Language.Marlowe.Runtime.ChainSync.Api as ChainSync
import Language.Marlowe.Runtime.Client (
MarloweT,
applyInputs,
runMarloweHeaderSyncClient,
runMarloweSyncClient,
runMarloweT,
runMarloweTxClient,
)
import qualified Language.Marlowe.Runtime.Client as Client
import Language.Marlowe.Runtime.Core.Api (
ContractId (..),
Expand Down Expand Up @@ -186,16 +182,17 @@ import qualified Language.Marlowe.Runtime.Transaction.Query as Transaction
import Network.Protocol.Connection (runConnector)
import Network.Protocol.Driver.Trace (HasSpanContext (context, wrapContext))
import Network.Protocol.Job.Client (liftCommandWait)
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (VolatileTip))
import Network.Protocol.Peer.Trace (defaultSpanContext)
import Network.Protocol.Query.Client (request)
import Observe.Event.Explicit (injectSelector)
import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (VolatileTip))
import qualified PlutusLedgerApi.V2 as PV2
import Servant.Client (ClientError)
import Servant.Client.Streaming (ClientM)
import System.Exit (ExitCode (..))
import Test.Hspec (shouldBe)
import Test.Integration.Marlowe (
import Test.Integration.Marlowe.Local (
Attempts (..),
LocalTestnet (..),
MarloweRuntime (MarloweRuntime),
PaymentKeyPair (..),
Expand All @@ -205,7 +202,6 @@ import Test.Integration.Marlowe (
execCli,
retryTillTrue,
)
import Test.Integration.Marlowe.Local (Attempts (..))
import qualified Test.Integration.Marlowe.Local as MarloweRuntime
import UnliftIO (bracket_)
import UnliftIO.Environment (setEnv, unsetEnv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Language.Marlowe.Runtime.Integration.MarloweQuery where
import Cardano.Api (getTxId)
import Control.Monad (guard)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Reader.Class
import Control.Monad.Reader.Class (MonadReader (ask))
import Control.Monad.Trans.Class (lift)
import Data.Bifunctor (bimap)
import Data.Foldable (Foldable (fold), foldl', for_)
Expand Down Expand Up @@ -39,7 +39,32 @@ import Language.Marlowe.Protocol.Query.Client (
getWithdrawal,
getWithdrawals,
)
import Language.Marlowe.Protocol.Query.Types
import Language.Marlowe.Protocol.Query.Types (
ContractFilter (..),
ContractState (
ContractState,
contractId,
initialBlock,
initialOutput,
latestBlock,
latestOutput,
metadata,
roleTokenMintingPolicyId,
unclaimedPayouts
),
Order (Ascending, Descending),
Page (..),
PayoutFilter (..),
PayoutHeader (..),
Range (..),
RoleCurrency (..),
RoleCurrencyFilter (..),
SomeContractState (SomeContractState),
SomeTransaction (SomeTransaction),
SomeTransactions (SomeTransactions),
Withdrawal (..),
WithdrawalFilter (..),
)
import Language.Marlowe.Runtime.Cardano.Api (fromCardanoTxId)
import Language.Marlowe.Runtime.ChainSync.Api (
Address,
Expand All @@ -63,14 +88,47 @@ import Language.Marlowe.Runtime.Core.Api (
import qualified Language.Marlowe.Runtime.Core.Api as Core
import Language.Marlowe.Runtime.Discovery.Api (ContractHeader)
import Language.Marlowe.Runtime.History.Api (MarloweBlock (..), MarloweWithdrawTransaction (..))
import Language.Marlowe.Runtime.Integration.Common
import Language.Marlowe.Runtime.Integration.Common (
Integration,
Wallet (addresses),
getGenesisWallet,
inputsAppliedToTransaction,
runIntegrationTest,
)
import Language.Marlowe.Runtime.Integration.Scenario (
contractCreatedToMarloweCreateTransaction,
contractCreatedToUnspentContractOutput,
inputsAppliedToMarloweApplyInputsTransaction,
inputsAppliedToUnspentContractOutput,
)
import Language.Marlowe.Runtime.Integration.StandardContract
import Language.Marlowe.Runtime.Integration.StandardContract (
StandardContractChoiceMade (
choiceBlock,
gimmeTheMoneyChosen,
sendNotify
),
StandardContractClosed (
returnDepositBlock,
returnDeposited,
withdrawPartyAFunds
),
StandardContractFundsDeposited (
chooseGimmeTheMoney,
initialDepositBlock,
initialFundsDeposited
),
StandardContractLifecycleInit (..),
StandardContractNotified (
makeReturnDeposit,
notified,
notifiedBlock
),
createStandardContractWithTags,
standardContractDatum,
standardContractHeader,
standardContractId,
standardContractPayout,
)
import Language.Marlowe.Runtime.Transaction.Api (
ContractCreated (..),
ContractCreatedInEra (..),
Expand All @@ -80,8 +138,19 @@ import Language.Marlowe.Runtime.Transaction.Api (
WithdrawTx (..),
WithdrawTxInEra (..),
)
import Test.Hspec
import Test.Integration.Marlowe (MarloweRuntime, withLocalMarloweRuntime)
import Test.Hspec (
ActionWith,
Spec,
SpecWith,
aroundAll,
describe,
it,
shouldBe,
)
import Test.Integration.Marlowe.Local (
MarloweRuntime,
withLocalMarloweRuntime,
)

spec :: Spec
spec = describe "MarloweQuery" $ aroundAll setup do
Expand Down Expand Up @@ -527,7 +596,7 @@ convertRoleCurrencyFilter MarloweQueryTestData{..} = go
TestByPolicy policies -> RoleCurrencyFilterByPolicy $ Set.map convertPolicyId policies

convertContractId Unknown =
ContractId $ TxOutRef "0000000000000000000000000000000000000000000000000000000000000000" 1
ContractId $ TxOutRef "0000000000000000000000000000000000000000000000000000000000000000" (TxIx 1)
convertContractId (Known Contract1) = standardContractId contract1
convertContractId (Known Contract2) = standardContractId contract2
convertContractId (Known Contract3) = standardContractId contract3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ import Language.Marlowe.Runtime.Web.Tx.API (
txEnvelope
),
)
import Language.Marlowe.Runtime.Web.Server.DTO (FromDTO (..), ToDTO (toDTO))
import Language.Marlowe.Runtime.Web.Types (ApiError (..))

import Language.Marlowe.Runtime.Web.Adapter.Server.ApiError
import qualified Language.Marlowe.Runtime.Web.Core.Asset as Web
import qualified Language.Marlowe.Runtime.Web.Core.Party as Web
import qualified Language.Marlowe.Runtime.Web.Tx.API as Web
import Network.URI (parseURI)
import qualified PlutusLedgerApi.V2 as PV2
import qualified Servant.Client as Servant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,14 @@ import qualified Language.Marlowe.Core.V1.Semantics as V1
import qualified Language.Marlowe.Core.V1.Semantics.Types as V1
import qualified Language.Marlowe.Core.V1.Semantics.Types.Address as V1
import Language.Marlowe.Extended.V1 (ada)
import Language.Marlowe.Runtime.Integration.Common (
Wallet (addresses),
expectJust,
getGenesisWallet,
runIntegrationTest,
runWebClient,

import qualified Language.Marlowe.Runtime.ChainSync.Api as Chain
import Language.Marlowe.Runtime.Core.Api (ContractId)
import Language.Marlowe.Runtime.Integration.Common (
Integration,
Wallet (addresses, signingKeys),
expectJust,
expectJustM,
getGenesisWallet,
mkEmptyWallet,
runIntegrationTest,
runWebClient,
runWebClient',
Expand All @@ -58,8 +51,18 @@ import Language.Marlowe.Runtime.Integration.StandardContract (standardContract)
import Language.Marlowe.Runtime.Plutus.V2.Api (toPlutusAddress)
import Language.Marlowe.Runtime.Transaction.Api (WalletAddresses (..))
import Language.Marlowe.Runtime.Web.Adapter.Server.DTO (ToDTO (toDTO))
import Language.Marlowe.Runtime.Web.Client (postContract)
import Language.Marlowe.Runtime.Web.Common (submitContract)
import Language.Marlowe.Runtime.Web.Client (
Page (..),
getContract,
getContracts,
postContract,
)
import Language.Marlowe.Runtime.Web.Common (
signShelleyTransaction',
submitContract,
submitTransaction,
waitUntilConfirmed,
)
import qualified Language.Marlowe.Runtime.Web.Core.MarloweVersion as Web

import Language.Marlowe.Runtime.Web.Contract.API (ContractOrSourceId (..))
Expand All @@ -73,35 +76,25 @@ import qualified Language.Marlowe.Runtime.Web.Core.Roles as Web
import Language.Marlowe.Runtime.Web.Contract.Transaction.Client
import qualified Language.Marlowe.Runtime.Web.Tx.API as Web
import qualified Language.Marlowe.Runtime.Web.Withdrawal.API as Web
import Test.Hspec (Spec, describe, it)
import Test.Integration.Marlowe.Local (withLocalMarloweRuntime)
import Language.Marlowe.Runtime.Web (
ApplyInputsTxEnvelope (ApplyInputsTxEnvelope),
ContractOrSourceId (..),
RoleTokenConfig (..),
RoleTokenRecipient (ClosedRole),
import Test.Hspec (
Spec,
describe,
it,
shouldBe,
shouldSatisfy,
)
import qualified Language.Marlowe.Runtime.Web as Web
import Language.Marlowe.Runtime.Web.Client (
Page (..),
getContract,
getContracts,
postContract,
postTransaction,
putTransaction,
import Test.Integration.Marlowe.Local (
localTestnetToLocalNodeConnectInfo,
testnet,
withLocalMarloweRuntime,
)
import Language.Marlowe.Runtime.Web.Common (
signShelleyTransaction',
submitContract,
submitTransaction,
waitUntilConfirmed,
)
import Language.Marlowe.Runtime.Web.Server.DTO (ToDTO (toDTO))

import qualified Language.Marlowe.Runtime.Web.Core.Address as Web
import qualified Language.Marlowe.Runtime.Web.Core.Tx as Web
import Language.Marlowe.Runtime.Web.Tx.API
import qualified PlutusLedgerApi.V1.Value as PLA
import qualified PlutusLedgerApi.V2 as PV2
import qualified PlutusTx.AssocMap as AM
import Test.Hspec (Spec, describe, it, shouldBe, shouldSatisfy)
import Test.Integration.Marlowe.Local (localTestnetToLocalNodeConnectInfo, testnet, withLocalMarloweRuntime)

spec :: Spec
spec = do
Expand Down
Loading

0 comments on commit 0dda88a

Please sign in to comment.