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

mycelo genesis gingerbread activation fix #2169

Merged
merged 7 commits into from
Aug 22, 2023
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
15 changes: 8 additions & 7 deletions cmd/mycelo/genesis_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"path"

"github.com/celo-org/celo-blockchain/common"
"github.com/celo-org/celo-blockchain/internal/fileutils"
"github.com/celo-org/celo-blockchain/log"
"github.com/celo-org/celo-blockchain/mycelo/env"
Expand Down Expand Up @@ -44,23 +45,23 @@ var templateFlags = []cli.Flag{
},
cli.Int64Flag{
Name: "forks.churrito",
Usage: "Optional flag to allow churrito fork overwritting (default: 0, disable: -1)",
Usage: "Optional flag to allow churrito fork overwriting (default: 0, disable: -1)",
},
cli.Int64Flag{
Name: "forks.donut",
Usage: "Optional flag to allow donut fork overwritting (default: 0, disable: -1)",
Usage: "Optional flag to allow donut fork overwriting (default: 0, disable: -1)",
},
cli.Int64Flag{
Name: "forks.espresso",
Usage: "Optional flag to allow espresso fork overwritting (default: 0, disable: -1)",
Usage: "Optional flag to allow espresso fork overwriting (default: 0, disable: -1)",
},
cli.Int64Flag{
Name: "forks.gingerbread",
Usage: "Optional flag to allow gingerbread fork overwritting (default: 0, disable: -1)",
Usage: "Optional flag to allow gingerbread fork overwriting (default: 0, disable: -1)",
},
cli.Int64Flag{
Name: "forks.gingerbreadp2",
Usage: "Optional flag to allow gingerbread p2 fork overwritting (default: 0, disable: -1)",
Usage: "Optional flag to allow gingerbread p2 fork overwriting (default: 0, disable: -1)",
},
}

Expand Down Expand Up @@ -139,6 +140,8 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes
} else {
gingerbreadBlock = big.NewInt(gingerbreadBlockNumber)
}
} else {
gingerbreadBlock = common.Big1
palango marked this conversation as resolved.
Show resolved Hide resolved
}

// Genesis config
Expand Down Expand Up @@ -185,8 +188,6 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes
}
}

genesisConfig.Hardforks.GingerbreadBlock = gingerbreadBlock
gastonponti marked this conversation as resolved.
Show resolved Hide resolved

if ctx.IsSet("forks.gingerbreadp2") {
gingerbreadP2BlockNumber := ctx.Int64("forks.gingerbreadp2")
if gingerbreadP2BlockNumber < 0 {
Expand Down
1 change: 0 additions & 1 deletion cmd/mycelo/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func (e localEnv) createEnv(workdir string) (*env.Environment, error) {
}

func (e localEnv) createGenesisConfig(env *env.Environment, gingerbreadBlock *big.Int) (*genesis.Config, error) {

genesisConfig, err := genesis.CreateCommonGenesisConfig(env.Config.ChainID, env.Accounts().AdminAccount().Address, params.IstanbulConfig{
Epoch: 10,
ProposerPolicy: 2,
Expand Down
2 changes: 1 addition & 1 deletion monorepo_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
549ff08afc86f2123abd8bb19000e248e5a86477
f08e269d88c6680641427952ce4743a7d26336a6
6 changes: 3 additions & 3 deletions mycelo/internal/utils/jsonfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package utils

import (
"encoding/json"
"io/ioutil"
"os"
)

func ReadJson(out interface{}, filepath string) error {
byteValue, err := ioutil.ReadFile(filepath)
byteValue, err := os.ReadFile(filepath)
if err != nil {
return err
}
Expand All @@ -20,5 +20,5 @@ func WriteJson(in interface{}, filepath string) error {
return err
}

return ioutil.WriteFile(filepath, byteValue, 0644)
return os.WriteFile(filepath, byteValue, 0644)
}
Loading