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

Accounts module #58

Closed
xlc opened this issue Jan 13, 2020 · 0 comments · Fixed by #70
Closed

Accounts module #58

xlc opened this issue Jan 13, 2020 · 0 comments · Fixed by #70
Assignees

Comments

@xlc
Copy link
Member

xlc commented Jan 13, 2020

Accounts module

  • Trait
    • FreeTransferCount: Get<u8>
    • FreeTransferPeriod: Get<Moment>
    • Time: Time
    • Call: Parameter + Dispatchable<Origin=::Origin> + IsSubType<orml_currencies::Module<Self>, Self>;
    • Currency: Currency
  • Storages
    • LastFreeTransfers: map AccountId => Vec<Moment>
      • Store last FreeTransferCount free transfer time for each account
  • Module
    • impl OnReapAccount
      • clear LastFreeTransfers for reaped account
    • try_free_transfer(who: AccountId) -> bool
      • Read LastFreeTransfers, remove all the expired entries (value < now - FreeTransferPeriod), return true and append now to the list if entries count less than FreeTransferCount otherwise return false
  • ChargeTransactionPayment: SignedExtension
    • Similar to ChargeTransactionPayment in pallet-transaction-payment module
    • it additionaly call try_free_transfer and skip the withdraw fee part if the call is currencies.transfer and user still have free transfer
    • check pallet-contracts CheckBlockGasLimit for how to check call type
    • Use transaction_payment::ChargeTransactionPayment::from(tip)::compute_fee to reduce copy & paste

Update runtime to use the new ChargeTransactionPayment instead of the one in transaction payment module

We will still need additional requirements for an account to be able to make free transfer. This is still TBD.

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 a pull request may close this issue.

2 participants