Skip to content

Commit

Permalink
Merge branch 'main' of github.com:GaloyMoney/cala into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
git committed Dec 6, 2024
2 parents 54cdb25 + 528da88 commit 91bfafe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cala-ledger/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ impl CalaLedger {
Ok(LedgerOperation::init(&self.pool, &self.outbox).await?)
}

pub fn ledger_operation_from_db_op<'a>(
&self,
db_op: es_entity::DbOp<'a>,
) -> LedgerOperation<'a> {
LedgerOperation::new(db_op, &self.outbox)
}

pub fn accounts(&self) -> &Accounts {
&self.accounts
}
Expand Down
8 changes: 8 additions & 0 deletions cala-ledger/src/ledger_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ impl<'t> LedgerOperation<'t> {
})
}

pub(crate) fn new(db_op: DbOp<'t>, outbox: &Outbox) -> Self {
Self {
db_op,
outbox: outbox.clone(),
accumulated_events: Vec::new(),
}
}

pub fn tx(&mut self) -> &mut Transaction<'t, Postgres> {
self.db_op.tx()
}
Expand Down

0 comments on commit 91bfafe

Please sign in to comment.