Skip to content

Commit

Permalink
base TxIn and TxOut on cardano-api types
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Aug 4, 2020
1 parent d770874 commit 1a5f624
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 18 deletions.
3 changes: 2 additions & 1 deletion cardano-transactions.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 47bb01752313aa8294f6509cb2b9831f80d7074df9a8ee7618ed51840eded4e2
-- hash: df09fbf9727e27a4624e33d59417197d0674b01eba5ab61aab9542b8fb767ec5

name: cardano-transactions
version: 1.0.0
Expand Down Expand Up @@ -43,6 +43,7 @@ library
base >=4.7 && <5
, base58-bytestring
, bytestring
, cardano-api
, cardano-binary
, cardano-crypto
, cardano-crypto-wrapper
Expand Down
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ library:
dependencies:
- base58-bytestring
- bytestring
- cardano-api
- cardano-binary
- cardano-crypto
- cardano-crypto-wrapper
Expand Down
21 changes: 8 additions & 13 deletions src/Data/UTxO/Transaction/Cardano/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ module Data.UTxO.Transaction.Cardano.Shelley
, Shelley
) where

import Cardano.Chain.UTxO
( TxIn (..), TxInWitness (..), TxOut (..), TxSigData (..) )
import Cardano.Crypto.Signing
( SigningKey (..) )
import Data.List.NonEmpty
( NonEmpty )
import Cardano.Api.Typed
( TxIn (..), TxOut (..) )
import Data.UTxO.Transaction
( ErrMkPayment (..), MkPayment (..) )
( MkPayment (..) )
import Shelley.Spec.Ledger.BaseTypes
( Network (..) )

import qualified Cardano.Api.Typed as Cardano

-- | Construct a payment 'Init' for /Shelley/ from primitive types.
--
Expand Down Expand Up @@ -69,15 +66,13 @@ instance MkPayment Shelley where
type Init Shelley = Network

type Input Shelley = TxIn
type Output Shelley = TxOut
type SignKey Shelley = SigningKey
type Output Shelley = TxOut Cardano.Shelley
type SignKey Shelley = ()

type CoinSel Shelley =
(Network, [TxIn], [TxOut])
(Network, [TxIn], [TxOut Cardano.Shelley])

type Tx Shelley = Either
ErrMkPayment
(Network, NonEmpty TxIn, NonEmpty TxOut, TxSigData, [TxInWitness])
type Tx Shelley = ()

empty = undefined
addInput = undefined
Expand Down
48 changes: 44 additions & 4 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ packages:
- .

extra-deps:
- hedgehog-quickcheck-0.1.1
- base64-0.4.1
- base58-bytestring-0.1.0
- bech32-1.1.0
- canonical-json-0.6.0.0
- dns-3.0.4
- generic-monoid-0.1.0.1
- gray-code-0.3.1
- hedgehog-quickcheck-0.1.1
- libsystemd-journal-1.4.4
- moo-1.2
- network-3.1.1.1
- quiet-0.2
- sop-core-0.5.0.1
- statistics-linreg-0.3
- streaming-binary-0.3.0.1
- moo-1.2
- gray-code-0.3.1
- time-units-1.0.0
- transformers-except-0.1.1
- Unique-0.4.7.7
- generic-monoid-0.1.0.1


- git: https://github.com/input-output-hk/cardano-prelude
commit: 316c854d1d3089f480708ad5cd5ecf8a74423ddd
Expand Down Expand Up @@ -55,10 +65,40 @@ extra-deps:
commit: efa4b5ecd7f0a13124616b12679cd42517cd905a
subdirs:
- contra-tracer
- iohk-monitoring
- tracer-transformers
- plugins/backend-aggregation
- plugins/backend-ekg
- plugins/backend-monitoring
- plugins/scribe-systemd
- plugins/backend-trace-forwarder

- git: https://github.com/input-output-hk/goblins
commit: 26d35ad52fe9ade3391532dbfeb2f416f07650bc

- git: https://github.com/input-output-hk/cardano-node
commit: ba0f96b1a9fc9232ed211e57835fd5018093069d
subdirs:
- cardano-api
- cardano-config

- git: https://github.com/input-output-hk/ouroboros-network
commit: ec74d1c463b6d18bdca2b714abe730c1d237cc32
subdirs:
- io-sim
- io-sim-classes
- network-mux
- Win32-network
- ouroboros-consensus
- ouroboros-consensus-byron
- ouroboros-consensus-cardano
- ouroboros-consensus-shelley
- ouroboros-consensus/ouroboros-consensus-mock
- ouroboros-network
- ouroboros-network-framework
- typed-protocols
- typed-protocols-examples

flags:
# Bundle VRF crypto in libsodium and do not rely on an external fork to have it.
# This still requires the host system to have the 'standard' libsodium installed.
Expand Down

0 comments on commit 1a5f624

Please sign in to comment.