fix : TestConfigLegacy

This commit is contained in:
Shivam Sharma 2022-08-26 14:08:15 +05:30
parent eb16a3d313
commit 1ac5f09518
2 changed files with 17 additions and 15 deletions

View file

@ -14,10 +14,10 @@ import (
func TestConfigLegacy(t *testing.T) { func TestConfigLegacy(t *testing.T) {
readFile := func(path string) { readFile := func(path string) {
config, err := readLegacyConfig(path) expectedConfig, err := readLegacyConfig(path)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, config, &Config{ testConfig := &Config{
Chain: "mainnet", Chain: "mainnet",
Identity: Hostname(), Identity: Hostname(),
RequiredBlocks: map[string]string{ RequiredBlocks: map[string]string{
@ -52,7 +52,7 @@ func TestConfigLegacy(t *testing.T) {
TxPool: &TxPoolConfig{ TxPool: &TxPoolConfig{
Locals: []string{}, Locals: []string{},
NoLocals: false, NoLocals: false,
Journal: "", Journal: "transactions.rlp",
Rejournal: 1 * time.Hour, Rejournal: 1 * time.Hour,
PriceLimit: 1, PriceLimit: 1,
PriceBump: 10, PriceBump: 10,
@ -65,8 +65,8 @@ func TestConfigLegacy(t *testing.T) {
Sealer: &SealerConfig{ Sealer: &SealerConfig{
Enabled: false, Enabled: false,
Etherbase: "", Etherbase: "",
GasCeil: 20000000, GasCeil: 30000000,
GasPrice: big.NewInt(30000000000), GasPrice: big.NewInt(1 * params.GWei),
ExtraData: "", ExtraData: "",
}, },
Gpo: &GpoConfig{ Gpo: &GpoConfig{
@ -86,22 +86,22 @@ func TestConfigLegacy(t *testing.T) {
Prefix: "", Prefix: "",
Host: "localhost", Host: "localhost",
API: []string{"eth", "net", "web3", "txpool", "bor"}, API: []string{"eth", "net", "web3", "txpool", "bor"},
Cors: []string{"*"}, Cors: []string{"localhost"},
VHost: []string{"*"}, VHost: []string{"localhost"},
}, },
Ws: &APIConfig{ Ws: &APIConfig{
Enabled: false, Enabled: false,
Port: 8546, Port: 8546,
Prefix: "", Prefix: "",
Host: "localhost", Host: "localhost",
API: []string{"web3", "net"}, API: []string{"net", "web3"},
Cors: []string{"*"}, Cors: []string{"localhost"},
VHost: []string{"*"}, VHost: []string{"localhost"},
}, },
Graphql: &APIConfig{ Graphql: &APIConfig{
Enabled: false, Enabled: false,
Cors: []string{"*"}, Cors: []string{"localhost"},
VHost: []string{"*"}, VHost: []string{"localhost"},
}, },
}, },
Ethstats: "", Ethstats: "",
@ -149,7 +149,9 @@ func TestConfigLegacy(t *testing.T) {
Enabled: false, Enabled: false,
Period: 0, Period: 0,
}, },
}) }
assert.Equal(t, expectedConfig, testConfig)
} }
// read file in hcl format // read file in hcl format

View file

@ -12,8 +12,8 @@ lifetime = "1s"
[miner] [miner]
mine = false mine = false
gaslimit = 20000000 gaslimit = 30000000
gasprice = "30000000000" gasprice = "1000000000"
[gpo] [gpo]
ignoreprice = "4" ignoreprice = "4"