Skip to content

Commit 4195838

Browse files
committed
try fix github actions Check error
1 parent f77b639 commit 4195838

File tree

3 files changed

+50
-45
lines changed

3 files changed

+50
-45
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
rustup update stable
2828
rustup toolchain install nightly-2021-08-31
2929
rustup default nightly-2021-08-31
30+
rustup override set nightly-2021-08-31
3031
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
3132
cargo build --release
3233

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ jobs:
2222
with:
2323
profile: minimal
2424
toolchain: nightly
25+
override: true
2526

2627
- name: Initialize WASM build environment
2728
run: |
2829
rustup update stable
2930
rustup toolchain install nightly-2021-08-31
3031
rustup default nightly-2021-08-31
32+
rustup override set nightly-2021-08-31
3133
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
3234
3335
- name: Run cargo check
@@ -52,12 +54,14 @@ jobs:
5254
with:
5355
profile: minimal
5456
toolchain: nightly
57+
override: true
5558

5659
- name: Initialize WASM build environment
5760
run: |
5861
rustup update stable
5962
rustup toolchain install nightly-2021-08-31
6063
rustup default nightly-2021-08-31
64+
rustup override set nightly-2021-08-31
6165
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
6266
6367
# Runs integration tests in the runtime/tests folder

pallets/mining/rewards-allowance/src/lib.rs

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -244,51 +244,51 @@ pub mod pallet {
244244
impl<T: Config> Pallet<T> {
245245
// customised by governance at any time. this function allows us to change it each year
246246
// https://docs.google.com/spreadsheets/d/1W2AzOH9Cs9oCR8UYfYCbpmd9X7hp-USbYXL7AuwMY_Q/edit#gid=970997021
247-
#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
248-
pub fn set_bonded_dhx_of_account_for_date(origin: OriginFor<T>, account_id: T::AccountId) -> DispatchResult {
249-
let _who = ensure_signed(origin)?;
250-
251-
// Note: we DO need the following as we're using the current timestamp, rather than a function parameter.
252-
let timestamp: <T as pallet_timestamp::Config>::Moment = <pallet_timestamp::Pallet<T>>::get();
253-
let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?;
254-
log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone());
255-
256-
// convert the requested date/time to the start of that day date/time to signify that date for lookup
257-
// i.e. 21 Apr @ 1420 -> 21 Apr @ 0000
258-
let requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone())?;
259-
260-
// TODO - fetch from democracy or elections
261-
let bonded_dhx_current_u128 = 1000u128;
262-
263-
let bonded_dhx_current;
264-
let _bonded_dhx_current = Self::convert_u128_to_balance(bonded_dhx_current_u128.clone());
265-
match _bonded_dhx_current {
266-
Err(_e) => {
267-
log::error!("Unable to convert u128 to balance for bonded_dhx_current");
268-
return Err(DispatchError::Other("Unable to convert u128 to balance for bonded_dhx_current"));
269-
},
270-
Ok(ref x) => {
271-
bonded_dhx_current = x;
272-
}
273-
}
274-
275-
let bonded_data: BondedData<T> = BondedDHXForAccountData {
276-
account_id: account_id.clone(),
277-
bonded_dhx_current: bonded_dhx_current.clone(),
278-
requestor_account_id: _who.clone(),
279-
};
280-
281-
// Update storage. Override the default that may have been set in on_initialize
282-
<RewardsAllowanceDHXForDate<T>>::insert(requested_date_millis.clone(), &bonded_data);
283-
log::info!("account_id: {:?}", &account_id);
284-
log::info!("bonded_data: {:?}", &bonded_data);
285-
286-
// Emit an event.
287-
// TODO
288-
289-
// Return a successful DispatchResultWithPostInfo
290-
Ok(())
291-
}
247+
// #[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
248+
// pub fn set_bonded_dhx_of_account_for_date(origin: OriginFor<T>, account_id: T::AccountId) -> DispatchResult {
249+
// let _who = ensure_signed(origin)?;
250+
251+
// // Note: we DO need the following as we're using the current timestamp, rather than a function parameter.
252+
// let timestamp: <T as pallet_timestamp::Config>::Moment = <pallet_timestamp::Pallet<T>>::get();
253+
// let requested_date_as_u64 = Self::convert_moment_to_u64_in_milliseconds(timestamp.clone())?;
254+
// log::info!("requested_date_as_u64: {:?}", requested_date_as_u64.clone());
255+
256+
// // convert the requested date/time to the start of that day date/time to signify that date for lookup
257+
// // i.e. 21 Apr @ 1420 -> 21 Apr @ 0000
258+
// let requested_date_millis = Self::convert_u64_in_milliseconds_to_start_of_date(requested_date_as_u64.clone())?;
259+
260+
// // TODO - fetch from democracy or elections
261+
// let bonded_dhx_current_u128 = 1000u128;
262+
263+
// let bonded_dhx_current;
264+
// let _bonded_dhx_current = Self::convert_u128_to_balance(bonded_dhx_current_u128.clone());
265+
// match _bonded_dhx_current {
266+
// Err(_e) => {
267+
// log::error!("Unable to convert u128 to balance for bonded_dhx_current");
268+
// return Err(DispatchError::Other("Unable to convert u128 to balance for bonded_dhx_current"));
269+
// },
270+
// Ok(ref x) => {
271+
// bonded_dhx_current = x;
272+
// }
273+
// }
274+
275+
// let bonded_data: BondedData<T> = BondedDHXForAccountData {
276+
// account_id: account_id.clone(),
277+
// bonded_dhx_current: bonded_dhx_current.clone(),
278+
// requestor_account_id: _who.clone(),
279+
// };
280+
281+
// // Update storage. Override the default that may have been set in on_initialize
282+
// <RewardsAllowanceDHXForDate<T>>::insert(requested_date_millis.clone(), &bonded_data);
283+
// log::info!("account_id: {:?}", &account_id);
284+
// log::info!("bonded_data: {:?}", &bonded_data);
285+
286+
// // Emit an event.
287+
// // TODO
288+
289+
// // Return a successful DispatchResultWithPostInfo
290+
// Ok(())
291+
// }
292292

293293
// customised by governance at any time
294294
#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]

0 commit comments

Comments
 (0)