Skip to content

Commit

Permalink
chore: rename to post_transaction ledger/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
thevaibhav-dixit committed Jun 28, 2024
1 parent 3dd3152 commit 186b4ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cala-ledger/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ impl CalaLedger {
&self.transactions
}

pub async fn transaction_post(
pub async fn post_transaction(
&self,
tx_id: TransactionId,
tx_template_code: &str,
params: impl Into<Params> + std::fmt::Debug,
) -> Result<Transaction, LedgerError> {
let mut op = AtomicOperation::init(&self.pool, &self.outbox).await?;
let transaction = self
.transaction_post_in_op(&mut op, tx_id, tx_template_code, params)
.post_transaction_in_op(&mut op, tx_id, tx_template_code, params)
.await?;
op.commit().await?;
Ok(transaction)
Expand All @@ -151,7 +151,7 @@ impl CalaLedger {
fields(transaction_id, external_id)
err
)]
pub async fn transaction_post_in_op(
pub async fn post_transaction_in_op(
&self,
op: &mut AtomicOperation<'_>,
tx_id: TransactionId,
Expand Down
2 changes: 1 addition & 1 deletion cala-ledger/tests/account_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn balances() -> anyhow::Result<()> {
params.insert("journal_id", journal.id().to_string());
params.insert("sender", sender_account.id());
params.insert("recipient", recipient_account.id());
cala.transaction_post(TransactionId::new(), &tx_code, params)
cala.post_transaction(TransactionId::new(), &tx_code, params)
.await
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions cala-ledger/tests/transaction_post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn transaction_post() -> anyhow::Result<()> {
params.insert("sender", sender_account.id());
params.insert("recipient", recipient_account.id());

cala.transaction_post(TransactionId::new(), &tx_code, params)
cala.post_transaction(TransactionId::new(), &tx_code, params)
.await
.unwrap();

Expand All @@ -40,7 +40,7 @@ async fn transaction_post() -> anyhow::Result<()> {
params.insert("journal_id", journal.id());
params.insert("sender", sender_account.id());
params.insert("recipient", recipient_account.id());
cala.transaction_post(TransactionId::new(), &tx_code, params)
cala.post_transaction(TransactionId::new(), &tx_code, params)
.await
.unwrap();
let recipient_balance = cala
Expand Down
2 changes: 1 addition & 1 deletion cala-server/src/graphql/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl<E: MutationExtensionMarker> CoreMutation<E> {
let params = input.params.map(cala_ledger::tx_template::Params::from);
let transaction = app
.ledger()
.transaction_post_in_op(
.post_transaction_in_op(
&mut op,
input.transaction_id.into(),
&input.tx_template_code,
Expand Down

0 comments on commit 186b4ad

Please sign in to comment.