Skip to content

Commit

Permalink
Merge branch '@anchpop/NNS1-2574' into 'master'
Browse files Browse the repository at this point in the history
fix(cli): NNS1-2574: Make the Principals field optional in the v2 sns_init.yaml file

The Principals field didn't really do anything, so there's no need for it to be required.

Closes NNS1-2574 

Closes NNS1-2574

See merge request dfinity-lab/public/ic!19431
  • Loading branch information
anchpop committed May 28, 2024
2 parents 07ca24a + 46f18fc commit f794768
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
2 changes: 1 addition & 1 deletion rs/sns/cli/src/init_config_file/friendly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub(crate) struct SnsConfigurationFile {
logo: PathBuf,
url: String,

#[serde(rename = "Principals")]
#[serde(rename = "Principals", default)]
principals: Vec<PrincipalAlias>,

fallback_controller_principals: Vec<String>, // Principal (alias)
Expand Down
23 changes: 1 addition & 22 deletions rs/sns/cli/src/init_config_file/friendly/friendly_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,7 @@ fn test_parse() {
logo: PathBuf::from("test.png"),
url: "https://some-link-to-a-project.org".to_string(),

principals: vec![
PrincipalAlias {
id: "5zxxw-63ouu-faaaa-aaaap-4ai".to_string(),
name: Some("Bruce Wayne".to_string()),
email: Some("[email protected]".to_string()),
},
PrincipalAlias {
id: PrincipalId::new_user_test_id(746890).to_string(),
name: Some("Alfred Pennyworth".to_string()),
email: None,
},
PrincipalAlias {
id: "c2n4r-wni5m-dqaaa-aaaap-4ai".to_string(),
name: Some("employees (canister)".to_string()),
email: None,
},
PrincipalAlias {
id: "ucm27-3lxwy-faaaa-aaaap-4ai".to_string(),
name: Some("departments (canister)".to_string()),
email: None,
},
],
principals: vec![],

fallback_controller_principals: vec!["5zxxw-63ouu-faaaa-aaaap-4ai".to_string()],
dapp_canisters: vec![
Expand Down
12 changes: 0 additions & 12 deletions rs/sns/cli/test_sns_init_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ NnsProposal:
url: "https://forum.dfinity.org/thread-where-this-sns-is-discussed"
summary: "This is just a short summary, but I think it's pretty good."


Principals:
- id: 5zxxw-63ouu-faaaa-aaaap-4ai
name: Bruce Wayne
email: [email protected]
- id: uqf5l-jukmu-fqaaa-aaaap-4ai
name: Alfred Pennyworth
- id: c2n4r-wni5m-dqaaa-aaaap-4ai
name: employees (canister)
- id: ucm27-3lxwy-faaaa-aaaap-4ai
name: departments (canister)

fallback_controller_principals:
- 5zxxw-63ouu-faaaa-aaaap-4ai # TODO: Bruce Wayne

Expand Down

0 comments on commit f794768

Please sign in to comment.