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

BASE_FEE from config file with default ergo_lib::wallet::tx_builder::SUGGESTED_TX_FEE() #104

Merged
merged 4 commits into from Aug 30, 2022

Conversation

hanbu97
Copy link
Contributor

@hanbu97 hanbu97 commented Aug 23, 2022

No description provided.

@coveralls
Copy link

coveralls commented Aug 29, 2022

Pull Request Test Coverage Report for Build 2956049993

  • 41 of 46 (89.13%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 66.252%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/src/oracle_config.rs 2 3 66.67%
core/src/cli_commands/bootstrap.rs 3 5 60.0%
core/src/cli_commands/prepare_update.rs 3 5 60.0%
Totals Coverage Status
Change from base Build 2897700479: 0.2%
Covered Lines: 1969
Relevant Lines: 2972

💛 - Coveralls

Copy link
Member

@greenhat greenhat left a comment

Choose a reason for hiding this comment

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

Looking great! Please check my comments for name and default value.

@@ -125,6 +127,10 @@ lazy_static! {
pub static ref ORACLE_CONFIG: OracleConfig = OracleConfig::load().unwrap();
pub static ref MAYBE_ORACLE_CONFIG: Result<OracleConfig, String> =
OracleConfig::load().map_err(|e| e.to_string());
pub static ref SAFE_USER_MIN: BoxValue = MAYBE_ORACLE_CONFIG
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to name it BASE_FEE (close to OracleConfig::base_fee). SAFE_USER_MIN name comes from a box value minimal value limit (to prevent dust) and has nothing to do with tx fee.
The use of BoxValue::SAFE_USER_MIN for tx fee throughout the code was incorrect in the first place and should be avoided. There is ergo_lib::wallet::tx_builder::SUGGESTED_TX_FEE() intended for this case. Please, use it if config is unavailable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Changes have been made.

@hanbu97 hanbu97 changed the title SAFE_USER_MIN as a parameter instead of hardcoded BASE_FEE from config file with default ergo_lib::wallet::tx_builder::SUGGESTED_TX_FEE() Aug 29, 2022
Copy link
Member

@greenhat greenhat left a comment

Choose a reason for hiding this comment

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

Great! Thank you!

@greenhat
Copy link
Member

Please, make Clippy happy. :)

@hanbu97
Copy link
Contributor Author

hanbu97 commented Aug 30, 2022

Clippy is happy now. 😀

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.

None yet

4 participants