|
|
@@ -45,7 +45,6 @@ use darkfi_money_contract::{
|
|
|
MoneyFunction, MONEY_CONTRACT_ZKAS_FEE_NS_V1,
|
|
|
};
|
|
|
use darkfi_sdk::{
|
|
|
- blockchain::compute_fee,
|
|
|
bridgetree::Position,
|
|
|
crypto::{
|
|
|
keypair::{Address, Keypair, PublicKey, SecretKey, StandardAddress},
|
|
|
@@ -54,6 +53,7 @@ use darkfi_sdk::{
|
|
|
BaseBlind, FuncId, MerkleNode, MerkleTree, ScalarBlind, MONEY_CONTRACT_ID,
|
|
|
},
|
|
|
dark_tree::DarkLeaf,
|
|
|
+ fee::minimum_fee,
|
|
|
pasta::pallas,
|
|
|
ContractCall,
|
|
|
};
|
|
|
@@ -1291,7 +1291,9 @@ impl Drk {
|
|
|
) -> Result<(ContractCall, Vec<Proof>, Vec<SecretKey>)> {
|
|
|
// First we verify the fee-less transaction to see how much fee it requires for execution
|
|
|
// and verification.
|
|
|
- let required_fee = compute_fee(&FEE_CALL_GAS) + self.get_tx_fee(tx, false).await?;
|
|
|
+ let fee_call_fee = minimum_fee(FEE_CALL_GAS)?;
|
|
|
+ let tx_fee = self.get_tx_fee(tx, false).await?;
|
|
|
+ let required_fee = fee_call_fee.checked_add(tx_fee).ok_or(Error::AdditionOverflow)?;
|
|
|
|
|
|
// Knowing the total gas, we can now find an OwnCoin of enough value
|
|
|
// so that we can create a valid Money::Fee call.
|