Tighter tx check; comments; failing test in CI
This commit is contained in:
parent
8ae1ddf03e
commit
0d5e39a26d
2 changed files with 5 additions and 5 deletions
|
@ -31,9 +31,9 @@ fn test_reader() {
|
||||||
|
|
||||||
let txes = TxClient::all(&c).expect("bootstrap transactions");
|
let txes = TxClient::all(&c).expect("bootstrap transactions");
|
||||||
|
|
||||||
// Don't inspect the bootstrap, but we'd like to see it's there.
|
// Don't inspect the bootstrap transaction, but we'd like to see it's there.
|
||||||
assert_eq!(1, txes.len());
|
assert_eq!(1, txes.len());
|
||||||
assert_eq!(76, txes[0].parts.len());
|
assert_eq!(94, txes[0].parts.len());
|
||||||
|
|
||||||
let ids = conn.transact(&mut c, r#"[
|
let ids = conn.transact(&mut c, r#"[
|
||||||
[:db/add "s" :db/ident :foo/numba]
|
[:db/add "s" :db/ident :foo/numba]
|
||||||
|
|
|
@ -96,7 +96,7 @@ impl TxReader for TxClient {
|
||||||
let datom = datom_result?;
|
let datom = datom_result?;
|
||||||
|
|
||||||
// Datom represents a transaction.
|
// Datom represents a transaction.
|
||||||
if datom.a == entids::DB_TX_INSTANT {
|
if datom.a == entids::DB_TX_INSTANT && datom.tx == datom.e {
|
||||||
// Does the Tx already exist in the map? That means we've inserted it
|
// Does the Tx already exist in the map? That means we've inserted it
|
||||||
// with an incomplete tx_instant; update it.
|
// with an incomplete tx_instant; update it.
|
||||||
if let Entry::Occupied(mut tx) = txes_by_tx.entry(datom.tx) {
|
if let Entry::Occupied(mut tx) = txes_by_tx.entry(datom.tx) {
|
||||||
|
@ -111,14 +111,14 @@ impl TxReader for TxClient {
|
||||||
});
|
});
|
||||||
// Datom represents a transaction part.
|
// Datom represents a transaction part.
|
||||||
} else {
|
} else {
|
||||||
// Does the Tx for this part already exist in the map?
|
|
||||||
// Append this part to the parts list.
|
|
||||||
let part = TxPart {
|
let part = TxPart {
|
||||||
e: datom.e,
|
e: datom.e,
|
||||||
a: datom.a,
|
a: datom.a,
|
||||||
v: datom.v,
|
v: datom.v,
|
||||||
added: datom.added,
|
added: datom.added,
|
||||||
};
|
};
|
||||||
|
// Does the Tx for this part already exist in the map?
|
||||||
|
// Append this part to the parts list.
|
||||||
if let Entry::Occupied(mut tx) = txes_by_tx.entry(datom.tx) {
|
if let Entry::Occupied(mut tx) = txes_by_tx.entry(datom.tx) {
|
||||||
tx.get_mut().parts.push(part);
|
tx.get_mut().parts.push(part);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue