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

goerli -> sepolia #696

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
22 changes: 11 additions & 11 deletions routes/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ func (fes *APIServer) ExecuteETHRPCRequest(method string, params []interface{},
if useNetwork == nil {
networkString = "mainnet"
if fes.Params.NetworkType == lib.NetworkType_TESTNET {
networkString = "goerli"
networkString = "sepolia"
}
} else {
if *useNetwork != "mainnet" && *useNetwork != "goerli" {
return nil, fmt.Errorf("ExecuteETHRPCRequest: Invalid network type. Must be mainnet or goerli")
if *useNetwork != "mainnet" && *useNetwork != "sepolia" {
return nil, fmt.Errorf("ExecuteETHRPCRequest: Invalid network type. Must be mainnet or sepolia")
}
networkString = *useNetwork
}
Expand Down Expand Up @@ -627,9 +627,9 @@ func publicKeyToEthAddress(address []byte) (str string, err error) {
type ETHNetwork string

const (
UNDEFINED ETHNetwork = ""
ETH_MAINNET ETHNetwork = "mainnet"
ETH_GOERLI ETHNetwork = "goerli"
UNDEFINED ETHNetwork = ""
EthMainnet ETHNetwork = "mainnet"
EthSepolia ETHNetwork = "sepolia"
)

type EtherscanTransaction struct {
Expand Down Expand Up @@ -667,15 +667,15 @@ func (fes *APIServer) GetETHTransactionsForETHAddress(ww http.ResponseWriter, re
ethAddress := vars["ethAddress"]

ethNetworkString := req.URL.Query().Get("eth_network")
if ethNetworkString != "" && ethNetworkString != string(ETH_MAINNET) && ethNetworkString != string(ETH_GOERLI) {
_AddBadRequestError(ww, fmt.Sprintf("GetETHTransactionsForETHAddress: Invalid network type. Must be mainnet or goerli"))
if ethNetworkString != "" && ethNetworkString != string(EthMainnet) && ethNetworkString != string(EthSepolia) {
_AddBadRequestError(ww, fmt.Sprintf("GetETHTransactionsForETHAddress: Invalid network type. Must be %v or %v", EthMainnet, EthSepolia))
return
}
ethNetwork := ETHNetwork(ethNetworkString)
if ethNetwork == UNDEFINED {
ethNetwork = ETH_MAINNET
ethNetwork = EthMainnet
if fes.Params.NetworkType == lib.NetworkType_TESTNET {
ethNetwork = ETH_GOERLI
ethNetwork = EthSepolia
}
}
ethTransactions, err := fes.GetETHTransactionsForETHAddressHandler(ethAddress, ethNetwork)
Expand All @@ -698,7 +698,7 @@ func (fes *APIServer) GetETHTransactionsForETHAddressHandler(
return nil, fmt.Errorf("GetETHTransactionsForETHAddress: Etherscan API key not set")
}
var apiSuffix string
if ethereumNetwork != ETH_MAINNET {
if ethereumNetwork != EthMainnet {
apiSuffix = "-" + string(ethereumNetwork)
}
url := fmt.Sprintf(
Expand Down
Loading