Skip to content

Commit

Permalink
ledger: Add _ prefix to get_transactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Aug 20, 2024
1 parent 92a76f1 commit 112e75e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ledger/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ mod tests {

// Because there is no transactions are mined, there should be only a
// coinbase transaction.
let txs = ledger.get_transactions();
let txs = ledger._get_transactions();
let coinbase_tx = txs.first().unwrap();

assert_eq!(
Expand Down
10 changes: 5 additions & 5 deletions src/ledger/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Ledger {
Ok(hash)
}

pub fn get_transactions(&self) -> Vec<Transaction> {
pub fn _get_transactions(&self) -> Vec<Transaction> {
let database = self.database.lock().unwrap();

let mut stmt = database.prepare("SELECT body FROM transactions").unwrap();
Expand Down Expand Up @@ -354,7 +354,7 @@ mod tests {
fn transactions_without_checks() {
let ledger = Ledger::new("transactions_without_checks");

assert_eq!(ledger.get_transactions().len(), 0);
assert_eq!(ledger._get_transactions().len(), 0);

let txout = ledger.create_txout(Amount::from_sat(0x45), ScriptBuf::new());
let tx = ledger.create_transaction(vec![], vec![txout]);
Expand All @@ -365,7 +365,7 @@ mod tests {
ledger.add_transaction_unconditionally(tx.clone()).unwrap()
);

let txs = ledger.get_transactions();
let txs = ledger._get_transactions();
assert_eq!(txs.len(), 1);

let tx2 = txs.get(0).unwrap().to_owned();
Expand All @@ -383,7 +383,7 @@ mod tests {
let credentials = Ledger::generate_credential_from_witness();
let address = credentials.address;

assert_eq!(ledger.get_transactions().len(), 0);
assert_eq!(ledger._get_transactions().len(), 0);

// First, add some funds to user, for free.
let txout = ledger.create_txout(Amount::from_sat(0x45 * 0x45), address.script_pubkey());
Expand Down Expand Up @@ -411,7 +411,7 @@ mod tests {
let txid = tx.compute_txid();
assert_eq!(txid, ledger.add_transaction(tx.clone()).unwrap());

let txs = ledger.get_transactions();
let txs = ledger._get_transactions();
assert_eq!(txs.len(), 2);

let read_tx = txs.get(1).unwrap().to_owned();
Expand Down

0 comments on commit 112e75e

Please sign in to comment.