Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(c-bridge): properly read testnet environment config from envars #2589

Merged

Conversation

guidiaz
Copy link
Contributor

@guidiaz guidiaz commented Feb 6, 2025

No description provided.

@guidiaz guidiaz force-pushed the c-bridge/set-testnet-environment-from-envars branch from 12120d4 to b2dc053 Compare February 6, 2025 15:30
@@ -1,6 +1,7 @@
//! Witnet <> Ethereum bridge

use actix::{Actor, System, SystemRegistry};
use witnet_data_structures::chain::Environment;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use witnet_data_structures::chain::Environment;

@guidiaz guidiaz force-pushed the c-bridge/set-testnet-environment-from-envars branch from b2dc053 to 4b5bbbb Compare February 6, 2025 16:03
Comment on lines 132 to 138
if let Ok(config) = res {
witnet_data_structures::set_environment(if config.witnet_testnet {
Environment::Testnet
} else {
Environment::Mainnet
});
Ok(config)
} else {
res
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let Ok(config) = res {
witnet_data_structures::set_environment(if config.witnet_testnet {
Environment::Testnet
} else {
Environment::Mainnet
});
Ok(config)
} else {
res
}
if let Ok(ref config) = res {
witnet_data_structures::set_environment(if config.witnet_testnet {
Environment::Testnet
} else {
Environment::Mainnet
});
res
}

@guidiaz guidiaz force-pushed the c-bridge/set-testnet-environment-from-envars branch from 4b5bbbb to 4130fb9 Compare February 6, 2025 16:14
@guidiaz guidiaz force-pushed the c-bridge/set-testnet-environment-from-envars branch from 4130fb9 to 9ac779f Compare February 6, 2025 16:38
@guidiaz guidiaz merged commit 9ac779f into witnet:master Feb 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants