Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
2677a5c4
Unverified
Commit
2677a5c4
authored
1 month ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
renames
parent
73c3b5b3
No related branches found
No related tags found
No related merge requests found
Pipeline
#40965
failed
1 month ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pallets/duniter-account/src/lib.rs
+3
-3
3 additions, 3 deletions
pallets/duniter-account/src/lib.rs
pallets/duniter-account/src/runtime_api.rs
+4
-4
4 additions, 4 deletions
pallets/duniter-account/src/runtime_api.rs
runtime/common/src/apis.rs
+3
-3
3 additions, 3 deletions
runtime/common/src/apis.rs
with
10 additions
and
10 deletions
pallets/duniter-account/src/lib.rs
+
3
−
3
View file @
2677a5c4
...
...
@@ -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
,
)
->
Estimated
FeesAndRefund
<
BalanceOf
<
T
>>
)
->
Estimated
Cost
<
BalanceOf
<
T
>>
where
BalanceOf
<
T
>
:
PartialOrd
,
Extrinsic
:
Encode
+
ExtrinsicLike
+
GetDispatchInfo
+
GetSigner
<
T
::
Lookup
>
,
...
...
@@ -223,7 +223,7 @@ pub mod pallet {
Zero
::
zero
()
};
Estimated
FeesAndRefund
{
Estimated
Cost
{
cost
:
if
fees
>
refund
{
fees
-
refund
}
else
{
...
...
This diff is collapsed.
Click to expand it.
pallets/duniter-account/src/runtime_api.rs
+
4
−
4
View file @
2677a5c4
...
...
@@ -22,7 +22,7 @@ sp_api::decl_runtime_apis! {
/// Runtime API for duniter account pallet
pub
trait
DuniterAccountApi
<
Balance
>
where
Estimated
FeesAndRefund
<
Balance
>
:
Codec
,
Estimated
Cost
<
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
,
)
->
Estimated
FeesAndRefund
<
Balance
>
;
)
->
Estimated
Cost
<
Balance
>
;
}
}
/// Account total balance information
#[derive(Encode,
Decode,
TypeInfo,
Clone,
PartialEq,
RuntimeDebug)]
pub
struct
Estimated
FeesAndRefund
<
Balance
>
{
pub
struct
Estimated
Cost
<
Balance
>
{
/// The estimated effective cost for the user (fees - refund)
pub
cost
:
Balance
,
/// The estimated amount of fees for the extrinsic
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/apis.rs
+
3
−
3
View file @
2677a5c4
...
...
@@ -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
::
Estimated
FeesAndRefund
<
Balance
>
{
pallet_duniter_account
::
Pallet
::
<
Runtime
>
::
estimate_
fees_and_refund
(
uxt
)
)
->
pallet_duniter_account
::
Estimated
Cost
<
Balance
>
{
pallet_duniter_account
::
Pallet
::
<
Runtime
>
::
estimate_
cost
(
uxt
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment