Skip to content

Commit 7d8b8dd

Browse files
Fix NoopCurrency
1 parent 619fb5c commit 7d8b8dd

File tree

1 file changed

+33
-2
lines changed
  • pallets/transaction-storage/src

1 file changed

+33
-2
lines changed

pallets/transaction-storage/src/lib.rs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ use polkadot_sdk_frame::{
3838
sp_core::sp_std::{marker::PhantomData, prelude::*},
3939
*,
4040
},
41-
prelude::{fungible::Dust, *},
41+
prelude::{
42+
fungible::{hold::DoneSlash, Dust},
43+
*,
44+
},
4245
traits::fungible::{
43-
hold::Balanced, Inspect, InspectHold, Mutate, MutateHold, Unbalanced, UnbalancedHold,
46+
Balanced, BalancedHold, Inspect, InspectHold, Mutate, MutateHold, Unbalanced,
47+
UnbalancedHold,
4448
},
4549
};
4650
use sp_transaction_storage_proof::{
@@ -88,6 +92,26 @@ pub struct AuthorizationExtent {
8892
/// runtimes that do not want to charge any currency like Bulletin.
8993
pub struct NoopCurrency<Reason>(PhantomData<Reason>);
9094

95+
impl<AccountId, Reason> Balanced<AccountId> for NoopCurrency<Reason>
96+
where
97+
Reason: 'static + Encode + TypeInfo,
98+
{
99+
type OnDropDebt = ();
100+
type OnDropCredit = ();
101+
}
102+
103+
impl<AccountId, Reason> BalancedHold<AccountId> for NoopCurrency<Reason> where
104+
Reason: Encode + TypeInfo + 'static
105+
{
106+
}
107+
108+
impl<AccountId, Reason, Balance> DoneSlash<Reason, AccountId, Balance> for NoopCurrency<Reason>
109+
where
110+
Balance: Sized,
111+
Reason: 'static + Encode + TypeInfo,
112+
{
113+
}
114+
91115
impl<AccountId, Reason> Inspect<AccountId> for NoopCurrency<Reason> {
92116
type Balance = u64;
93117

@@ -172,6 +196,13 @@ where
172196
}
173197
}
174198

199+
impl<AccountId, Reason> Mutate<AccountId> for NoopCurrency<Reason>
200+
where
201+
AccountId: Eq,
202+
Reason: Encode + TypeInfo + 'static,
203+
{
204+
}
205+
175206
impl<AccountId, Reason> MutateHold<AccountId> for NoopCurrency<Reason> where
176207
Reason: Encode + TypeInfo + 'static
177208
{

0 commit comments

Comments
 (0)