moonbeam-foundation / crowdloan-rewards

Substrate pallet that enables parachains to issue rewards to crowdloan contributors in parachain-native tokens.
12 stars 16 forks source link

Loosely couple to Block Number Provider #26

Open JoshOrndorff opened 3 years ago

JoshOrndorff commented 3 years ago

Currently this pallet is tightly coupled to cumulus-pallet-parachain-system for purposes of reading the relay chain block number.

In https://github.com/paritytech/cumulus/pull/515 the parachain system pallet began exposing the relay chain block number through a trait which means this pallet can be abstracted over the BlockNumberProvider.

This has two concrete positive effects:

  1. Other chains can use this pallet unmodified even if they want to use the parachain block number for the vesting schedule.
  2. Parachain system is removed from the dependency graph (and replaced with an easier-to-mock BlockNumberProvider in the tests).