Skip to content

Commit

Permalink
Merge pull request #220 from harmony-one/add_dryrun_default
Browse files Browse the repository at this point in the history
[chainid] Add auto detect for dry run endpoint
  • Loading branch information
Daniel-VDM authored May 15, 2020
2 parents f874291 + 75d421a commit 0b5664b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/subcommands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func endpointToChainID(nodeAddr string) chainIDWrapper {
return chainIDWrapper{chainID: &common.Chain.PartnerNet}
} else if strings.Contains(nodeAddr, ".stn.") {
return chainIDWrapper{chainID: &common.Chain.StressNet}
} else if strings.Contains(nodeAddr, ".dry.") {
return chainIDWrapper{chainID: &common.Chain.MainNet}
}
return chainIDWrapper{chainID: &common.Chain.TestNet}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/common/chain-id.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func StringToChainID(name string) (*ChainID, error) {
return &Chain.PartnerNet, nil
case "stressnet":
return &Chain.StressNet, nil
case "dryrun":
return &Chain.MainNet, nil
default:
return nil, fmt.Errorf("unknown chain-id: %s", name)
}
Expand Down

0 comments on commit 0b5664b

Please sign in to comment.