Skip to content

Commit

Permalink
Add LocalTxSubmissionStatus type
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Apr 10, 2021
1 parent 1778e70 commit 79068d8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/core/src/Cardano/Wallet/Primitive/Types/Tx.hs
Expand Up @@ -28,6 +28,7 @@ module Cardano.Wallet.Primitive.Types.Tx
, UnsignedTx (..)
, TransactionInfo (..)
, Direction (..)
, LocalTxSubmissionStatus (..)
, TokenBundleSizeAssessor (..)
, TokenBundleSizeAssessment (..)

Expand Down Expand Up @@ -386,7 +387,7 @@ instance Buildable a => Buildable (WithDirection a) where
-- to the node.
newtype SealedTx = SealedTx { getSealedTx :: ByteString }
deriving stock (Show, Eq, Generic)
deriving newtype (ByteArrayAccess)
deriving newtype (ByteArrayAccess, NFData)

-- | True if the given metadata refers to a pending transaction
isPending :: TxMeta -> Bool
Expand Down Expand Up @@ -438,6 +439,17 @@ toTxHistory :: TransactionInfo -> (Tx, TxMeta)
toTxHistory info =
(fromTransactionInfo info, txInfoMeta info)

-- | Information about when a transaction was submitted to the local node.
-- This is used for scheduling resubmissions.
data LocalTxSubmissionStatus tx = LocalTxSubmissionStatus
{ txId :: !(Hash "Tx")
, submittedTx :: !tx
, firstSubmission :: !SlotNo
-- ^ Time of first successful submission to the local node.
, latestSubmission :: !SlotNo
-- ^ Time of most recent resubmission attempt.
} deriving (Generic, Show, Eq)

-- | A function capable of assessing the size of a token bundle relative to the
-- upper limit of what can be included in a single transaction output.
--
Expand Down

0 comments on commit 79068d8

Please sign in to comment.