We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TxId
Issue
As a user of the Mockchain in testing, I want to be able to easily retrieve the Tx given some TxId.
Tx
Currently, we can do this by writing the following function:
resolveTxIdsMockchain :: ( MonadError (TestError e) m , MonadMockchain m ) => [C.TxId] -> m [C.Tx C.ConwayEra] resolveTxIdsMockchain txIds = do txs <- getTxs let indexedTxs = Map.fromList $ fmap (\tx -> (C.getTxId $ C.getTxBody tx, tx)) txs traverse (\txId -> failOnNothing "Could not find TxId in Mockchain transactions" $ Map.lookup txId indexedTxs) txIds
However, that function is inefficient as we need to query all transactions, then manually index them by TxId.
Possible solution
Add in the MockchainState datatype the field Map TxId Tx, and provide a function to query that (similar to what we do with mcsDatums).
MockchainState
Map TxId Tx
mcsDatums
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
As a user of the Mockchain in testing, I want to be able to easily retrieve the
Tx
given someTxId
.Currently, we can do this by writing the following function:
However, that function is inefficient as we need to query all transactions, then manually index them by
TxId
.Possible solution
Add in the
MockchainState
datatype the fieldMap TxId Tx
, and provide a function to query that (similar to what we do withmcsDatums
).The text was updated successfully, but these errors were encountered: