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

go/oasis-node/cmd/common: ExportEntity should use the entity ctor #3117

Merged
merged 1 commit into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changelog/3117.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
go/oasis-node/cmd/common: ExportEntity should use the entity ctor

Instead of using an entity populated with the zero values and a manually
filled in public key, use the entity constructor that can fill in
sensible values for things like the version.
6 changes: 3 additions & 3 deletions go/oasis-node/cmd/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func ExportEntity(signerBackend, entityDir string) error {
if err != nil {
return err
}
var entity entity.Entity
entity.ID = signer.Public()
return entity.Save(entityDir)

_, err = entity.GenerateWithSigner(entityDir, signer, nil)
return err
}