Skip to content

Commit

Permalink
Update jormungandr for mkStdTx change
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Sep 23, 2020
1 parent f3c79f2 commit a76ae7e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/jormungandr/cardano-wallet-jormungandr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ test-suite unit
, contra-tracer
, deepseq
, directory
, extra
, filepath
, file-embed
, fmt
Expand Down
2 changes: 2 additions & 0 deletions lib/jormungandr/src/Cardano/Wallet/Jormungandr/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import Cardano.Wallet.Primitive.Types
( ChimericAccount (..)
, Hash (..)
, SealedTx (..)
, SlotNo (..)
, Tx (..)
, TxMetadata
, TxOut (..)
Expand Down Expand Up @@ -156,6 +157,7 @@ newTransactionLayer block0H = TransactionLayer
, metadata = Nothing
}
, finalizeFragment fragment
, maxBound :: SlotNo
)

-- NOTE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ fixtureExternalTx ctx toSend = do
let wSrc = getFromResponse Prelude.id r0
-- we take input by lookking at transactions of the faucet wallet
txsSrc <- listAllTransactions @n ctx wSrc
let (ApiTransaction (ApiT theTxId) _ _ _ _ _ _ outs _ _ _):_ = reverse txsSrc
let (ApiTransaction (ApiT theTxId) _ _ _ _ _ _ _ outs _ _ _):_ = reverse txsSrc
let (AddressAmount ((ApiT addrSrc),_) (Quantity amt)):_ = outs
let (rootXPrv, pwd, st) = getSeqState mnemonicFaucet fixturePassphrase
-- we create change address
Expand Down Expand Up @@ -716,7 +716,7 @@ fixtureExternalTx ctx toSend = do
tl <- newTransactionLayer <$> getBlock0H
let rewardAcnt = error "rewardAcnt unused"
let curSlot = error "current slot not needed in jormungandr mkStdTx"
let (Right (tx, bin)) = mkStdTx tl rewardAcnt keystore curSlot Nothing cs
let (Right (tx, bin, _)) = mkStdTx tl rewardAcnt keystore curSlot Nothing cs

return ExternalTxFixture
{ srcWallet = wSrc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import Data.Proxy
( Proxy (..) )
import Data.Text.Class
( toText )
import Data.Tuple.Extra
( snd3 )
import Test.Hspec
( HasCallStack, Spec, SpecWith, describe, it, shouldBe )
import Test.QuickCheck
Expand Down Expand Up @@ -507,7 +509,7 @@ goldenTestStdTx tl keystore inps outs bytes' = it title $ do
let cs = mempty { inputs = inps, outputs = outs }
let rewardAcnt = error "unused"
let tx = mkStdTx tl rewardAcnt keystore (SlotNo 0) Nothing cs
let bytes = hex . getSealedTx . snd <$> tx
let bytes = hex . getSealedTx . snd3 <$> tx
bytes `shouldBe` Right bytes'
where
title = "golden test mkStdTx: " <> show inps <> show outs
Expand All @@ -529,7 +531,7 @@ goldenTestDelegationCertTx tl keystore pool (accountXPrv, pass) inputs outputs b
keystore
(SlotNo 0)
(mempty { inputs, outputs })
let sealed = getSealedTx . snd <$> res
let sealed = getSealedTx . snd3 <$> res
sealed `shouldBe` Right (unsafeFromHex bytes')
& counterexample ("poolId = " <> showHex (getPoolId pool))
where
Expand Down
1 change: 1 addition & 0 deletions nix/.stack.nix/cardano-wallet-jormungandr.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a76ae7e

Please sign in to comment.