|
| 1 | +use std::{collections::BTreeMap, str::FromStr, time::Duration}; |
| 2 | +use std::{env, thread::sleep}; |
| 3 | + |
| 4 | +use clarinet_deployments::types::BurnchainEpochConfig; |
1 | 5 | use clarinet_files::{compute_addresses, StacksNetwork}; |
2 | 6 | use futures::future::try_join3; |
3 | 7 | use hiro_system_kit::{slog, Logger}; |
@@ -25,8 +29,6 @@ use resources::{ |
25 | 29 | StacksDevnetResource, |
26 | 30 | }; |
27 | 31 | use serde::{de::DeserializeOwned, Deserialize, Serialize}; |
28 | | -use std::{collections::BTreeMap, str::FromStr, time::Duration}; |
29 | | -use std::{env, thread::sleep}; |
30 | 32 | use strum::IntoEnumIterator; |
31 | 33 | use tower::BoxError; |
32 | 34 |
|
@@ -103,6 +105,7 @@ struct StacksV2InfoResponse { |
103 | 105 | burn_block_height: u64, |
104 | 106 | stacks_tip_height: u64, |
105 | 107 | } |
| 108 | + |
106 | 109 | #[derive(Clone)] |
107 | 110 | pub struct StacksDevnetApiK8sManager { |
108 | 111 | client: Client, |
@@ -1358,53 +1361,20 @@ impl StacksDevnetApiK8sManager { |
1358 | 1361 | get_service_port(StacksDevnetService::BitcoindNode, ServicePort::P2P).unwrap() |
1359 | 1362 | )); |
1360 | 1363 |
|
1361 | | - stacks_conf.push_str(&format!( |
| 1364 | + stacks_conf.push_str( |
1362 | 1365 | r#" |
1363 | 1366 | [[burnchain.epochs]] |
1364 | 1367 | epoch_name = "1.0" |
1365 | 1368 | start_height = 0 |
1366 | | -
|
1367 | | - [[burnchain.epochs]] |
1368 | | - epoch_name = "2.0" |
1369 | | - start_height = {} |
1370 | | -
|
1371 | | - [[burnchain.epochs]] |
1372 | | - epoch_name = "2.05" |
1373 | | - start_height = {} |
1374 | | -
|
1375 | | - [[burnchain.epochs]] |
1376 | | - epoch_name = "2.1" |
1377 | | - start_height = {} |
1378 | | -
|
1379 | | - [[burnchain.epochs]] |
1380 | | - epoch_name = "2.2" |
1381 | | - start_height = {} |
1382 | | -
|
1383 | | - [[burnchain.epochs]] |
1384 | | - epoch_name = "2.3" |
1385 | | - start_height = {} |
1386 | | -
|
1387 | | - [[burnchain.epochs]] |
1388 | | - epoch_name = "2.4" |
1389 | | - start_height = {} |
1390 | | -
|
1391 | | - [[burnchain.epochs]] |
1392 | | - epoch_name = "2.5" |
1393 | | - start_height = {} |
1394 | | -
|
1395 | | - [[burnchain.epochs]] |
1396 | | - epoch_name = "3.0" |
1397 | | - start_height = {} |
1398 | 1369 | "#, |
1399 | | - devnet_config.epoch_2_0, |
1400 | | - devnet_config.epoch_2_05, |
1401 | | - devnet_config.epoch_2_1, |
1402 | | - devnet_config.epoch_2_2, |
1403 | | - devnet_config.epoch_2_3, |
1404 | | - devnet_config.epoch_2_4, |
1405 | | - devnet_config.epoch_2_5, |
1406 | | - devnet_config.epoch_3_0, |
1407 | | - )); |
| 1370 | + ); |
| 1371 | + let epoch_conf = BurnchainEpochConfig::from(devnet_config); |
| 1372 | + let epoch_conf_str = toml::to_string(&epoch_conf).map_err(|e| DevNetError { |
| 1373 | + message: format!("failed to serialize epoch config: {e}"), |
| 1374 | + code: 500, |
| 1375 | + })?; |
| 1376 | + stacks_conf.push_str(&epoch_conf_str); |
| 1377 | + |
1408 | 1378 | stacks_conf |
1409 | 1379 | }; |
1410 | 1380 |
|
|
0 commit comments