Remove transaction-based type parameters and traits

This commit is contained in:
志宇
2023-03-08 11:39:25 +13:00
parent de9457fce6
commit 0505cd7242
12 changed files with 180 additions and 336 deletions

View File

@@ -124,7 +124,7 @@ fn update_evicts_conflicting_tx() {
cg
};
let changeset = ChangeSet::<TxHeight, Transaction> {
let changeset = ChangeSet::<TxHeight> {
chain: sparse_chain::ChangeSet {
checkpoints: Default::default(),
txids: [
@@ -203,7 +203,7 @@ fn update_evicts_conflicting_tx() {
cg
};
let changeset = ChangeSet::<TxHeight, Transaction> {
let changeset = ChangeSet::<TxHeight> {
chain: sparse_chain::ChangeSet {
checkpoints: [(1, Some(h!("B'")))].into(),
txids: [
@@ -287,7 +287,7 @@ fn chain_graph_new_missing() {
let new_graph = ChainGraph::new(update.clone(), graph.clone()).unwrap();
let expected_graph = {
let mut cg = ChainGraph::<TxHeight, Transaction>::default();
let mut cg = ChainGraph::<TxHeight>::default();
let _ = cg
.insert_checkpoint(update.latest_checkpoint().unwrap())
.unwrap();

View File

@@ -35,7 +35,7 @@ fn insert_txouts() {
)];
let mut graph = {
let mut graph = TxGraph::<Transaction>::default();
let mut graph = TxGraph::default();
for (outpoint, txout) in &original_ops {
assert_eq!(
graph.insert_txout(*outpoint, txout.clone()),
@@ -49,7 +49,7 @@ fn insert_txouts() {
};
let update = {
let mut graph = TxGraph::<Transaction>::default();
let mut graph = TxGraph::default();
for (outpoint, txout) in &update_ops {
assert_eq!(
graph.insert_txout(*outpoint, txout.clone()),
@@ -362,7 +362,7 @@ fn test_calculate_fee_on_coinbase() {
output: vec![TxOut::default()],
};
let graph = TxGraph::<Transaction>::default();
let graph = TxGraph::default();
assert_eq!(graph.calculate_fee(&tx), Some(0));
}