Skip to content

Commit

Permalink
WIP: Propagate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Jul 31, 2024
1 parent 9f71ac6 commit 52f00da
Showing 3 changed files with 251 additions and 186 deletions.
17 changes: 14 additions & 3 deletions cardano-api/internal/Cardano/Api/Convenience/Construction.hs
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ where
import Cardano.Api.Address
import Cardano.Api.Certificate
import Cardano.Api.Eon.ShelleyBasedEra
import Cardano.Api.Eras
import Cardano.Api.Experimental.Eras (sbeToEra)
import Cardano.Api.Experimental.Tx
import Cardano.Api.Fees
import Cardano.Api.ProtocolParameters
import Cardano.Api.Query
@@ -31,6 +34,7 @@ import qualified Cardano.Ledger.Keys as L

import qualified Data.List as List
import qualified Data.Map.Strict as Map
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
@@ -72,7 +76,9 @@ constructBalancedTx
stakeDelegDeposits
drepDelegDeposits
shelleyWitSigningKeys = do
BalancedTxBody _ txbody _txBalanceOutput _fee <-
let availableEra = fromMaybe (error "TODO") $ sbeToEra sbe

BalancedTxBody _ unsignedTx _txBalanceOutput _fee <-
makeTransactionBodyAutoBalance
sbe
systemStart
@@ -86,8 +92,13 @@ constructBalancedTx
changeAddr
mOverrideWits

let keyWits = map (makeShelleyKeyWitness sbe txbody) shelleyWitSigningKeys
return $ makeSignedTransaction keyWits txbody
let alternateKeyWits = map (makeKeyWitness availableEra unsignedTx) shelleyWitSigningKeys
signedTx = signTx availableEra [] alternateKeyWits unsignedTx

caseShelleyToAlonzoOrBabbageEraOnwards
(const $ error "constructBalancedTx: TODO Fail")
(\w -> return $ ShelleyTx sbe $ obtainShimConstraints w signedTx)
sbe

data TxInsExistError
= TxInsDoNotExist [TxIn]
Loading

0 comments on commit 52f00da

Please sign in to comment.