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

Add pallet-flow #8

Merged
merged 18 commits into from
Mar 13, 2022
Merged

Add pallet-flow #8

merged 18 commits into from
Mar 13, 2022

Conversation

vovacha
Copy link
Contributor

@vovacha vovacha commented Feb 18, 2022

Pallet Flow migration.

DONE:

  • Pallet Flow code migration.
  • orml-currencies support.
  • Fixed point arithmetic: CampaignFee.
  • Mocks, tests.
  • .editorconfig.

TODO:

  • Benchmarks (blocked by Control pallet)

Next steps:

  1. Merge Flow, Signal, Control feature branches.
  2. Test everything together, update zero-protocol runtime.
  3. Flow benchmarks, Signal benchmarks.
  4. Control tests and benchmarks.
  5. Hardening.

@vovacha vovacha self-assigned this Feb 18, 2022
@vovacha vovacha linked an issue Feb 18, 2022 that may be closed by this pull request
12 tasks
@2075
Copy link
Member

2075 commented Feb 18, 2022

@vovacha we could also collect those primitives which are gamedao specific in another primitives module in here.

@vovacha vovacha marked this pull request as ready for review March 11, 2022 15:37
@vovacha vovacha changed the title WIP: Add pallet-flow Add pallet-flow Mar 11, 2022
@vovacha vovacha requested review from 2075 and vayesy March 11, 2022 15:38
pub type AccountId = u32;
pub type BlockNumber = u32;
pub type Hash = H256;
pub type Timestamp = u64;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub type Timestamp = u64;
use zero_primitives::{BlockNumber, Hash, Timestamp};

And use those variables here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to explicitly declare those types here to show that they could potentially differ from the actual runtime types from zero_primitives even if they are the same now.


/// Campaign
#[pallet::storage]
#[pallet::getter(fn campaign_by_id)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a ToDo somewhere in the file to update storage objects and drop getters as we discussed earlier?


// unreserve the amount in contributor balance
T::Currency::unreserve(
T::FundingCurrencyId::get(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can store result of T::FundingCurrencyId::get() to some variable and use it instead, since this value is used in multiple places over the on_finalize hook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Both getters refactoring, and this issue will be handled later during the hardening stage.

@vovacha vovacha merged commit 8eb87a5 into main Mar 13, 2022
@vovacha vovacha deleted the migration/flow branch March 24, 2022 23:26
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.

beta/dev: migrate flow pallet to 3.0
3 participants