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

Make exempt accounts file configuration relative to main config file #221

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

septerr
Copy link
Contributor

@septerr septerr commented Mar 14, 2021

Fixes # #215

Motivation

The documentation for exempt_accounts configuration, states that it should specify a path to a file relative to the configuration file. But, the code was actually looking for files relative to the rosetta-cli binary.

Solution

Updated behavior to match the documentation i.e. the exempt accounts file is looked up relative to the main configuration file.

Open questions

@@ -334,6 +334,10 @@ func modifyFilePaths(config *Configuration, fileDir string) {
if len(config.Data.InterestingAccounts) > 0 {
config.Data.InterestingAccounts = path.Join(fileDir, config.Data.InterestingAccounts)
}

if len(config.Data.ExemptAccounts) > 0 {
config.Data.ExemptAccounts = path.Join(fileDir, config.Data.ExemptAccounts)
Copy link

Choose a reason for hiding this comment

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

nice catch!

Comment on lines 354 to 355
// The path can be absolute or relative to the directory containing the rosetta-cli
// binary.
Copy link

@yfl92 yfl92 Mar 16, 2021

Choose a reason for hiding this comment

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

Feels like this comment could be a bit misleading. The DataDirectory is either absolute or relative to where the binary is being executed instead of the path to the binary

@septerr septerr requested a review from yfl92 March 17, 2021 00:16
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6916

  • 1 of 3 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 38.786%

Changes Missing Coverage Covered Lines Changed/Added Lines %
configuration/configuration.go 1 3 33.33%
Totals Coverage Status
Change from base Build 6853: -0.01%
Covered Lines: 588
Relevant Lines: 1516

💛 - Coveralls

Copy link

@yfl92 yfl92 left a comment

Choose a reason for hiding this comment

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

LGTM - we will need to mention this in the release changelog given it's a change of behavior

Copy link
Contributor

@raghavsharma873 raghavsharma873 left a comment

Choose a reason for hiding this comment

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

lgtm!

@septerr septerr merged commit 3f95879 into master Mar 17, 2021
@septerr septerr deleted the sgupta/make-exempt-accounts-relative branch March 17, 2021 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants