Load unconfirmed txs in one transaction
@@ -39,20 +39,19 @@ impl<'a> EthereumSchema<'a> {
// operation is associated with exactly one Ethereum transaction. Note that there may
// be ETH transactions without an operation (e.g. `completeWithdrawals` call), but for
// every operation always there is an ETH transaction.
+ self.0.conn().transaction(|| {
let raw_ops: Vec<(
StorageETHOperation,
Option<ETHBinding>,
Option<StoredOperation>,
- )> = self.0.conn().transaction(|| {
- eth_operations::table
+ )> = eth_operations::table
.left_join(
eth_ops_binding::table.on(eth_operations::id.eq(eth_ops_binding::eth_op_id)),
)
.left_join(operations::table.on(operations::id.eq(eth_ops_binding::op_id)))
.filter(eth_operations::confirmed.eq(false))
.order(eth_operations::id.asc())
- .load(self.0.conn())
- })?;
+ .load(self.0.conn())?;
// Create a vector for the expected output.
let mut ops: VecDeque<ETHOperation> = VecDeque::with_capacity(raw_ops.len());
@@ -105,6 +104,7 @@ impl<'a> EthereumSchema<'a> {
}
Ok(ops)
+ })
}
/// Loads the operations which were stored in `operations` table, but not
