Skip to content
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
4 changes: 0 additions & 4 deletions internal/accounts/create-interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ func (l *lilicoAccount) create(network string) (flowsdk.Identifier, error) {
apiNetwork = "/testnet"
}

if network == config.PreviewnetNetwork.Name {
apiNetwork = "/previewnet"
}

request, err := http.NewRequest(
http.MethodPost,
fmt.Sprintf("https://openapi.lilico.org/v1/address%s", apiNetwork),
Expand Down
7 changes: 0 additions & 7 deletions internal/config/add-contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ func addContract(
)
}

if raw.Previewnet != "" {
contract.Aliases.Add(
config.PreviewnetNetwork.Name,
flow.HexToAddress(raw.Mainnet),
)
}

state.Contracts().AddOrUpdate(contract)

err = state.SaveEdited(globalFlags.ConfigPaths)
Expand Down
10 changes: 3 additions & 7 deletions internal/evm/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type gatewayFlag struct {
RPCPort int `flag:"rpc-port" default:"3000" info:"port for the RPC API server"`
AccessNodeHost string `flag:"access-node-host" default:"localhost:3569" info:"host to the flow access node gRPC API"`
InitCadenceHeight uint64 `flag:"init-cadence-height" default:"0" info:"init cadence block height from where the event ingestion will start. WARNING: you should only provide this if there are no existing values in the database, otherwise an error will be thrown"`
EVMNetworkID string `flag:"evm-network-id" default:"testnet" info:"EVM network ID (testnet, mainnet, previewnet)"`
FlowNetworkID string `flag:"flow-network-id" default:"emulator" info:"EVM network ID (emulator, previewnet, testnet, mainnet)"`
EVMNetworkID string `flag:"evm-network-id" default:"testnet" info:"EVM network ID (testnet, mainnet)"`
FlowNetworkID string `flag:"flow-network-id" default:"emulator" info:"EVM network ID (emulator, testnet, mainnet)"`
Coinbase string `flag:"coinbase" default:"" info:"coinbase address to use for fee collection"`
GasPrice string `flag:"gas-price" default:"1" info:"static gas price used for EVM transactions"`
COAAddress string `flag:"coa-address" default:"" info:"Flow address that holds COA account used for submitting transactions"`
Expand Down Expand Up @@ -114,21 +114,17 @@ var gatewayCommand = &command.Command{
cfg.FlowNetworkID = flowGo.Mainnet
case "testnet":
cfg.FlowNetworkID = flowGo.Testnet
case "previewnet":
cfg.FlowNetworkID = flowGo.Previewnet
case "emulator":
cfg.FlowNetworkID = flowGo.Emulator
default:
return nil, fmt.Errorf("flow network ID not supported, only possible to specify emulator, testnet, previewnet, mainnet")
return nil, fmt.Errorf("flow network ID not supported, only possible to specify emulator, testnet, mainnet")
}

switch flagGateway.EVMNetworkID {
case "testnet":
cfg.EVMNetworkID = types.FlowEVMTestNetChainID
case "mainnet":
cfg.EVMNetworkID = types.FlowEVMMainNetChainID
case "previewnet":
cfg.EVMNetworkID = types.FlowEVMPreviewNetChainID
default:
return nil, fmt.Errorf("EVM network ID not supported")
}
Expand Down
18 changes: 8 additions & 10 deletions internal/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,11 @@ func NewAccountPrompt() *AccountData {
}

type ContractData struct {
Name string
Source string
Emulator string
Testnet string
Mainnet string
Previewnet string
Name string
Source string
Emulator string
Testnet string
Mainnet string
}

func NewContractPrompt() *ContractData {
Expand Down Expand Up @@ -652,10 +651,9 @@ func ReportCrash() bool {

func CreateAccountNetworkPrompt() (string, config.Network) {
networkMap := map[string]config.Network{
"Emulator": config.EmulatorNetwork,
"Testnet": config.TestnetNetwork,
"Mainnet": config.MainnetNetwork,
"Previewnet": config.PreviewnetNetwork,
"Emulator": config.EmulatorNetwork,
"Testnet": config.TestnetNetwork,
"Mainnet": config.MainnetNetwork,
}

networkPrompt := promptui.Select{
Expand Down
1 change: 0 additions & 1 deletion internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func GetAddressNetwork(address flowsdk.Address) (flowsdk.ChainID, error) {
flowsdk.Mainnet,
flowsdk.Testnet,
flowsdk.Emulator,
flowsdk.Previewnet,
}
for _, net := range networks {
if address.IsValid(net) {
Expand Down