difftreelog
Merge pull request #239 from UniqueNetwork/feature/internal-audit
in: master
internal audit
11 files changed
Dockerfilediffbeforeafterbothno changes
Dockerfile-unitdiffbeforeafterbothno changes
docker-compose.ymldiffbeforeafterbothno changes
nftTestnetSpec.jsondiffbeforeafterbothno changes
nftTestnetSpecRaw.jsondiffbeforeafterbothno changes
pallets/inflation/src/lib.rsdiffbeforeafterboth848485 let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0);85 let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0);8687 // TODO: Rewrite inflation to use block timestamp instead of block number88 // let _now = <timestamp::Module<T>>::get();868987 // Recalculate inflation on the first block of the year (or if it is not initialized yet)90 // Recalculate inflation on the first block of the year (or if it is not initialized yet)88 if (now % T::BlockNumber::from(YEAR)).is_zero() || <BlockInflation<T>>::get().is_zero() {91 if (now % T::BlockNumber::from(YEAR)).is_zero() || <BlockInflation<T>>::get().is_zero() {pallets/nft/src/lib.rsdiffbeforeafterboth166 0166 0167 }167 }168168169 /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.169 /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later.170 ///170 ///171 /// # Permissions171 /// # Permissions172 ///172 ///pallets/scheduler/src/lib.rsdiffbeforeafterboth62 traits::{Zero, One, BadOrigin, Saturating},62 traits::{Zero, One, BadOrigin, Saturating},63};63};64use frame_support::{64use frame_support::{65 decl_module, decl_storage, decl_event, decl_error, IterableStorageMap,65 decl_module, decl_storage, decl_event, decl_error,66 dispatch::{Dispatchable, DispatchError, DispatchResult, Parameter},66 dispatch::{Dispatchable, DispatchError, DispatchResult, Parameter},67 traits::{67 traits::{68 Get,68 Get,456}456}457457458impl<T: Config> Module<T> {458impl<T: Config> Module<T> {459 /// Migrate storage format from V1 to V2.460 /// Return true if migration is performed.461 pub fn migrate_v1_to_t2() -> bool {462 if StorageVersion::get() == Releases::V1 {463 StorageVersion::put(Releases::V2);464465 Agenda::<T>::translate::<466 Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>,467 _,468 >(|_, agenda| {469 Some(470 agenda471 .into_iter()472 .map(|schedule| {473 schedule.map(|schedule| ScheduledV2 {474 maybe_id: schedule.maybe_id,475 priority: schedule.priority,476 call: schedule.call,477 maybe_periodic: schedule.maybe_periodic,478 origin: system::RawOrigin::Root.into(),479 _phantom: Default::default(),480 })481 })482 .collect::<Vec<_>>(),483 )484 });485486 true487 } else {488 false489 }490 }491492 /// Helper to migrate scheduler when the pallet origin type has changed.493 pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {494 Agenda::<T>::translate::<495 Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>,496 _,497 >(|_, agenda| {498 Some(499 agenda500 .into_iter()501 .map(|schedule| {502 schedule.map(|schedule| Scheduled {503 maybe_id: schedule.maybe_id,504 priority: schedule.priority,505 call: schedule.call,506 maybe_periodic: schedule.maybe_periodic,507 origin: schedule.origin.into(),508 _phantom: Default::default(),509 })510 })511 .collect::<Vec<_>>(),512 )513 });514 }515516 fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {459 fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {517 let now = frame_system::Pallet::<T>::block_number();460 let now = frame_system::Pallet::<T>::block_number();run.shdiffbeforeafterbothno changes
runtime/src/chain_extension.rsdiffbeforeafterbothno changes
subkeydiffbeforeafterbothno changes