Skip to content

Commit a601f17

Browse files
kielbarryfirmianavan
authored andcommitted
params: fix golint warnings (ethereum#16853)
params: fix golint warnings
1 parent 213946d commit a601f17

22 files changed

+72
-61
lines changed

cmd/faucet/faucet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func (f *faucet) apiHandler(conn *websocket.Conn) {
474474
amount = new(big.Int).Div(amount, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(msg.Tier)), nil))
475475

476476
tx := types.NewTransaction(f.nonce+uint64(len(f.reqs)), address, amount, 21000, f.price, nil)
477-
signed, err := f.keystore.SignTx(f.account, tx, f.config.ChainId)
477+
signed, err := f.keystore.SignTx(f.account, tx, f.config.ChainID)
478478
if err != nil {
479479
f.lock.Unlock()
480480
if err = sendError(conn, err); err != nil {

cmd/puppeth/genesis.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ func newCppEthereumGenesisSpec(network string, genesis *core.Genesis) (*cppEther
103103
spec.Params.ByzantiumForkBlock = (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64())
104104
spec.Params.ConstantinopleForkBlock = (hexutil.Uint64)(math.MaxUint64)
105105

106-
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
107-
spec.Params.ChainID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
106+
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
107+
spec.Params.ChainID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
108108

109109
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
110110
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
@@ -284,7 +284,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
284284
spec.Params.MaximumExtraDataSize = (hexutil.Uint64)(params.MaximumExtraDataSize)
285285
spec.Params.MinGasLimit = (hexutil.Uint64)(params.MinGasLimit)
286286
spec.Params.GasLimitBoundDivisor = (hexutil.Uint64)(params.GasLimitBoundDivisor)
287-
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainId.Uint64())
287+
spec.Params.NetworkID = (hexutil.Uint64)(genesis.Config.ChainID.Uint64())
288288
spec.Params.MaxCodeSize = params.MaxCodeSize
289289
spec.Params.EIP155Transition = genesis.Config.EIP155Block.Uint64()
290290
spec.Params.EIP98Transition = math.MaxUint64

cmd/puppeth/module_dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func deployDashboard(client *sshClient, network string, conf *config, config *da
609609
}
610610
template.Must(template.New("").Parse(dashboardContent)).Execute(indexfile, map[string]interface{}{
611611
"Network": network,
612-
"NetworkID": conf.Genesis.Config.ChainId,
612+
"NetworkID": conf.Genesis.Config.ChainID,
613613
"NetworkTitle": strings.Title(network),
614614
"EthstatsPage": config.ethstats,
615615
"ExplorerPage": config.explorer,

cmd/puppeth/wizard_faucet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (w *wizard) deployFaucet() {
4949
existed := err == nil
5050

5151
infos.node.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
52-
infos.node.network = w.conf.Genesis.Config.ChainId.Int64()
52+
infos.node.network = w.conf.Genesis.Config.ChainID.Int64()
5353

5454
// Figure out which port to listen on
5555
fmt.Println()

cmd/puppeth/wizard_genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (w *wizard) makeGenesis() {
121121
// Query the user for some custom extras
122122
fmt.Println()
123123
fmt.Println("Specify your chain/network ID if you want an explicit one (default = random)")
124-
genesis.Config.ChainId = new(big.Int).SetUint64(uint64(w.readDefaultInt(rand.Intn(65536))))
124+
genesis.Config.ChainID = new(big.Int).SetUint64(uint64(w.readDefaultInt(rand.Intn(65536))))
125125

126126
// All done, store the genesis and flush to disk
127127
log.Info("Configured new genesis block")

cmd/puppeth/wizard_node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (w *wizard) deployNode(boot bool) {
5656
existed := err == nil
5757

5858
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
59-
infos.network = w.conf.Genesis.Config.ChainId.Int64()
59+
infos.network = w.conf.Genesis.Config.ChainID.Int64()
6060

6161
// Figure out where the user wants to store the persistent data
6262
fmt.Println()

cmd/puppeth/wizard_wallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (w *wizard) deployWallet() {
5252
existed := err == nil
5353

5454
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
55-
infos.network = w.conf.Genesis.Config.ChainId.Int64()
55+
infos.network = w.conf.Genesis.Config.ChainID.Int64()
5656

5757
// Figure out which port to listen on
5858
fmt.Println()

core/blockchain_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ func TestFastVsFullChains(t *testing.T) {
578578
Alloc: GenesisAlloc{address: {Balance: funds}},
579579
}
580580
genesis = gspec.MustCommit(gendb)
581-
signer = types.NewEIP155Signer(gspec.Config.ChainId)
581+
signer = types.NewEIP155Signer(gspec.Config.ChainID)
582582
)
583583
blocks, receipts := GenerateChain(gspec.Config, genesis, ethash.NewFaker(), gendb, 1024, func(i int, block *BlockGen) {
584584
block.SetCoinbase(common.Address{0x00})
@@ -753,7 +753,7 @@ func TestChainTxReorgs(t *testing.T) {
753753
},
754754
}
755755
genesis = gspec.MustCommit(db)
756-
signer = types.NewEIP155Signer(gspec.Config.ChainId)
756+
signer = types.NewEIP155Signer(gspec.Config.ChainID)
757757
)
758758

759759
// Create two transactions shared between the chains:
@@ -859,7 +859,7 @@ func TestLogReorgs(t *testing.T) {
859859
code = common.Hex2Bytes("60606040525b7f24ec1d3ff24c2f6ff210738839dbc339cd45a5294d85c79361016243157aae7b60405180905060405180910390a15b600a8060416000396000f360606040526008565b00")
860860
gspec = &Genesis{Config: params.TestChainConfig, Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(10000000000000)}}}
861861
genesis = gspec.MustCommit(db)
862-
signer = types.NewEIP155Signer(gspec.Config.ChainId)
862+
signer = types.NewEIP155Signer(gspec.Config.ChainID)
863863
)
864864

865865
blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{})
@@ -906,7 +906,7 @@ func TestReorgSideEvent(t *testing.T) {
906906
Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(10000000000000)}},
907907
}
908908
genesis = gspec.MustCommit(db)
909-
signer = types.NewEIP155Signer(gspec.Config.ChainId)
909+
signer = types.NewEIP155Signer(gspec.Config.ChainID)
910910
)
911911

912912
blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{})
@@ -1032,7 +1032,7 @@ func TestEIP155Transition(t *testing.T) {
10321032
funds = big.NewInt(1000000000)
10331033
deleteAddr = common.Address{1}
10341034
gspec = &Genesis{
1035-
Config: &params.ChainConfig{ChainId: big.NewInt(1), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)},
1035+
Config: &params.ChainConfig{ChainID: big.NewInt(1), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)},
10361036
Alloc: GenesisAlloc{address: {Balance: funds}, deleteAddr: {Balance: new(big.Int)}},
10371037
}
10381038
genesis = gspec.MustCommit(db)
@@ -1063,7 +1063,7 @@ func TestEIP155Transition(t *testing.T) {
10631063
}
10641064
block.AddTx(tx)
10651065

1066-
tx, err = basicTx(types.NewEIP155Signer(gspec.Config.ChainId))
1066+
tx, err = basicTx(types.NewEIP155Signer(gspec.Config.ChainID))
10671067
if err != nil {
10681068
t.Fatal(err)
10691069
}
@@ -1075,7 +1075,7 @@ func TestEIP155Transition(t *testing.T) {
10751075
}
10761076
block.AddTx(tx)
10771077

1078-
tx, err = basicTx(types.NewEIP155Signer(gspec.Config.ChainId))
1078+
tx, err = basicTx(types.NewEIP155Signer(gspec.Config.ChainID))
10791079
if err != nil {
10801080
t.Fatal(err)
10811081
}
@@ -1103,7 +1103,7 @@ func TestEIP155Transition(t *testing.T) {
11031103
}
11041104

11051105
// generate an invalid chain id transaction
1106-
config := &params.ChainConfig{ChainId: big.NewInt(2), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}
1106+
config := &params.ChainConfig{ChainID: big.NewInt(2), EIP155Block: big.NewInt(2), HomesteadBlock: new(big.Int)}
11071107
blocks, _ = GenerateChain(config, blocks[len(blocks)-1], ethash.NewFaker(), db, 4, func(i int, block *BlockGen) {
11081108
var (
11091109
tx *types.Transaction
@@ -1137,7 +1137,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
11371137
theAddr = common.Address{1}
11381138
gspec = &Genesis{
11391139
Config: &params.ChainConfig{
1140-
ChainId: big.NewInt(1),
1140+
ChainID: big.NewInt(1),
11411141
HomesteadBlock: new(big.Int),
11421142
EIP155Block: new(big.Int),
11431143
EIP158Block: big.NewInt(2),
@@ -1153,7 +1153,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
11531153
var (
11541154
tx *types.Transaction
11551155
err error
1156-
signer = types.NewEIP155Signer(gspec.Config.ChainId)
1156+
signer = types.NewEIP155Signer(gspec.Config.ChainID)
11571157
)
11581158
switch i {
11591159
case 0:

core/tx_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain block
222222
config: config,
223223
chainconfig: chainconfig,
224224
chain: chain,
225-
signer: types.NewEIP155Signer(chainconfig.ChainId),
225+
signer: types.NewEIP155Signer(chainconfig.ChainID),
226226
pending: make(map[common.Address]*txList),
227227
queue: make(map[common.Address]*txList),
228228
beats: make(map[common.Address]time.Time),

core/types/transaction_signing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
4343
var signer Signer
4444
switch {
4545
case config.IsEIP155(blockNumber):
46-
signer = NewEIP155Signer(config.ChainId)
46+
signer = NewEIP155Signer(config.ChainID)
4747
case config.IsHomestead(blockNumber):
4848
signer = HomesteadSigner{}
4949
default:

0 commit comments

Comments
 (0)