Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/accounts #70

Merged
merged 3 commits into from
Jan 20, 2020
Merged

feature/accounts #70

merged 3 commits into from
Jan 20, 2020

Conversation

wangjj9219
Copy link
Member

@wangjj9219 wangjj9219 commented Jan 17, 2020

Closes #58

@wangjj9219
Copy link
Member Author

ChargeTransactionPayment in pallet_transaction_payment doesn't expose the compute_fee ,So I copy the code.

https://github.com/paritytech/substrate/blob/7248ac20c4386b30804dcad1bdeeed4c0a71b6ca/frame/transaction-payment/src/lib.rs#L154-L155

pub trait Trait: system::Trait + pallet_transaction_payment::Trait + orml_currencies::Trait {
type FreeTransferCount: Get<u8>;
type FreeTransferPeriod: Get<MomentOf<Self>>;
type Time: Time;
type Currency: MultiCurrency<Self::AccountId> + Send + Sync;
type Call: Parameter
+ Dispatchable<Origin = <Self as system::Trait>::Origin>
+ IsSubType<orml_currencies::Module<Self>, Self>;
}

And define type Call satisfied IsSubType<orml_currencies::Module<Self>, Self> ,If do not declare Trait derives from orml_currencies::Trait , will get following error , is that ok?

error[E0277]: the trait bound `Self: orml_currencies::Trait` is not satisfied
  --> modules/accounts/src/lib.rs:26:1
   |
26 | / pub trait Trait: system::Trait + pallet_transaction_payment::Trait {
27 | |     type FreeTransferCount: Get<u8>;
28 | |     type FreeTransferPeriod: Get<MomentOf<Self>>;
29 | |     type Time: Time;
...  |
33 | |         + IsSubType<orml_currencies::Module<Self>, Self>;
34 | | }
   | |_^ the trait `orml_currencies::Trait` is not implemented for `Self`
   |
   = note: required because of the requirements on the impl of `sp_api_hidden_includes_decl_storage::hidden_include::Callable<Self>` for `orml_currencies::Module<Self>`
   = note: required by `sp_api_hidden_includes_decl_storage::hidden_include::IsSubType`

@xlc
Copy link
Member

xlc commented Jan 18, 2020

Looks reasonable. I will open a PR upstream to make compute_fee public

@xlc
Copy link
Member

xlc commented Jan 20, 2020

#72 should include paritytech/substrate#4669

@wangjj9219 wangjj9219 marked this pull request as ready for review January 20, 2020 06:33
@wangjj9219 wangjj9219 merged commit 9e9a24b into master Jan 20, 2020
@wangjj9219 wangjj9219 deleted the feature/accounts branch January 20, 2020 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accounts module
2 participants