Skip to content

Commit

Permalink
test: balance moves to outputs and sequential ledger entries (#27)
Browse files Browse the repository at this point in the history
* test: balance moves

* test: sequential ledger
  • Loading branch information
rafaelcr authored Jul 9, 2024
1 parent 62af797 commit cad4124
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 25 deletions.
12 changes: 6 additions & 6 deletions src/db/cache/transaction_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use ordinals::{Cenotaph, Edict, Etching, Rune, RuneId};

use crate::{
db::{
cache::utils::{is_rune_mintable, new_ledger_entry},
cache::utils::{is_rune_mintable, new_sequential_ledger_entry},
models::{
db_ledger_entry::DbLedgerEntry, db_ledger_operation::DbLedgerOperation, db_rune::DbRune,
},
Expand Down Expand Up @@ -66,7 +66,7 @@ impl TransactionCache {
let mut results = vec![];
for (rune_id, unallocated) in self.input_runes.iter() {
for balance in unallocated {
results.push(new_ledger_entry(
results.push(new_sequential_ledger_entry(
&self.location,
Some(balance.amount),
*rune_id,
Expand Down Expand Up @@ -132,7 +132,7 @@ impl TransactionCache {
},
);
}
let entry = new_ledger_entry(
let entry = new_sequential_ledger_entry(
&self.location,
None,
rune_id,
Expand All @@ -154,7 +154,7 @@ impl TransactionCache {
// If the runestone that produced the cenotaph contained an etching, the etched rune has supply zero and is unmintable.
let db_rune = DbRune::from_cenotaph_etching(rune, number, &self.location);
self.etching = Some(db_rune.clone());
let entry = new_ledger_entry(
let entry = new_sequential_ledger_entry(
&self.location,
None,
rune_id,
Expand Down Expand Up @@ -194,7 +194,7 @@ impl TransactionCache {
amount: terms_amount.0,
},
);
Some(new_ledger_entry(
Some(new_sequential_ledger_entry(
&self.location,
Some(terms_amount.0),
rune_id.clone(),
Expand Down Expand Up @@ -226,7 +226,7 @@ impl TransactionCache {
self.location
);
// This entry does not go in the input runes, it gets burned immediately.
Some(new_ledger_entry(
Some(new_sequential_ledger_entry(
&self.location,
Some(terms_amount.0),
rune_id.clone(),
Expand Down
Loading

0 comments on commit cad4124

Please sign in to comment.