Skip to content

Commit

Permalink
TEMPORARY: lazy doubling of fee subtraction
Browse files Browse the repository at this point in the history
Feels haunted. Adds logging.
  • Loading branch information
conorsch committed Aug 29, 2024
1 parent 8a219f0 commit f553930
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/bin/pcli/src/command/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ impl MigrateCmd {
if value.asset_id == fee.0.asset_id {
note_values_2.push(penumbra_asset::Value {
asset_id: value.asset_id,
amount: value.amount - fee.0.amount,
// HACK: we are doubling the subtraction of the estimated fee,
// as a temporary workaround for the fee estimation being inaccurate,
// oddly by about 1.9x.
amount: value.amount - fee.0.amount - fee.0.amount,
});
} else {
note_values_2.push(penumbra_asset::Value {
Expand All @@ -128,6 +131,15 @@ impl MigrateCmd {
// and spending fees from that account
let address_index = AddressIndex::new(0);

let fee2 = planner_2.compute_fee_estimate(
&gas_prices,
&FeeTier::default(),
&source_address,
);
println!(
"Estimated fee 2/2 for sending total balance: {:?}",
fee2.0.format(&asset_cache)
);
let plan = planner_2
.memo(memo)
.plan(
Expand Down

0 comments on commit f553930

Please sign in to comment.