mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 15:03:45 +00:00
fixed the bug caused by fillBigInt and FillTime.Duration functions (#474)
This commit is contained in:
parent
6e8428bfaa
commit
b64af9b843
2 changed files with 120 additions and 12 deletions
|
|
@ -15,7 +15,7 @@ func readLegacyConfig(path string) (*Config, error) {
|
||||||
return nil, fmt.Errorf("failed to read toml config file: %v", err)
|
return nil, fmt.Errorf("failed to read toml config file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var conf Config
|
conf := *DefaultConfig()
|
||||||
|
|
||||||
if _, err := toml.Decode(tomlData, &conf); err != nil {
|
if _, err := toml.Decode(tomlData, &conf); err != nil {
|
||||||
return nil, fmt.Errorf("failed to decode toml config file: %v", err)
|
return nil, fmt.Errorf("failed to decode toml config file: %v", err)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfigLegacy(t *testing.T) {
|
func TestConfigLegacy(t *testing.T) {
|
||||||
|
|
@ -15,30 +17,136 @@ func TestConfigLegacy(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, config, &Config{
|
assert.Equal(t, config, &Config{
|
||||||
DataDir: "./data",
|
Chain: "mainnet",
|
||||||
|
Identity: Hostname(),
|
||||||
RequiredBlocks: map[string]string{
|
RequiredBlocks: map[string]string{
|
||||||
"a": "b",
|
"a": "b",
|
||||||
},
|
},
|
||||||
|
LogLevel: "INFO",
|
||||||
|
DataDir: "./data",
|
||||||
P2P: &P2PConfig{
|
P2P: &P2PConfig{
|
||||||
MaxPeers: 30,
|
MaxPeers: 30,
|
||||||
|
MaxPendPeers: 50,
|
||||||
|
Bind: "0.0.0.0",
|
||||||
|
Port: 30303,
|
||||||
|
NoDiscover: false,
|
||||||
|
NAT: "any",
|
||||||
|
Discovery: &P2PDiscovery{
|
||||||
|
V5Enabled: false,
|
||||||
|
Bootnodes: []string{},
|
||||||
|
BootnodesV4: []string{},
|
||||||
|
BootnodesV5: []string{},
|
||||||
|
StaticNodes: []string{},
|
||||||
|
TrustedNodes: []string{},
|
||||||
|
DNS: []string{},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
Heimdall: &HeimdallConfig{
|
||||||
|
URL: "http://localhost:1317",
|
||||||
|
Without: false,
|
||||||
|
},
|
||||||
|
SyncMode: "full",
|
||||||
|
GcMode: "full",
|
||||||
|
Snapshot: true,
|
||||||
TxPool: &TxPoolConfig{
|
TxPool: &TxPoolConfig{
|
||||||
Locals: []string{},
|
Locals: []string{},
|
||||||
Rejournal: 1 * time.Hour,
|
NoLocals: false,
|
||||||
LifeTime: 1 * time.Second,
|
Journal: "",
|
||||||
|
Rejournal: 1 * time.Hour,
|
||||||
|
PriceLimit: 30000000000,
|
||||||
|
PriceBump: 10,
|
||||||
|
AccountSlots: 16,
|
||||||
|
GlobalSlots: 32768,
|
||||||
|
AccountQueue: 16,
|
||||||
|
GlobalQueue: 32768,
|
||||||
|
LifeTime: 1 * time.Second,
|
||||||
|
},
|
||||||
|
Sealer: &SealerConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Etherbase: "",
|
||||||
|
GasCeil: 20000000,
|
||||||
|
GasPrice: big.NewInt(30000000000),
|
||||||
|
ExtraData: "",
|
||||||
},
|
},
|
||||||
Gpo: &GpoConfig{
|
Gpo: &GpoConfig{
|
||||||
|
Blocks: 20,
|
||||||
|
Percentile: 60,
|
||||||
MaxPrice: big.NewInt(100),
|
MaxPrice: big.NewInt(100),
|
||||||
IgnorePrice: big.NewInt(2),
|
IgnorePrice: big.NewInt(2),
|
||||||
},
|
},
|
||||||
Sealer: &SealerConfig{
|
JsonRPC: &JsonRPCConfig{
|
||||||
Enabled: false,
|
IPCDisable: false,
|
||||||
GasCeil: 20000000,
|
IPCPath: "",
|
||||||
GasPrice: big.NewInt(30000000000),
|
GasCap: ethconfig.Defaults.RPCGasCap,
|
||||||
|
TxFeeCap: ethconfig.Defaults.RPCTxFeeCap,
|
||||||
|
Http: &APIConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Port: 8545,
|
||||||
|
Prefix: "",
|
||||||
|
Host: "localhost",
|
||||||
|
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
||||||
|
Cors: []string{"*"},
|
||||||
|
VHost: []string{"*"},
|
||||||
|
},
|
||||||
|
Ws: &APIConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Port: 8546,
|
||||||
|
Prefix: "",
|
||||||
|
Host: "localhost",
|
||||||
|
API: []string{"web3", "net"},
|
||||||
|
Cors: []string{"*"},
|
||||||
|
VHost: []string{"*"},
|
||||||
|
},
|
||||||
|
Graphql: &APIConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Cors: []string{"*"},
|
||||||
|
VHost: []string{"*"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Ethstats: "",
|
||||||
|
Telemetry: &TelemetryConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Expensive: false,
|
||||||
|
PrometheusAddr: "",
|
||||||
|
OpenCollectorEndpoint: "",
|
||||||
|
InfluxDB: &InfluxDBConfig{
|
||||||
|
V1Enabled: false,
|
||||||
|
Endpoint: "",
|
||||||
|
Database: "",
|
||||||
|
Username: "",
|
||||||
|
Password: "",
|
||||||
|
Tags: map[string]string{},
|
||||||
|
V2Enabled: false,
|
||||||
|
Token: "",
|
||||||
|
Bucket: "",
|
||||||
|
Organization: "",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Cache: &CacheConfig{
|
Cache: &CacheConfig{
|
||||||
Cache: 1024,
|
Cache: 1024,
|
||||||
Rejournal: 1 * time.Hour,
|
PercDatabase: 50,
|
||||||
|
PercTrie: 15,
|
||||||
|
PercGc: 25,
|
||||||
|
PercSnapshot: 10,
|
||||||
|
Journal: "triecache",
|
||||||
|
Rejournal: 1 * time.Hour,
|
||||||
|
NoPrefetch: false,
|
||||||
|
Preimages: false,
|
||||||
|
TxLookupLimit: 2350000,
|
||||||
|
},
|
||||||
|
Accounts: &AccountsConfig{
|
||||||
|
Unlock: []string{},
|
||||||
|
PasswordFile: "",
|
||||||
|
AllowInsecureUnlock: false,
|
||||||
|
UseLightweightKDF: false,
|
||||||
|
DisableBorWallet: false,
|
||||||
|
},
|
||||||
|
GRPC: &GRPCConfig{
|
||||||
|
Addr: ":3131",
|
||||||
|
},
|
||||||
|
Developer: &DeveloperConfig{
|
||||||
|
Enabled: false,
|
||||||
|
Period: 0,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue