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

Remove hardcoded value (SlowMist N9) #146

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

clostao
Copy link
Contributor

@clostao clostao commented Nov 8, 2023

Description

Slowmist problem description:

In the provided code, hardcoding an Ethereum address (an H160 value) directly within the default method is not
considered a good practice. This approach lack of flexibility and reduced maintainability.

fn default() -> Self {

    Self {
       initial_default_conversion_rate_controller: <H160 as
       core::str::FromStr>::from_str(
         "0x444212d6E4827893A70d19921E383130281Cda4a",
      )
      .expect("invalid address"),
     }
}

Our response:

Suggested changes were applied

Types of changes

What types of changes does your code introduce?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@deblanco deblanco force-pushed the chore-extract-hardcoded branch from b308913 to dc97104 Compare November 15, 2023 21:38
@deblanco deblanco merged commit 301733b into main Nov 16, 2023
@deblanco deblanco deleted the chore-extract-hardcoded branch November 16, 2023 07:35
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.

3 participants