Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Apr 29, 2024
1 parent 95c0a6f commit 19bea41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions cardano-faucet/src/Cardano/Faucet/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import Cardano.Address.Style.Shelley (Shelley, Role(UTxOExternal, Stake), derive
import Cardano.Api (AnyCardanoEra, IsCardanoEra, TxIn, TxOut, CtxUTxO, TxInMode, TxId, FileError, AddressAny, AssetId(AssetId, AdaAssetId), Quantity, SigningKey, PaymentExtendedKey, VerificationKey, HashableScriptData)
import Cardano.Api.Shelley (PoolId, StakeExtendedKey, StakeCredential, AssetName(..), NetworkId(Testnet, Mainnet), NetworkMagic(NetworkMagic), ShelleyWitnessSigningKey)
import Cardano.Api (InputDecodeError)
--import Cardano.CLI.Shelley.Run.Address (SomeAddressVerificationKey(AByronVerificationKey, APaymentVerificationKey, APaymentExtendedVerificationKey, AGenesisUTxOVerificationKey), AddressCmdError, buildShelleyAddress)
--import Cardano.CLI.Shelley.Run.Transaction (ShelleyTxCmdError, renderShelleyTxCmdError)
import Cardano.Ledger.Coin (Coin)
import Cardano.Mnemonic (mkSomeMnemonic, getMkSomeMnemonicError)
import Cardano.Prelude
Expand Down Expand Up @@ -221,7 +219,8 @@ instance Aeson.FromJSON FaucetConfigFile where

-- a value with only ada, or a value containing a mix of assets
-- TODO, maybe replace with the cardano Value type?
data FaucetValue = Ada Coin
data FaucetValue
= Ada Coin
| FaucetValueMultiAsset Coin FaucetToken
| FaucetValueManyTokens Coin deriving (Show, Eq, Ord)

Expand Down
5 changes: 3 additions & 2 deletions cardano-faucet/src/Cardano/Faucet/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

module Cardano.Faucet.Utils where

import Cardano.Api (TxIn, TxOut(TxOut), CtxUTxO, Lovelace, CardanoEra, TxFee, txFeesExplicitInEra, TxFee(TxFeeImplicit, TxFeeExplicit), anyCardanoEra, TxValidityLowerBound(TxValidityNoLowerBound), TxValidityUpperBound(TxValidityNoUpperBound), validityNoUpperBoundSupportedInEra)
import Cardano.Api (TxIn, TxOut(TxOut), CtxUTxO, CardanoEra, TxFee (..), TxValidityLowerBound (..), TxValidityUpperBound (..), anyCardanoEra)
import Cardano.Faucet.Misc
import Cardano.Faucet.Types
import Cardano.Ledger.Coin (Coin)
import Cardano.Prelude hiding ((%))
import Control.Concurrent.STM (TMVar, takeTMVar, putTMVar)
import Control.Monad.Trans.Except.Extra (left)
Expand Down Expand Up @@ -67,7 +68,7 @@ findUtxoOfSize utxoTMVar value = do

validateTxFee ::
CardanoEra era
-> Maybe Lovelace
-> Maybe Coin
-> ExceptT FaucetWebError IO (TxFee era)
validateTxFee era mfee = case (txFeesExplicitInEra era, mfee) of
(Left implicit, Nothing) -> return (TxFeeImplicit implicit)
Expand Down

0 comments on commit 19bea41

Please sign in to comment.