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

Support for importing prefunded accounts #105

Merged
merged 9 commits into from
Aug 17, 2020
Merged

Support for importing prefunded accounts #105

merged 9 commits into from
Aug 17, 2020

Conversation

juliankoh
Copy link
Contributor

@juliankoh juliankoh commented Aug 12, 2020

Motivation

Supports importing accounts into the database by adding them as PrefundedAccount in the config file.

Solution

Open questions

@coveralls
Copy link

coveralls commented Aug 12, 2020

Pull Request Test Coverage Report for Build 3870

  • 21 of 32 (65.63%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 71.574%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/storage/key_storage.go 15 19 78.95%
configuration/configuration.go 6 13 46.15%
Totals Coverage Status
Change from base Build 3799: -0.1%
Covered Lines: 1755
Relevant Lines: 2452

💛 - Coveralls

Copy link
Contributor

@patrick-ogrady patrick-ogrady left a comment

Choose a reason for hiding this comment

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

🚀

@@ -136,6 +136,13 @@ func InitializeConstruction(
fetcher.WithTimeout(time.Duration(config.HTTPTimeout)*time.Second),
)

// Import prefunded account and save to database
// TODO: load balances of these imported addresses
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: load balances and coins of imported addresses

// Skip if key already exists
err = k.Store(ctx, acc.Address, keyPair)
if err != nil {
alreadyExists := strings.Contains(err.Error(), "already exists")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let's use errors.Is here

@juliankoh juliankoh merged commit 455f4f4 into master Aug 17, 2020
@juliankoh juliankoh deleted the julian/prefund branch August 17, 2020 17:23
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.

3 participants