-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conduit: filereader / filewriter plugins and compatibility changes. #1253
Conversation
Codecov Report
@@ Coverage Diff @@
## conduit #1253 +/- ##
===========================================
+ Coverage 58.39% 58.72% +0.32%
===========================================
Files 77 78 +1
Lines 10332 10463 +131
===========================================
+ Hits 6033 6144 +111
- Misses 3772 3786 +14
- Partials 527 533 +6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
err := os.MkdirAll(dataDir, 0755) | ||
if err != nil { | ||
return nil, fmt.Errorf("MakeProcessor() failed to create '%s': %w", dataDir, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically create the local ledger directory if it's missing. While I was testing different configurations, this kept coming up.
@@ -185,8 +197,10 @@ func (exp *fileExporter) Round() uint64 { | |||
return exp.round | |||
} | |||
|
|||
func (exp *fileExporter) unmarhshalConfig(cfg string) error { | |||
return yaml.Unmarshal([]byte(cfg), &exp.cfg) | |||
func unmarshalConfig(cfg string) (Config, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contender for generics right here, we have the same function (with the same typo) in lots of places. I turned it into a pure function in a few places.
genesisFilename := path.Join(exp.cfg.BlocksDir, "genesis.json") | ||
if err := util.EncodeToFile(genesisFilename, genesis, true); err != nil { | ||
return fmt.Errorf("HandleGenesis() failed to serialize genesis file: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File reader needs the genesis file.
This reverts commit 10fa5ac.
LGTM |
Summary
StateDelta
object contains a map with non-string keys which caused a problem with the json encoder.Test Plan
New unit tests.