Skip to content
Snippets Groups Projects
Unverified Commit 2677a5c4 authored by Éloïs's avatar Éloïs
Browse files

renames

parent 73c3b5b3
No related branches found
No related tags found
No related merge requests found
Pipeline #40965 failed
......@@ -195,9 +195,9 @@ pub mod pallet {
// PUBLIC FUNCTIONS //
impl<T: Config> Pallet<T> {
pub fn estimate_fees_and_refund<Extrinsic>(
pub fn estimate_cost<Extrinsic>(
unchecked_extrinsic: Extrinsic,
) -> EstimatedFeesAndRefund<BalanceOf<T>>
) -> EstimatedCost<BalanceOf<T>>
where
BalanceOf<T>: PartialOrd,
Extrinsic: Encode + ExtrinsicLike + GetDispatchInfo + GetSigner<T::Lookup>,
......@@ -223,7 +223,7 @@ pub mod pallet {
Zero::zero()
};
EstimatedFeesAndRefund {
EstimatedCost {
cost: if fees > refund {
fees - refund
} else {
......
......@@ -22,7 +22,7 @@ sp_api::decl_runtime_apis! {
/// Runtime API for duniter account pallet
pub trait DuniterAccountApi<Balance>
where
EstimatedFeesAndRefund<Balance>: Codec,
EstimatedCost<Balance>: Codec,
{
/// Simulate the maximum cost of an extrinsic
///
......@@ -30,15 +30,15 @@ sp_api::decl_runtime_apis! {
/// - `max_cost`: estimated effective cost for the user (fees - refund)
/// - `max_fees`: estimated amount of fees for the extrinsic
/// - `min_refund`: estimated amount of refund from quota
fn estimate_fees_and_refund(
fn estimate_cost(
uxt: Block::Extrinsic,
) -> EstimatedFeesAndRefund<Balance>;
) -> EstimatedCost<Balance>;
}
}
/// Account total balance information
#[derive(Encode, Decode, TypeInfo, Clone, PartialEq, RuntimeDebug)]
pub struct EstimatedFeesAndRefund<Balance> {
pub struct EstimatedCost<Balance> {
/// The estimated effective cost for the user (fees - refund)
pub cost: Balance,
/// The estimated amount of fees for the extrinsic
......
......@@ -220,10 +220,10 @@ impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Ba
}
impl pallet_duniter_account::DuniterAccountApi<Block, Balance> for Runtime {
fn estimate_fees_and_refund(
fn estimate_cost(
uxt: <Block as BlockT>::Extrinsic,
) -> pallet_duniter_account::EstimatedFeesAndRefund<Balance> {
pallet_duniter_account::Pallet::<Runtime>::estimate_fees_and_refund(uxt)
) -> pallet_duniter_account::EstimatedCost<Balance> {
pallet_duniter_account::Pallet::<Runtime>::estimate_cost(uxt)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment