diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ab8d3bd2..e672a0c9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,7 @@ jobs: rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 cargo build --release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f92c876f5..6c8c093e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,12 +22,14 @@ jobs: with: profile: minimal toolchain: nightly + override: true - name: Initialize WASM build environment run: | rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 - name: Run cargo check @@ -52,12 +54,14 @@ jobs: with: profile: minimal toolchain: nightly + override: true - name: Initialize WASM build environment run: | rustup update stable rustup toolchain install nightly-2021-08-31 rustup default nightly-2021-08-31 + rustup override set nightly-2021-08-31 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31 # Runs integration tests in the runtime/tests folder diff --git a/pallets/mining/rewards-allowance/src/lib.rs b/pallets/mining/rewards-allowance/src/lib.rs index 8e1efabf9..5afab7699 100644 --- a/pallets/mining/rewards-allowance/src/lib.rs +++ b/pallets/mining/rewards-allowance/src/lib.rs @@ -244,51 +244,51 @@ pub mod pallet { impl Pallet { // customised by governance at any time. this function allows us to change it each year // https://docs.google.com/spreadsheets/d/1W2AzOH9Cs9oCR8UYfYCbpmd9X7hp-USbYXL7AuwMY_Q/edit#gid=970997021 - #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] - pub fn set_bonded_dhx_of_account_for_date(origin: OriginFor, account_id: T::AccountId) -> DispatchResult { - let _who = ensure_signed(origin)?; - - // Note: we DO need the following as we're using the current timestamp, rather than a function parameter. - let timestamp: ::Moment = >::get(); - let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?; - log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone()); - - // convert the requested date/time to the start of that day date/time to signify that date for lookup - // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000 - let requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone())?; - - // TODO - fetch from democracy or elections - let bonded_dhx_current_u128 = 1000u128; - - let bonded_dhx_current; - let _bonded_dhx_current = Self::convert_u128_to_balance(bonded_dhx_current_u128.clone()); - match _bonded_dhx_current { - Err(_e) => { - log::error!("Unable to convert u128 to balance for bonded_dhx_current"); - return Err(DispatchError::Other("Unable to convert u128 to balance for bonded_dhx_current")); - }, - Ok(ref x) => { - bonded_dhx_current = x; - } - } - - let bonded_data: BondedData = BondedDHXForAccountData { - account_id: account_id.clone(), - bonded_dhx_current: bonded_dhx_current.clone(), - requestor_account_id: _who.clone(), - }; - - // Update storage. Override the default that may have been set in on_initialize - >::insert(requested_date_millis.clone(), &bonded_data); - log::info!("account_id: {:?}", &account_id); - log::info!("bonded_data: {:?}", &bonded_data); - - // Emit an event. - // TODO - - // Return a successful DispatchResultWithPostInfo - Ok(()) - } + // #[pallet::weight(10_000 + T::DbWeight::get().writes(1))] + // pub fn set_bonded_dhx_of_account_for_date(origin: OriginFor, account_id: T::AccountId) -> DispatchResult { + // let _who = ensure_signed(origin)?; + + // // Note: we DO need the following as we're using the current timestamp, rather than a function parameter. + // let timestamp: ::Moment = >::get(); + // let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?; + // log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone()); + + // // convert the requested date/time to the start of that day date/time to signify that date for lookup + // // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000 + // let requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone())?; + + // // TODO - fetch from democracy or elections + // let bonded_dhx_current_u128 = 1000u128; + + // let bonded_dhx_current; + // let _bonded_dhx_current = Self::convert_u128_to_balance(bonded_dhx_current_u128.clone()); + // match _bonded_dhx_current { + // Err(_e) => { + // log::error!("Unable to convert u128 to balance for bonded_dhx_current"); + // return Err(DispatchError::Other("Unable to convert u128 to balance for bonded_dhx_current")); + // }, + // Ok(ref x) => { + // bonded_dhx_current = x; + // } + // } + + // let bonded_data: BondedData = BondedDHXForAccountData { + // account_id: account_id.clone(), + // bonded_dhx_current: bonded_dhx_current.clone(), + // requestor_account_id: _who.clone(), + // }; + + // // Update storage. Override the default that may have been set in on_initialize + // >::insert(requested_date_millis.clone(), &bonded_data); + // log::info!("account_id: {:?}", &account_id); + // log::info!("bonded_data: {:?}", &bonded_data); + + // // Emit an event. + // // TODO + + // // Return a successful DispatchResultWithPostInfo + // Ok(()) + // } // customised by governance at any time #[pallet::weight(10_000 + T::DbWeight::get().writes(1))]