Oracle transition not properly completed
The oracle transition in Beta 7 wasn't properly completed. Users on non-eth
blockchains got set to the wrong oracle.
So we will put the transition code back in and expand it to include setting
the oracle depending on the system chain.
@@ -26,6 +26,7 @@ extern crate arrayvec;
use actix_web::http::Method;
use actix_web::{http, server, App};
+use althea_types::SystemChain;
use docopt::Docopt;
use env_logger;
use openssl_probe;
@@ -172,6 +173,32 @@ fn main() {
env_logger::init();
}
+ // remove in beta 9 where this info will be imported from the dao address oracle.
+ let mut payment_settings = SETTING.get_payment_mut();
+ let system_chain = payment_settings.system_chain;
+ payment_settings.withdraw_chain = system_chain;
+ drop(payment_settings);
+
+ // remove in beta 9 as this will already be set propertly
+ let mut dao_settings = SETTING.get_dao_mut();
+ if let Some(address) = dao_settings.dao_addresses.iter().last() {
+ dao_settings.oracle_url = Some(format!("https://updates.althea.net/{}", address));
+ } else {
+ match system_chain {
+ SystemChain::Ethereum => {
+ dao_settings.oracle_url = Some("https://updates.altheamesh.com/prices".to_string())
+ }
+ SystemChain::Xdai => {
+ dao_settings.oracle_url =
+ Some("https://updates.altheamesh.com/xdaiprices".to_string())
+ }
+ SystemChain::Rinkeby => {
+ dao_settings.oracle_url = Some("https://updates.altheamesh.com/prices".to_string())
+ }
+ }
+ }
+ drop(dao_settings);
+
if cfg!(feature = "development") {
println!("Warning!");
println!("This build is meant only for development purposes.");
