Skip to content

Commit

Permalink
Rename ApiCoinSelection into ApiCoins
Browse files Browse the repository at this point in the history
  • Loading branch information
akegalj authored and KtorZ committed Apr 9, 2019
1 parent 8f72d8d commit e9e0bcf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
14 changes: 7 additions & 7 deletions src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Cardano.Wallet.Api.Types
, PostTransactionData (..)
, ApiBlockData (..)
, ApiTransaction (..)
, ApiCoinSelection (..)
, ApiCoins (..)

-- * Polymorphic Types
, ApiT (..)
Expand Down Expand Up @@ -146,7 +146,7 @@ data WalletPutPassphraseData = WalletPutPassphraseData
} deriving (Eq, Generic, Show)

data PostTransactionData = PostTransactionData
{ targets :: !(NonEmpty ApiCoinSelection)
{ targets :: !(NonEmpty ApiCoins)
, passphrase :: !(ApiT (Passphrase "encryption"))
} deriving (Eq, Generic, Show)

Expand All @@ -156,12 +156,12 @@ data ApiTransaction = Transaction
, insertedAt :: !ApiBlockData
, depth :: !(Quantity "block" Natural)
, direction :: !(ApiT Direction)
, inputs :: !(NonEmpty ApiCoinSelection)
, outputs :: !(NonEmpty ApiCoinSelection)
, inputs :: !(NonEmpty ApiCoins)
, outputs :: !(NonEmpty ApiCoins)
, status :: !(ApiT TxStatus)
} deriving (Eq, Generic, Show)

data ApiCoinSelection = ApiCoinSelection
data ApiCoins = ApiCoins
{ address :: !(ApiT Address)
, amount :: !(Quantity "lovelace" Natural)
} deriving (Eq, Generic, Show)
Expand Down Expand Up @@ -351,9 +351,9 @@ instance FromJSON ApiBlockData where
instance ToJSON ApiBlockData where
toJSON = genericToJSON defaultRecordTypeOptions

instance FromJSON ApiCoinSelection where
instance FromJSON ApiCoins where
parseJSON = genericParseJSON defaultRecordTypeOptions
instance ToJSON ApiCoinSelection where
instance ToJSON ApiCoins where
toJSON = genericToJSON defaultRecordTypeOptions

instance FromJSON ApiTransaction where
Expand Down
33 changes: 0 additions & 33 deletions test/data/Cardano/Wallet/Api/ApiCoinSelection.json

This file was deleted.

33 changes: 33 additions & 0 deletions test/data/Cardano/Wallet/Api/ApiCoins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"seed": 1596151145858807018,
"samples": [
{
"amount": {
"quantity": 23,
"unit": "lovelace"
},
"address": "24XPC6GMBaKc7rFagPWAdf1y1QRxtoschuQrW1UaY3c6zWgwvFqxrnnqkvpxM3NeP8Dsu"
},
{
"amount": {
"quantity": 166,
"unit": "lovelace"
},
"address": "tmVPg75NvMJ43HHzuNHvqErT8Gymf1pDCfRBfkuiRDHjmLupCjHGdTJ2Vu1sbPCxuGb6"
},
{
"amount": {
"quantity": 103,
"unit": "lovelace"
},
"address": "UyqT3LupEdQHHyknoYuVjBWNUaiqSHw8LneNc6mfTA42Z14hxA8koVqR7ZL6rjesX4mj"
},
{
"amount": {
"quantity": 55,
"unit": "lovelace"
},
"address": "26hc6JWeqBs831mMMuUfT5LLVPDHtre1ZxYQXiQwoj6aZHw4TPymt4WoFtA96t7xWW2Et"
}
]
}
6 changes: 3 additions & 3 deletions test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Cardano.Wallet.Api
import Cardano.Wallet.Api.Types
( ApiAddress (..)
, ApiBlockData (..)
, ApiCoinSelection (..)
, ApiCoins (..)
, ApiMnemonicT (..)
, ApiT (..)
, ApiTransaction (..)
Expand Down Expand Up @@ -173,7 +173,7 @@ spec = do

roundtripAndGolden $ Proxy @ PostTransactionData
roundtripAndGolden $ Proxy @ ApiTransaction
roundtripAndGolden $ Proxy @ ApiCoinSelection
roundtripAndGolden $ Proxy @ ApiCoins
roundtripAndGolden $ Proxy @ ApiBlockData
roundtripAndGolden $ Proxy @ (ApiT SlotId)
roundtripAndGolden $ Proxy @ (ApiT TxStatus)
Expand Down Expand Up @@ -435,7 +435,7 @@ instance Arbitrary SlotId where
arbitrary = SlotId <$> arbitrary <*> arbitrary
shrink = genericShrink

instance Arbitrary ApiCoinSelection where
instance Arbitrary ApiCoins where
arbitrary = genericArbitrary
shrink = genericShrink

Expand Down

0 comments on commit e9e0bcf

Please sign in to comment.