Skip to content

Commit

Permalink
fix setting staking period
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Mar 20, 2023
1 parent ab6315f commit cba2425
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion avalancheup-aws/src/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ cat /tmp/{node_id}.crt
--ssm-doc {ssm_doc_name} \\
--chain-rpc-url {chain_rpc_url} \\
--key {priv_key_hex} \\
--primary-network-validate-period-in-days 15 \\
--primary-network-validate-period-in-days 16 \\
--subnet-validate-period-in-days 14 \\
--subnet-config-local-path /tmp/subnet-config.json \\
--subnet-config-remote-dir {subnet_config_remote_dir} \\
Expand Down
2 changes: 1 addition & 1 deletion avalancheup-aws/src/default_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub fn command() -> Command {
.required(false)
.num_args(1)
.value_parser(value_parser!(u64))
.default_value("15"),
.default_value("16"),
)
.arg(
Arg::new("AVALANCHEGO_LOG_LEVEL")
Expand Down
8 changes: 4 additions & 4 deletions avalancheup-aws/src/install_subnet_chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ pub fn command() -> Command {
.required(false)
.num_args(1)
.value_parser(value_parser!(u64))
.default_value("15"),
.default_value("16"),
)
.arg(
Arg::new("SUBNET_VALIDATE_PERIOD_IN_DAYS") // TODO: use float
.long("subnet-validate-period-in-days")
.help("Sets the number of days to validate/stake the subnet (default 14 since primary network default validate period is 15-day in avalanche-types)")
.help("Sets the number of days to validate/stake the subnet (default 14 since primary network default validate period is 16-day in avalanche-types)")
.required(false)
.num_args(1)
.value_parser(value_parser!(u64))
Expand Down Expand Up @@ -552,7 +552,7 @@ pub async fn execute(opts: Flags) -> io::Result<()> {
.add_validator()
.node_id(node::Id::from_str(node_id).unwrap())
.stake_amount(stake_amount_in_navax)
.validate_period_in_days(60, opts.primary_network_validate_period_in_days)
.validate_period_in_days(opts.primary_network_validate_period_in_days, 60)
.check_acceptance(true)
.issue()
.await
Expand Down Expand Up @@ -684,7 +684,7 @@ pub async fn execute(opts: Flags) -> io::Result<()> {
.add_subnet_validator()
.node_id(node::Id::from_str(node_id).unwrap())
.subnet_id(created_subnet_id)
.validate_period_in_days(60, opts.subnet_validate_period_in_days - 1)
.validate_period_in_days(opts.subnet_validate_period_in_days, 60)
.check_acceptance(true)
.issue()
.await
Expand Down
4 changes: 2 additions & 2 deletions avalancheup-aws/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn main() -> io::Result<()> {
.clone(),
primary_network_validate_period_in_days: sub_matches
.get_one::<u64>("PRIMARY_NETWORK_VALIDATE_PERIOD_IN_DAYS")
.unwrap_or(&15)
.unwrap_or(&16)
.clone(),

aad_tag: sub_matches
Expand Down Expand Up @@ -264,7 +264,7 @@ async fn main() -> io::Result<()> {

primary_network_validate_period_in_days: sub_matches
.get_one::<u64>("PRIMARY_NETWORK_VALIDATE_PERIOD_IN_DAYS")
.unwrap_or(&15)
.unwrap_or(&16)
.clone(),
subnet_validate_period_in_days: sub_matches
.get_one::<u64>("SUBNET_VALIDATE_PERIOD_IN_DAYS")
Expand Down

0 comments on commit cba2425

Please sign in to comment.