Remove Fee from the Network API

The only benefit to having it would be the ability to cache it across
prepare_send, which can be done internally to the Network.
This commit is contained in:
Luke Parker
2023-10-20 16:12:26 -04:00
parent 5977121c48
commit c056b751fe
7 changed files with 39 additions and 81 deletions

View File

@@ -41,7 +41,6 @@ async fn spend<N: Network, D: Db>(
payments: vec![],
change: Some(N::change_address(key)),
},
network.get_fee().await,
0,
)
.await

View File

@@ -155,7 +155,6 @@ pub async fn test_signer<N: Network>(network: N) {
let outputs = network.get_outputs(&network.test_send(N::address(key)).await, key).await;
let sync_block = network.get_latest_block_number().await.unwrap() - N::CONFIRMATIONS;
let fee = network.get_fee().await;
let amount = 2 * N::DUST;
let mut keys_txs = HashMap::new();
@@ -170,7 +169,6 @@ pub async fn test_signer<N: Network>(network: N) {
payments: vec![Payment { address: N::address(key), data: None, amount }],
change: Some(N::change_address(key)),
},
fee,
0,
)
.await

View File

@@ -91,12 +91,11 @@ pub async fn test_wallet<N: Network>(network: N) {
}
// Execute the plan
let fee = network.get_fee().await;
let mut keys_txs = HashMap::new();
let mut eventualities = vec![];
for (i, keys) in keys.drain() {
let (signable, eventuality) = network
.prepare_send(network.get_block_number(&block_id).await, plans[0].clone(), fee, 0)
.prepare_send(network.get_block_number(&block_id).await, plans[0].clone(), 0)
.await
.unwrap()
.tx