This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
How to support multiple currencies in pallet_treasury? #5081
Labels
J0-enhancement
An additional feature request.
Milestone
Spec
propose_spend
receive aCurrency<AccountId>::Balance
as an argument, what if we declare multiple currencies inTrait
and write different logics?pallet_treasury::Trait
propose_spend
method inCall
Is it possible to compose the
Balance
argument as anenum
, or implement different traits to infer which currency is passing in?I've just tried both of
enum
antrait
and failed both of them.enum
solutionMacro parse failed, lack of
Encode
andDecode
trait, even derive them to theenum
.trait
solutionThis seems impossible because
Trait
is totally alltypes
and doesn't haveSized
to compile.sp_std::any::TypeId
solutionFailed as
trait
one.Wondering
If it is unnecessary or impossible implementing
CurrencyA, CurrencyB....
in pallet_treasury? If it is, how can I reach different logics for differentBalance
s inpropose_spend
method?The text was updated successfully, but these errors were encountered: