From c27b7e8e13a4eff5325cce6c94f76447a29aba46 Mon Sep 17 00:00:00 2001 From: hattizai Date: Wed, 22 May 2024 11:18:25 +0800 Subject: [PATCH] accounts/abi/bind: keep test file package name consistence common: sort variables to make code more clear core: remove redundant type declaration --- accounts/abi/bind/bind_test.go | 5 +++-- common/big.go | 2 +- core/genesis.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index a390a3c47c..64fc0d65b3 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . -package bind +package bind_test import ( "fmt" @@ -25,6 +25,7 @@ import ( "strings" "testing" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" ) @@ -2096,7 +2097,7 @@ func TestGolangBindings(t *testing.T) { types = []string{tt.name} } // Generate the binding and create a Go source file in the workspace - bind, err := Bind(types, tt.abi, tt.bytecode, tt.fsigs, "bindtest", LangGo, tt.libs, tt.aliases) + bind, err := bind.Bind(types, tt.abi, tt.bytecode, tt.fsigs, "bindtest", bind.LangGo, tt.libs, tt.aliases) if err != nil { t.Fatalf("test %d: failed to generate binding: %v", i, err) } diff --git a/common/big.go b/common/big.go index cbb562a28e..1b58993758 100644 --- a/common/big.go +++ b/common/big.go @@ -24,10 +24,10 @@ import ( // Common big integers often used var ( + Big0 = big.NewInt(0) Big1 = big.NewInt(1) Big2 = big.NewInt(2) Big3 = big.NewInt(3) - Big0 = big.NewInt(0) Big32 = big.NewInt(32) Big256 = big.NewInt(256) Big257 = big.NewInt(257) diff --git a/core/genesis.go b/core/genesis.go index 042071c531..f1b4490f2e 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -594,7 +594,7 @@ func DeveloperGenesisBlock(gasLimit uint64, faucet *common.Address) *Genesis { common.BytesToAddress([]byte{8}): {Balance: big.NewInt(1)}, // ECPairing common.BytesToAddress([]byte{9}): {Balance: big.NewInt(1)}, // BLAKE2b // Pre-deploy EIP-4788 system contract - params.BeaconRootsAddress: types.Account{Nonce: 1, Code: params.BeaconRootsCode}, + params.BeaconRootsAddress: {Nonce: 1, Code: params.BeaconRootsCode}, }, } if faucet != nil {