chain letters are lowercase

The primary-network chains answer to either case; one spelling beats two.
/v1/chain/c/rpc, /v1/chain/p, /v1/chain/x across the estate.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-09-08 15:21:19 -07:00
co-authored by Hanzo Dev
parent 7e198c5359
commit 7a4566d4b3
19 changed files with 68 additions and 68 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ explorer
go build -o explorer ./cmd/explorer/ go build -o explorer ./cmd/explorer/
# Run — indexes chain, serves API + frontend on :8090 # Run — indexes chain, serves API + frontend on :8090
./explorer --rpc=http://localhost:9650/v1/chain/C/rpc ./explorer --rpc=http://localhost:9650/v1/chain/c/rpc
# That's it. Open http://localhost:8090 # That's it. Open http://localhost:8090
``` ```
@@ -34,7 +34,7 @@ go build -o explorer ./cmd/explorer/
```bash ```bash
docker build -f Dockerfile.explorer -t explorer . docker build -f Dockerfile.explorer -t explorer .
docker run -p 8090:8090 -v explorer-data:/data \ docker run -p 8090:8090 -v explorer-data:/data \
-e RPC_ENDPOINT=http://node:9650/v1/chain/C/rpc \ -e RPC_ENDPOINT=http://node:9650/v1/chain/c/rpc \
explorer explorer
``` ```
@@ -194,7 +194,7 @@ explorer --chain-name="My Chain" --coin=MYC --chain-id=12345
```bash ```bash
# Required # Required
RPC_ENDPOINT=http://localhost:9650/v1/chain/C/rpc RPC_ENDPOINT=http://localhost:9650/v1/chain/c/rpc
# Optional # Optional
DATA_DIR=~/.explorer/data DATA_DIR=~/.explorer/data
+1 -1
View File
@@ -145,7 +145,7 @@ func TestConfigValidation(t *testing.T) {
cfg := Config{ cfg := Config{
ChainType: ChainP, ChainType: ChainP,
ChainName: "P-Chain", ChainName: "P-Chain",
RPCEndpoint: "http://localhost:9630/v1/chain/P", RPCEndpoint: "http://localhost:9630/v1/chain/p",
RPCMethod: "pvm", RPCMethod: "pvm",
DataDir: "/tmp/test-indexer/pchain", DataDir: "/tmp/test-indexer/pchain",
HTTPPort: 4100, HTTPPort: 4100,
+3 -3
View File
@@ -19,7 +19,7 @@ chains:
name: C-Chain name: C-Chain
chain_id: 96369 chain_id: 96369
type: evm type: evm
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/C/rpc rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/c/rpc
coin: LUX coin: LUX
enabled: true enabled: true
default: true default: true
@@ -31,7 +31,7 @@ chains:
- slug: pchain - slug: pchain
name: P-Chain name: P-Chain
type: linear type: linear
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/P rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/p
coin: LUX coin: LUX
enabled: true enabled: true
@@ -39,7 +39,7 @@ chains:
- slug: xchain - slug: xchain
name: X-Chain name: X-Chain
type: dag type: dag
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/X rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/x
coin: LUX coin: LUX
enabled: true enabled: true
+2 -2
View File
@@ -5,7 +5,7 @@
// frontend. // frontend.
// //
// indexerd --config=chains.yaml // indexerd --config=chains.yaml
// indexerd --rpc=http://localhost:9650/v1/chain/C/rpc (single chain mode) // indexerd --rpc=http://localhost:9650/v1/chain/c/rpc (single chain mode)
package main package main
import ( import (
@@ -134,7 +134,7 @@ func resolveConfig(configFile, rpcFlag, chainName, coinSymbol string, chainID in
} }
fmt.Println("Usage:") fmt.Println("Usage:")
fmt.Println(" indexerd --rpc=http://localhost:9650/v1/chain/C/rpc (single chain)") fmt.Println(" indexerd --rpc=http://localhost:9650/v1/chain/c/rpc (single chain)")
fmt.Println(" indexerd --config=chains.yaml (multi-chain)") fmt.Println(" indexerd --config=chains.yaml (multi-chain)")
os.Exit(1) os.Exit(1)
return daemon.Config{} return daemon.Config{}
+2 -2
View File
@@ -46,7 +46,7 @@ services:
container_name: lux-pchain-indexer container_name: lux-pchain-indexer
command: ["-chain", "pchain", "-port", "4000"] command: ["-chain", "pchain", "-port", "4000"]
environment: environment:
RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/P RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/p
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_pchain?sslmode=disable DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_pchain?sslmode=disable
HTTP_PORT: 4000 HTTP_PORT: 4000
ports: ports:
@@ -63,7 +63,7 @@ services:
container_name: lux-xchain-indexer container_name: lux-xchain-indexer
command: ["-chain", "xchain", "-port", "4000"] command: ["-chain", "xchain", "-port", "4000"]
environment: environment:
RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/X RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/x
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_xchain?sslmode=disable DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_xchain?sslmode=disable
HTTP_PORT: 4000 HTTP_PORT: 4000
ports: ports:
+16 -16
View File
@@ -12,8 +12,8 @@ lux:
name: "Lux C-Chain" name: "Lux C-Chain"
symbol: "LUX" symbol: "LUX"
type: evm type: evm
rpc: "https://api.lux.network/v1/chain/C/rpc" rpc: "https://api.lux.network/v1/chain/c/rpc"
ws: "wss://api.lux.network/v1/chain/C/ws" ws: "wss://api.lux.network/v1/chain/c/ws"
explorer: "https://explore.lux.network" explorer: "https://explore.lux.network"
enabled: true enabled: true
protocols: protocols:
@@ -29,8 +29,8 @@ lux:
name: "Lux Testnet" name: "Lux Testnet"
symbol: "LUX" symbol: "LUX"
type: evm type: evm
rpc: "https://api.testnet.lux.network/v1/chain/C/rpc" rpc: "https://api.testnet.lux.network/v1/chain/c/rpc"
ws: "wss://api.testnet.lux.network/v1/chain/C/ws" ws: "wss://api.testnet.lux.network/v1/chain/c/ws"
explorer: "https://explore.testnet.lux.network" explorer: "https://explore.testnet.lux.network"
enabled: true enabled: true
@@ -40,8 +40,8 @@ lux:
name: "Zoo Mainnet" name: "Zoo Mainnet"
symbol: "ZOO" symbol: "ZOO"
type: evm type: evm
rpc: "https://api.zoo.network/v1/chain/C/rpc" rpc: "https://api.zoo.network/v1/chain/c/rpc"
ws: "wss://api.zoo.network/v1/chain/C/ws" ws: "wss://api.zoo.network/v1/chain/c/ws"
explorer: "https://explore.zoo.network" explorer: "https://explore.zoo.network"
enabled: true enabled: true
@@ -50,7 +50,7 @@ lux:
name: "Zoo Testnet" name: "Zoo Testnet"
symbol: "ZOO" symbol: "ZOO"
type: evm type: evm
rpc: "https://api.testnet.zoo.network/v1/chain/C/rpc" rpc: "https://api.testnet.zoo.network/v1/chain/c/rpc"
explorer: "https://explore.testnet.zoo.network" explorer: "https://explore.testnet.zoo.network"
enabled: true enabled: true
@@ -60,8 +60,8 @@ lux:
name: "Hanzo AI" name: "Hanzo AI"
symbol: "HANZO" symbol: "HANZO"
type: evm type: evm
rpc: "https://api.hanzo.ai/v1/chain/C/rpc" rpc: "https://api.hanzo.ai/v1/chain/c/rpc"
ws: "wss://api.hanzo.ai/v1/chain/C/ws" ws: "wss://api.hanzo.ai/v1/chain/c/ws"
explorer: "https://explore.hanzo.ai" explorer: "https://explore.hanzo.ai"
enabled: true enabled: true
@@ -70,7 +70,7 @@ lux:
name: "Hanzo AI Testnet" name: "Hanzo AI Testnet"
symbol: "HANZO" symbol: "HANZO"
type: evm type: evm
rpc: "https://api.testnet.hanzo.ai/v1/chain/C/rpc" rpc: "https://api.testnet.hanzo.ai/v1/chain/c/rpc"
explorer: "https://explore.testnet.hanzo.ai" explorer: "https://explore.testnet.hanzo.ai"
enabled: true enabled: true
@@ -80,8 +80,8 @@ lux:
name: "SPC Mainnet" name: "SPC Mainnet"
symbol: "SPC" symbol: "SPC"
type: evm type: evm
rpc: "https://api.sparklepony.club/v1/chain/C/rpc" rpc: "https://api.sparklepony.club/v1/chain/c/rpc"
ws: "wss://api.sparklepony.club/v1/chain/C/ws" ws: "wss://api.sparklepony.club/v1/chain/c/ws"
explorer: "https://explore.sparklepony.club" explorer: "https://explore.sparklepony.club"
enabled: true enabled: true
@@ -90,7 +90,7 @@ lux:
name: "SPC Testnet" name: "SPC Testnet"
symbol: "SPC" symbol: "SPC"
type: evm type: evm
rpc: "https://api.testnet.sparklepony.club/v1/chain/C/rpc" rpc: "https://api.testnet.sparklepony.club/v1/chain/c/rpc"
explorer: "https://explore.testnet.sparklepony.club" explorer: "https://explore.testnet.sparklepony.club"
enabled: true enabled: true
@@ -100,8 +100,8 @@ lux:
name: "PARS Mainnet" name: "PARS Mainnet"
symbol: "PARS" symbol: "PARS"
type: evm type: evm
rpc: "https://api.pars.network/v1/chain/C/rpc" rpc: "https://api.pars.network/v1/chain/c/rpc"
ws: "wss://api.pars.network/v1/chain/C/ws" ws: "wss://api.pars.network/v1/chain/c/ws"
explorer: "https://explore.pars.network" explorer: "https://explore.pars.network"
enabled: true enabled: true
@@ -110,7 +110,7 @@ lux:
name: "PARS Testnet" name: "PARS Testnet"
symbol: "PARS" symbol: "PARS"
type: evm type: evm
rpc: "https://api.testnet.pars.network/v1/chain/C/rpc" rpc: "https://api.testnet.pars.network/v1/chain/c/rpc"
explorer: "https://explore.testnet.pars.network" explorer: "https://explore.testnet.pars.network"
enabled: true enabled: true
+1 -1
View File
@@ -10,7 +10,7 @@ chains:
name: "Lux C-Chain" name: "Lux C-Chain"
chain_id: 96369 chain_id: 96369
port: 4000 port: 4000
rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/chain/C/rpc}" rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/chain/c/rpc}"
enabled: true enabled: true
- slug: zoo - slug: zoo
+1 -1
View File
@@ -134,7 +134,7 @@ func TestConfigDefaults(t *testing.T) {
cfg := Config{ cfg := Config{
ChainType: ChainX, ChainType: ChainX,
ChainName: "X-Chain", ChainName: "X-Chain",
RPCEndpoint: "http://localhost:9630/v1/chain/X", RPCEndpoint: "http://localhost:9630/v1/chain/x",
DataDir: "/tmp/test-indexer/xchain", DataDir: "/tmp/test-indexer/xchain",
HTTPPort: 4200, HTTPPort: 4200,
} }
+3 -3
View File
@@ -126,7 +126,7 @@ data:
name: Lux C-Chain name: Lux C-Chain
chain_id: 96369 chain_id: 96369
type: evm type: evm
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/C/rpc rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/c/rpc
coin: LUX coin: LUX
enabled: true enabled: true
default: true default: true
@@ -162,12 +162,12 @@ data:
- slug: xchain - slug: xchain
name: X-Chain name: X-Chain
type: dag type: dag
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/X rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/x
coin: LUX coin: LUX
enabled: true enabled: true
- slug: pchain - slug: pchain
name: P-Chain name: P-Chain
type: linear type: linear
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/P rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/p
coin: LUX coin: LUX
enabled: true enabled: true
+1 -1
View File
@@ -32,7 +32,7 @@ type TestConfig struct {
func DefaultConfig() *TestConfig { func DefaultConfig() *TestConfig {
rpcURL := os.Getenv("LUX_RPC_URL") rpcURL := os.Getenv("LUX_RPC_URL")
if rpcURL == "" { if rpcURL == "" {
rpcURL = "http://127.0.0.1:9650/v1/chain/C/rpc" rpcURL = "http://127.0.0.1:9650/v1/chain/c/rpc"
} }
return &TestConfig{ return &TestConfig{
+7 -7
View File
@@ -216,16 +216,16 @@ func GetRPCEndpoint(chain string) string {
// Check for external node via LUX_RPC_URL // Check for external node via LUX_RPC_URL
if baseURL := os.Getenv("LUX_RPC_URL"); baseURL != "" { if baseURL := os.Getenv("LUX_RPC_URL"); baseURL != "" {
// Extract host:port from base URL // Extract host:port from base URL
// e.g., http://127.0.0.1:9650/v1/chain/C/rpc -> http://127.0.0.1:9650 // e.g., http://127.0.0.1:9650/v1/chain/c/rpc -> http://127.0.0.1:9650
parts := strings.Split(baseURL, "/v1/") parts := strings.Split(baseURL, "/v1/")
host := parts[0] host := parts[0]
switch strings.ToUpper(chain) { switch strings.ToUpper(chain) {
case "C": case "C":
return host + "/v1/chain/C/rpc" return host + "/v1/chain/c/rpc"
case "P": case "P":
return host + "/v1/chain/P" return host + "/v1/chain/p"
case "X": case "X":
return host + "/v1/chain/X" return host + "/v1/chain/x"
default: default:
return host + "/v1/chain/" + chain + "/rpc" return host + "/v1/chain/" + chain + "/rpc"
} }
@@ -238,11 +238,11 @@ func GetRPCEndpoint(chain string) string {
switch strings.ToUpper(chain) { switch strings.ToUpper(chain) {
case "C": case "C":
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/C/rpc", port) return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/c/rpc", port)
case "P": case "P":
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/P", port) return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/p", port)
case "X": case "X":
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/X", port) return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/x", port)
default: default:
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/%s/rpc", port, chain) return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/%s/rpc", port, chain)
} }
+1 -1
View File
@@ -18,7 +18,7 @@ import (
// TestNew tests the adapter constructor // TestNew tests the adapter constructor
func TestNew(t *testing.T) { func TestNew(t *testing.T) {
endpoint := "http://localhost:9650/v1/chain/C/rpc" endpoint := "http://localhost:9650/v1/chain/c/rpc"
adapter := New(endpoint) adapter := New(endpoint)
if adapter == nil { if adapter == nil {
+4 -4
View File
@@ -19,8 +19,8 @@ var DefaultChains = []ChainConfig{
ChainID: ChainIDLuxMainnet, ChainID: ChainIDLuxMainnet,
Name: "Lux C-Chain", Name: "Lux C-Chain",
Symbol: "LUX", Symbol: "LUX",
RPCEndpoint: "https://api.lux.network/v1/chain/C/rpc", RPCEndpoint: "https://api.lux.network/v1/chain/c/rpc",
WSEndpoint: "wss://api.lux.network/v1/chain/C/ws", WSEndpoint: "wss://api.lux.network/v1/chain/c/ws",
ExplorerURL: "https://explorer.lux.network", ExplorerURL: "https://explorer.lux.network",
IsTestnet: false, IsTestnet: false,
BlockTime: 2000, BlockTime: 2000,
@@ -33,8 +33,8 @@ var DefaultChains = []ChainConfig{
ChainID: ChainIDLuxTestnet, ChainID: ChainIDLuxTestnet,
Name: "Lux C-Chain Testnet", Name: "Lux C-Chain Testnet",
Symbol: "LUX", Symbol: "LUX",
RPCEndpoint: "https://api.testnet.lux.network/v1/chain/C/rpc", RPCEndpoint: "https://api.testnet.lux.network/v1/chain/c/rpc",
WSEndpoint: "wss://api.testnet.lux.network/v1/chain/C/ws", WSEndpoint: "wss://api.testnet.lux.network/v1/chain/c/ws",
ExplorerURL: "https://explorer.testnet.lux.network", ExplorerURL: "https://explorer.testnet.lux.network",
IsTestnet: true, IsTestnet: true,
BlockTime: 2000, BlockTime: 2000,
+1 -1
View File
@@ -49,7 +49,7 @@ func isLuxdEndpoint(endpoint string) bool {
// luxdZAPAddr derives the ZAP TCP address from a luxd HTTP endpoint. // luxdZAPAddr derives the ZAP TCP address from a luxd HTTP endpoint.
// luxd listens for ZAP on HTTP port + 10 by convention. // luxd listens for ZAP on HTTP port + 10 by convention.
// e.g. http://luxd-0.luxd:9630/v1/chain/C/rpc -> luxd-0.luxd:9640 // e.g. http://luxd-0.luxd:9630/v1/chain/c/rpc -> luxd-0.luxd:9640
func luxdZAPAddr(endpoint string) string { func luxdZAPAddr(endpoint string) string {
// Strip scheme // Strip scheme
addr := endpoint addr := endpoint
+15 -15
View File
@@ -189,9 +189,9 @@ func TestIsLuxdEndpoint(t *testing.T) {
endpoint string endpoint string
want bool want bool
}{ }{
{"http://luxd-0.luxd:9630/v1/chain/C/rpc", true}, {"http://luxd-0.luxd:9630/v1/chain/c/rpc", true},
{"http://localhost:9650/v1/chain/C/rpc", true}, {"http://localhost:9650/v1/chain/c/rpc", true},
{"https://api.lux.network/mainnet/v1/chain/C/rpc", true}, {"https://api.lux.network/mainnet/v1/chain/c/rpc", true},
{"http://localhost:8545", false}, {"http://localhost:8545", false},
{"https://mainnet.infura.io/v3/key", false}, {"https://mainnet.infura.io/v3/key", false},
} }
@@ -211,10 +211,10 @@ func TestLuxdZAPAddr(t *testing.T) {
endpoint string endpoint string
want string want string
}{ }{
{"http://luxd-0.luxd:9630/v1/chain/C/rpc", "luxd-0.luxd:9640"}, {"http://luxd-0.luxd:9630/v1/chain/c/rpc", "luxd-0.luxd:9640"},
{"http://localhost:9650/v1/chain/C/rpc", "localhost:9660"}, {"http://localhost:9650/v1/chain/c/rpc", "localhost:9660"},
{"https://api.lux.network/mainnet/v1/chain/C/rpc", "api.lux.network:9640"}, {"https://api.lux.network/mainnet/v1/chain/c/rpc", "api.lux.network:9640"},
{"http://10.0.0.1:19630/v1/chain/C/rpc", "10.0.0.1:19640"}, {"http://10.0.0.1:19630/v1/chain/c/rpc", "10.0.0.1:19640"},
} }
for _, tt := range tests { for _, tt := range tests {
@@ -235,7 +235,7 @@ func TestNewFallsBackToHTTP(t *testing.T) {
} }
// luxd endpoint with unreachable ZAP port should fall back to HTTP // luxd endpoint with unreachable ZAP port should fall back to HTTP
tr = New("http://localhost:1/v1/chain/C/rpc") tr = New("http://localhost:1/v1/chain/c/rpc")
if _, ok := tr.(*HTTP); !ok { if _, ok := tr.(*HTTP); !ok {
t.Errorf("expected *HTTP fallback for unreachable ZAP, got %T", tr) t.Errorf("expected *HTTP fallback for unreachable ZAP, got %T", tr)
} }
@@ -378,7 +378,7 @@ func TestZAPCall(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
@@ -407,7 +407,7 @@ func TestZAPCallWithParams(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
@@ -444,7 +444,7 @@ func TestZAPBatchCall(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
@@ -472,7 +472,7 @@ func TestZAPCallRPCError(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
@@ -490,7 +490,7 @@ func TestZAPClose(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
@@ -507,7 +507,7 @@ func TestZAPClose(t *testing.T) {
} }
func TestZAPConnectFail(t *testing.T) { func TestZAPConnectFail(t *testing.T) {
_, err := NewZAP("127.0.0.1:1", "http://localhost/v1/chain/C/rpc") _, err := NewZAP("127.0.0.1:1", "http://localhost/v1/chain/c/rpc")
if err == nil { if err == nil {
t.Fatal("expected error connecting to closed port") t.Fatal("expected error connecting to closed port")
} }
@@ -521,7 +521,7 @@ func TestZAPCallContextTimeout(t *testing.T) {
}) })
defer cleanup() defer cleanup()
z, err := NewZAP(addr, "http://localhost/v1/chain/C/rpc") z, err := NewZAP(addr, "http://localhost/v1/chain/c/rpc")
if err != nil { if err != nil {
t.Fatalf("NewZAP: %v", err) t.Fatalf("NewZAP: %v", err)
} }
+2 -2
View File
@@ -284,8 +284,8 @@ func TestChainConfigSerialization(t *testing.T) {
ChainID: 96369, ChainID: 96369,
Name: "Lux C-Chain", Name: "Lux C-Chain",
Symbol: "LUX", Symbol: "LUX",
RPCEndpoint: "https://api.lux.network/v1/chain/C/rpc", RPCEndpoint: "https://api.lux.network/v1/chain/c/rpc",
WSEndpoint: "wss://api.lux.network/v1/chain/C/ws", WSEndpoint: "wss://api.lux.network/v1/chain/c/ws",
ExplorerURL: "https://explorer.lux.network", ExplorerURL: "https://explorer.lux.network",
IsTestnet: false, IsTestnet: false,
BlockTime: 2000, BlockTime: 2000,
+1 -1
View File
@@ -20,7 +20,7 @@ import (
) )
const ( const (
DefaultRPCEndpoint = "http://localhost:9650/v1/chain/P" DefaultRPCEndpoint = "http://localhost:9650/v1/chain/p"
DefaultHTTPPort = 4100 DefaultHTTPPort = 4100
) )
+3 -3
View File
@@ -23,8 +23,8 @@ func TestNew(t *testing.T) {
}{ }{
{ {
name: "custom endpoint", name: "custom endpoint",
endpoint: "http://localhost:9650/v1/chain/P", endpoint: "http://localhost:9650/v1/chain/p",
expected: "http://localhost:9650/v1/chain/P", expected: "http://localhost:9650/v1/chain/p",
}, },
{ {
name: "empty endpoint uses default", name: "empty endpoint uses default",
@@ -52,7 +52,7 @@ func TestNew(t *testing.T) {
// TestConstants tests package constants // TestConstants tests package constants
func TestConstants(t *testing.T) { func TestConstants(t *testing.T) {
if DefaultRPCEndpoint != "http://localhost:9650/v1/chain/P" { if DefaultRPCEndpoint != "http://localhost:9650/v1/chain/p" {
t.Errorf("unexpected DefaultRPCEndpoint: %s", DefaultRPCEndpoint) t.Errorf("unexpected DefaultRPCEndpoint: %s", DefaultRPCEndpoint)
} }
if DefaultHTTPPort != 4100 { if DefaultHTTPPort != 4100 {
+1 -1
View File
@@ -16,7 +16,7 @@ import (
// TestNew tests adapter creation // TestNew tests adapter creation
func TestNew(t *testing.T) { func TestNew(t *testing.T) {
endpoint := "http://localhost:9650/v1/chain/X" endpoint := "http://localhost:9650/v1/chain/x"
adapter := New(endpoint) adapter := New(endpoint)
if adapter == nil { if adapter == nil {