Skip to content

Commit

Permalink
Merge pull request #94 from yrashk/accounts-deprecation
Browse files Browse the repository at this point in the history
Problem: authorities.accounts config setting is obsolete
  • Loading branch information
yrashk authored Jun 4, 2018
2 parents 13ececf + b68f235 commit bbda17d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ required_confirmations = 0
password = "foreign_password.txt"

[authorities]
accounts = [
"0x006e27b6a72e1f34c626762f3c4761547aff1421",
"0x006e27b6a72e1f34c626762f3c4761547aff1421",
"0x006e27b6a72e1f34c626762f3c4761547aff1421"
]
required_signatures = 2

[transactions]
Expand Down
23 changes: 6 additions & 17 deletions bridge/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl Config {
home: Node::from_load_struct(config.home)?,
foreign: Node::from_load_struct(config.foreign)?,
authorities: Authorities {
#[cfg(feature = "deploy")]
accounts: config.authorities.accounts,
required_signatures: config.authorities.required_signatures,
},
Expand Down Expand Up @@ -207,6 +208,7 @@ pub struct ContractConfig {

#[derive(Debug, PartialEq, Clone)]
pub struct Authorities {
#[cfg(feature = "deploy")]
pub accounts: Vec<Address>,
pub required_signatures: u32,
}
Expand Down Expand Up @@ -306,8 +308,9 @@ mod load {
}

#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Authorities {
#[cfg(feature = "deploy")]
#[serde(default)]
pub accounts: Vec<Address>,
pub required_signatures: u32,
}
Expand Down Expand Up @@ -352,11 +355,6 @@ password = "password"
bin = "../compiled_contracts/ForeignBridge.bin"
[authorities]
accounts = [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002",
"0x0000000000000000000000000000000000000003"
]
required_signatures = 2
[transactions]
Expand Down Expand Up @@ -405,10 +403,8 @@ home_deploy = { gas = 20 }
concurrent_http_requests: DEFAULT_CONCURRENCY,
},
authorities: Authorities {
#[cfg(feature = "deploy")]
accounts: vec![
"0000000000000000000000000000000000000001".into(),
"0000000000000000000000000000000000000002".into(),
"0000000000000000000000000000000000000003".into(),
],
required_signatures: 2,
},
Expand Down Expand Up @@ -451,11 +447,6 @@ password = "password"
bin = "../compiled_contracts/ForeignBridge.bin"
[authorities]
accounts = [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002",
"0x0000000000000000000000000000000000000003"
]
required_signatures = 2
"#;
let expected = Config {
Expand Down Expand Up @@ -499,10 +490,8 @@ required_signatures = 2
concurrent_http_requests: DEFAULT_CONCURRENCY,
},
authorities: Authorities {
#[cfg(feature = "deploy")]
accounts: vec![
"0000000000000000000000000000000000000001".into(),
"0000000000000000000000000000000000000002".into(),
"0000000000000000000000000000000000000003".into(),
],
required_signatures: 2,
},
Expand Down
3 changes: 0 additions & 3 deletions examples/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ rpc_port = 443
default_gas_price = 5_000_000_000 # 5 GWEI

[authorities]
accounts = [
"0x006e27b6a72e1f34c626762f3c4761547aff1421",
]
required_signatures = 1

[transactions]
Expand Down

0 comments on commit bbda17d

Please sign in to comment.