rust client: add a CU estimate for token withdrawal (#934)
This commit is contained in:
parent
e38798ed0c
commit
55105e085f
|
@ -691,7 +691,7 @@ impl MangoClient {
|
|||
}),
|
||||
},
|
||||
],
|
||||
self.instruction_cu(health_cu),
|
||||
self.instruction_cu(health_cu) + self.context.compute_estimates.cu_per_associated_token_account_creation,
|
||||
);
|
||||
Ok(ixs)
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ pub struct ComputeEstimates {
|
|||
pub cu_per_charge_collateral_fees: u32,
|
||||
pub cu_per_charge_collateral_fees_token: u32,
|
||||
pub cu_for_sequence_check: u32,
|
||||
pub cu_per_associated_token_account_creation: u32,
|
||||
}
|
||||
|
||||
impl Default for ComputeEstimates {
|
||||
|
@ -148,6 +149,7 @@ impl Default for ComputeEstimates {
|
|||
cu_per_charge_collateral_fees_token: 15_000,
|
||||
// measured around 8k, see test_basics
|
||||
cu_for_sequence_check: 10_000,
|
||||
cu_per_associated_token_account_creation: 21_000,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue