-
Notifications
You must be signed in to change notification settings - Fork 71
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
Adjust automation time slot #431
Conversation
pub const MaxWeightPerSlot: u128 = 700_000_000; | ||
pub const XmpFee: u128 = 1_000_000; | ||
pub const GetNativeCurrencyId: CurrencyId = NATIVE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two parameter_types! blocks before impl pallet_automation_time::Config for Test {
, so I merged them.
#[derive(Debug)] | ||
pub const MaxExecutionTimes: u32 = 3; | ||
pub const MaxScheduleSeconds: u64 = 86_400; // 24 hours in seconds | ||
pub const SlotSizeSeconds: u64 = 600; // 10 minutes in seconds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added const value for SlotSizeSeconds here for test config.
@@ -41,7 +41,9 @@ use xcm::latest::{prelude::*, Junction::Parachain, MultiLocation}; | |||
use pallet_valve::Shutdown; | |||
|
|||
pub const START_BLOCK_TIME: u64 = 33198768000 * 1_000; | |||
pub const SCHEDULED_TIME: u64 = START_BLOCK_TIME / 1_000 + 7200; | |||
const MAX_SCHEDULE_SECONDS: u64 = <Test as Config>::MaxScheduleSeconds::get(); | |||
pub const SLOT_SIZE_SECONDS: u64 = <Test as Config>::SlotSizeSeconds::get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read Test Config and assign the config values to const variables to share among functions in this file.
@@ -1009,11 +1011,11 @@ fn schedule_auto_compound_with_bad_frequency_or_execution_time() { | |||
// when schedule auto compound task, if the schedule time falls too far in the | |||
// future, return TimeTooFarOut error | |||
#[test] | |||
fn schedule_auto_compound_with_high_frequency() { | |||
fn schedule_auto_compound_with_time_too_far_out() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function name was different from its description and implementation.
@@ -349,7 +349,7 @@ mod tests { | |||
use super::*; | |||
use crate::{ | |||
mock::*, | |||
tests::{SCHEDULED_TIME, START_BLOCK_TIME}, | |||
tests::{SCHEDULED_TIME, SLOT_SIZE_SECONDS, START_BLOCK_TIME}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import the const variable read from Test Config, from tests.rs to types.rs.
I have run the below three commands in order, @imstar15 could you help take another look to see if the config values are correct for both Test and Runtime environments? |
Screenshot
Test