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

Error when Scaffolding types on old scaffolded blockchains #992

Closed
lumtis opened this issue Apr 14, 2021 · 0 comments · Fixed by #994
Closed

Error when Scaffolding types on old scaffolded blockchains #992

lumtis opened this issue Apr 14, 2021 · 0 comments · Fixed by #994
Assignees
Labels
type:bug Something isn't working

Comments

@lumtis
Copy link
Contributor

lumtis commented Apr 14, 2021

New scaffolded blockchains have an inconsistency, the type/genesis.go template used to have (v0.14.0):

// this line is used by starport scaffolding # genesis/types/import

And it has been changed to:

import (
// this line is used by starport scaffolding # genesis/types/import
)

Scaffolding type replace it with "fmt", the package needed and if the the first template is used then the code is:

"fmt"

which trigger an error. It can be easily fixed by adding:

import "fmt"

Though, this is annoying for the user.

A fix could be, when scaffolding a type, to verify if:

import (
// this line is used by starport scaffolding # genesis/types/import

exists in the file.

If not we replace:

// this line is used by starport scaffolding # genesis/types/import

With

import (
// this line is used by starport scaffolding # genesis/types/import
)
@lumtis lumtis changed the title Error when Scaffolding types on old scaffolded blockcahins Error when Scaffolding types on old scaffolded blockchains Apr 14, 2021
@lumtis lumtis added the type:bug Something isn't working label Apr 14, 2021
@lumtis lumtis self-assigned this Apr 14, 2021
@lumtis lumtis linked a pull request Apr 14, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant