Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Correct when the the current network global var is set (#167)
Browse files Browse the repository at this point in the history
The Action for the flag is only executed when the flag is set. 
In go-address package, `address.CurrentNetwork` is initialized to
`address.Testnet`. So we need to check `--lotus-test` and set it to
`address.Mainet` if the flag is not set.
  • Loading branch information
xinaxu committed Oct 19, 2023
2 parents ccfaeee + 5e9c3c1 commit 23dd6f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.github
*.md
integration/test
integration/test
docker-compose*.yml
13 changes: 6 additions & 7 deletions cmd/motion/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ func main() {
Name: "lotus-test",
Category: "Lotus",
EnvVars: []string{"LOTUS_TEST"},
Action: func(context *cli.Context, lotusTest bool) error {
if lotusTest {
logger.Info("Current network is set to Testnet")
address.CurrentNetwork = address.Testnet
}
return nil
},
},
&cli.UintFlag{
Name: "replicationFactor",
Expand Down Expand Up @@ -165,6 +158,12 @@ func main() {
},
},
Action: func(cctx *cli.Context) error {
if cctx.Bool("lotus-test") {
logger.Info("Current network is set to Testnet")
address.CurrentNetwork = address.Testnet
} else {
address.CurrentNetwork = address.Mainnet
}
storeDir := cctx.String("storeDir")
var store blob.Store
if cctx.Bool("experimentalSingularityStore") {
Expand Down

0 comments on commit 23dd6f7

Please sign in to comment.