diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 258b9e6dd9..1da82b9f9f 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -38,12 +38,12 @@ const ( // Tests that a node embedded within a console can be started up properly and // then terminated by closing the input stream. func TestConsoleWelcome(t *testing.T) { - coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" + etherbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" // Start a geth console, make sure it's cleaned up and terminate the console geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", + "--etherbase", etherbase, "--shh", "console") // Gather all the infos the welcome message needs to contain @@ -59,7 +59,7 @@ func TestConsoleWelcome(t *testing.T) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{.Etherbase}} +etherbase: {{.Etherbase}} at block: 0 ({{niltime}}) datadir: {{.Datadir}} modules: {{apis}} @@ -72,7 +72,7 @@ at block: 0 ({{niltime}}) // Tests that a console can be attached to a running node via various means. func TestIPCAttachWelcome(t *testing.T) { // Configure the instance for IPC attachement - coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" + etherbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" var ipc string if runtime.GOOS == "windows" { ipc = `\\.\pipe\geth` + strconv.Itoa(trulyRandInt(100000, 999999)) @@ -85,7 +85,7 @@ func TestIPCAttachWelcome(t *testing.T) { // list of ipc modules and shh is included there. geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", "--ipcpath", ipc) + "--etherbase", etherbase, "--shh", "--ipcpath", ipc) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "ipc:"+ipc, ipcAPIs) @@ -95,11 +95,11 @@ func TestIPCAttachWelcome(t *testing.T) { } func TestHTTPAttachWelcome(t *testing.T) { - coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" + etherbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--rpc", "--rpcport", port) + "--etherbase", etherbase, "--rpc", "--rpcport", port) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "http://localhost:"+port, httpAPIs) @@ -109,12 +109,12 @@ func TestHTTPAttachWelcome(t *testing.T) { } func TestWSAttachWelcome(t *testing.T) { - coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" + etherbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P geth := runGeth(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--ws", "--wsport", port) + "--etherbase", etherbase, "--ws", "--wsport", port) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, geth, "ws://localhost:"+port, httpAPIs) @@ -145,7 +145,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{etherbase}} +etherbase: {{etherbase}} at block: 0 ({{niltime}}){{if ipc}} datadir: {{datadir}}{{end}} modules: {{apis}} diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index d2fb6934b9..14ef83ecd4 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -143,7 +143,7 @@ func sigHash(header *types.Header) (hash common.Hash) { rlp.Encode(hasher, []interface{}{ header.ParentHash, header.UncleHash, - header.Coinbase, + header.Etherbase, header.Root, header.TxHash, header.ReceiptHash, @@ -274,7 +274,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainReader, header *types.Header, } // Checkpoint blocks need to enforce zero beneficiary checkpoint := (number % c.config.Epoch) == 0 - if checkpoint && header.Coinbase != (common.Address{}) { + if checkpoint && header.Etherbase != (common.Address{}) { return errInvalidCheckpointBeneficiary } // Nonces must be 0x00..0 or 0xff..f, zeroes enforced on checkpoints @@ -499,7 +499,7 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p // header for running the transactions on top. func (c *Clique) Prepare(chain consensus.ChainReader, header *types.Header) error { // If the block isn't a checkpoint, cast a random vote (good enough for now) - header.Coinbase = common.Address{} + header.Etherbase = common.Address{} header.Nonce = types.BlockNonce{} number := header.Number.Uint64() @@ -521,8 +521,8 @@ func (c *Clique) Prepare(chain consensus.ChainReader, header *types.Header) erro } // If there's pending proposals, cast a vote on them if len(addresses) > 0 { - header.Coinbase = addresses[rand.Intn(len(addresses))] - if c.proposals[header.Coinbase] { + header.Etherbase = addresses[rand.Intn(len(addresses))] + if c.proposals[header.Etherbase] { copy(header.Nonce[:], nonceAuthVote) } else { copy(header.Nonce[:], nonceDropVote) diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 9ebdb8df15..26fae87a5e 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -217,7 +217,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) { // Header authorized, discard any previous votes from the signer for i, vote := range snap.Votes { - if vote.Signer == signer && vote.Address == header.Coinbase { + if vote.Signer == signer && vote.Address == header.Etherbase { // Uncast the vote from the cached tally snap.uncast(vote.Address, vote.Authorize) @@ -236,20 +236,20 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) { default: return nil, errInvalidVote } - if snap.cast(header.Coinbase, authorize) { + if snap.cast(header.Etherbase, authorize) { snap.Votes = append(snap.Votes, &Vote{ Signer: signer, Block: number, - Address: header.Coinbase, + Address: header.Etherbase, Authorize: authorize, }) } // If the vote passed, update the list of signers - if tally := snap.Tally[header.Coinbase]; tally.Votes > len(snap.Signers)/2 { + if tally := snap.Tally[header.Etherbase]; tally.Votes > len(snap.Signers)/2 { if tally.Authorize { - snap.Signers[header.Coinbase] = struct{}{} + snap.Signers[header.Etherbase] = struct{}{} } else { - delete(snap.Signers, header.Coinbase) + delete(snap.Signers, header.Etherbase) // Signer list shrunk, delete any leftover recent caches if limit := uint64(len(snap.Signers)/2 + 1); number >= limit { @@ -257,7 +257,7 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) { } // Discard any previous votes the deauthorized signer cast for i := 0; i < len(snap.Votes); i++ { - if snap.Votes[i].Signer == header.Coinbase { + if snap.Votes[i].Signer == header.Etherbase { // Uncast the vote from the cached tally snap.uncast(snap.Votes[i].Address, snap.Votes[i].Authorize) @@ -270,12 +270,12 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) { } // Discard any previous votes around the just changed account for i := 0; i < len(snap.Votes); i++ { - if snap.Votes[i].Address == header.Coinbase { + if snap.Votes[i].Address == header.Etherbase { snap.Votes = append(snap.Votes[:i], snap.Votes[i+1:]...) i-- } } - delete(snap.Tally, header.Coinbase) + delete(snap.Tally, header.Etherbase) } } snap.Number += uint64(len(headers)) diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index f18934b890..f2e8d6e521 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -358,10 +358,10 @@ func TestVoting(t *testing.T) { headers := make([]*types.Header, len(tt.votes)) for j, vote := range tt.votes { headers[j] = &types.Header{ - Number: big.NewInt(int64(j) + 1), - Time: big.NewInt(int64(j) * int64(blockPeriod)), - Coinbase: accounts.address(vote.voted), - Extra: make([]byte, extraVanity+extraSeal), + Number: big.NewInt(int64(j) + 1), + Time: big.NewInt(int64(j) * int64(blockPeriod)), + Etherbase: accounts.address(vote.voted), + Extra: make([]byte, extraVanity+extraSeal), } if j > 0 { headers[j].ParentHash = headers[j-1].Hash() diff --git a/consensus/consensus.go b/consensus/consensus.go index 865238cee0..b3e5083796 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -50,7 +50,7 @@ type ChainReader interface { // Engine is an algorithm agnostic consensus engine. type Engine interface { // Author retrieves the Ethereum address of the account that minted the given - // block, which may be different from the header's coinbase if a consensus + // block, which may be different from the header's etherbase if a consensus // engine is based on signatures. Author(header *types.Header) (common.Address, error) diff --git a/consensus/ethash/algorithm_test.go b/consensus/ethash/algorithm_test.go index 7e4307a74a..e824ca2878 100644 --- a/consensus/ethash/algorithm_test.go +++ b/consensus/ethash/algorithm_test.go @@ -683,7 +683,7 @@ func TestConcurrentDiskCacheGeneration(t *testing.T) { Number: big.NewInt(3311058), ParentHash: common.HexToHash("0xd783efa4d392943503f28438ad5830b2d5964696ffc285f338585e9fe0a37a05"), UncleHash: common.HexToHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"), - Coinbase: common.HexToAddress("0xc0ea08a2d404d3172d2add29a45be56da40e2949"), + Etherbase: common.HexToAddress("0xc0ea08a2d404d3172d2add29a45be56da40e2949"), Root: common.HexToHash("0x77d14e10470b5850332524f8cd6f69ad21f070ce92dca33ab2858300242ef2f1"), TxHash: common.HexToHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"), ReceiptHash: common.HexToHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"), diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 6a19d449f3..c7fc35f6f2 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -58,10 +58,10 @@ var ( errInvalidPoW = errors.New("invalid proof-of-work") ) -// Author implements consensus.Engine, returning the header's coinbase as the +// Author implements consensus.Engine, returning the header's etherbase as the // proof-of-work verified author of the block. func (ethash *Ethash) Author(header *types.Header) (common.Address, error) { - return header.Coinbase, nil + return header.Etherbase, nil } // VerifyHeader checks whether a header conforms to the consensus rules of the @@ -523,9 +523,9 @@ var ( big32 = big.NewInt(32) ) -// AccumulateRewards credits the coinbase of the given block with the mining +// AccumulateRewards credits the etherbase of the given block with the mining // reward. The total reward consists of the static block reward and rewards for -// included uncles. The coinbase of each uncle block is also rewarded. +// included uncles. The etherbase of each uncle block is also rewarded. // TODO (karalabe): Move the chain maker into this package and make this private! func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, uncles []*types.Header) { // Select the correct block reward based on chain progression @@ -541,10 +541,10 @@ func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header r.Sub(r, header.Number) r.Mul(r, blockReward) r.Div(r, big8) - state.AddBalance(uncle.Coinbase, r) + state.AddBalance(uncle.Etherbase, r) r.Div(blockReward, big32) reward.Add(reward, r) } - state.AddBalance(header.Coinbase, reward) + state.AddBalance(header.Etherbase, reward) } diff --git a/console/console.go b/console/console.go index 3cd2ad34b7..a4fb4bfc7a 100644 --- a/console/console.go +++ b/console/console.go @@ -261,7 +261,7 @@ func (c *Console) Welcome() { fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n") c.jsre.Run(` console.log("instance: " + web3.version.node); - console.log("coinbase: " + eth.coinbase); + console.log("etherbase: " + eth.etherbase); console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")"); console.log(" datadir: " + admin.datadir); `) diff --git a/console/console_test.go b/console/console_test.go index 8ac499bd12..6c344f5628 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -152,7 +152,7 @@ func (env *tester) Close(t *testing.T) { } // Tests that the node lists the correct welcome message, notably that it contains -// the instance name, coinbase account, block number, data directory and supported +// the instance name, etherbase account, block number, data directory and supported // console modules. func TestWelcome(t *testing.T) { tester := newTester(t, nil) @@ -167,14 +167,14 @@ func TestWelcome(t *testing.T) { if want := fmt.Sprintf("instance: %s", testInstance); !strings.Contains(output, want) { t.Fatalf("console output missing instance: have\n%s\nwant also %s", output, want) } - if want := fmt.Sprintf("coinbase: %s", testAddress); !strings.Contains(output, want) { - t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want) + if want := fmt.Sprintf("etherbase: %s", testAddress); !strings.Contains(output, want) { + t.Fatalf("console output missing etherbase: have\n%s\nwant also %s", output, want) } if want := "at block: 0"; !strings.Contains(output, want) { t.Fatalf("console output missing sync status: have\n%s\nwant also %s", output, want) } if want := fmt.Sprintf("datadir: %s", tester.workspace); !strings.Contains(output, want) { - t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want) + t.Fatalf("console output missing etherbase: have\n%s\nwant also %s", output, want) } } diff --git a/core/bench_test.go b/core/bench_test.go index ab25c27d39..b836e69702 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -226,7 +226,7 @@ func makeChainForBench(db ethdb.Database, full bool, count uint64) { var hash common.Hash for n := uint64(0); n < count; n++ { header := &types.Header{ - Coinbase: common.Address{}, + Etherbase: common.Address{}, Number: big.NewInt(int64(n)), ParentHash: hash, Difficulty: big.NewInt(1), diff --git a/core/blockchain_test.go b/core/blockchain_test.go index cb1df8d4b0..1b90332bfb 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -360,7 +360,7 @@ func makeBlockChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.B var chain []*types.Block for i, difficulty := range d { header := &types.Header{ - Coinbase: common.Address{seed}, + Etherbase: common.Address{seed}, Number: big.NewInt(int64(i + 1)), Difficulty: big.NewInt(int64(difficulty)), UncleHash: types.EmptyUncleHash, @@ -589,7 +589,7 @@ func TestFastVsFullChains(t *testing.T) { signer = types.NewEIP155Signer(gspec.Config.ChainId) ) blocks, receipts := GenerateChain(gspec.Config, genesis, gendb, 1024, func(i int, block *BlockGen) { - block.SetCoinbase(common.Address{0x00}) + block.SetEtherbase(common.Address{0x00}) // If the block number is multiple of 3, send a few bonus transactions to the miner if i%3 == 2 { diff --git a/core/chain_makers.go b/core/chain_makers.go index dd3e2fb192..112eae843c 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -53,16 +53,16 @@ type BlockGen struct { config *params.ChainConfig } -// SetCoinbase sets the coinbase of the generated block. +// SetEtherbase sets the etherbase of the generated block. // It can be called at most once. -func (b *BlockGen) SetCoinbase(addr common.Address) { +func (b *BlockGen) SetEtherbase(addr common.Address) { if b.gasPool != nil { if len(b.txs) > 0 { - panic("coinbase must be set before adding transactions") + panic("etherbase must be set before adding transactions") } - panic("coinbase can only be set once") + panic("etherbase can only be set once") } - b.header.Coinbase = addr + b.header.Etherbase = addr b.gasPool = new(GasPool).AddGas(b.header.GasLimit) } @@ -71,8 +71,8 @@ func (b *BlockGen) SetExtra(data []byte) { b.header.Extra = data } -// AddTx adds a transaction to the generated block. If no coinbase has -// been set, the block's coinbase is set to the zero address. +// AddTx adds a transaction to the generated block. If no etherbase has +// been set, the block's etherbase is set to the zero address. // // AddTx panics if the transaction cannot be executed. In addition to // the protocol-imposed limitations (gas limit, etc.), there are some @@ -81,10 +81,10 @@ func (b *BlockGen) SetExtra(data []byte) { // will panic during execution. func (b *BlockGen) AddTx(tx *types.Transaction) { if b.gasPool == nil { - b.SetCoinbase(common.Address{}) + b.SetEtherbase(common.Address{}) } b.statedb.Prepare(tx.Hash(), common.Hash{}, len(b.txs)) - receipt, _, err := ApplyTransaction(b.config, nil, &b.header.Coinbase, b.gasPool, b.statedb, b.header, tx, b.header.GasUsed, vm.Config{}) + receipt, _, err := ApplyTransaction(b.config, nil, &b.header.Etherbase, b.gasPool, b.statedb, b.header, tx, b.header.GasUsed, vm.Config{}) if err != nil { panic(err) } @@ -151,7 +151,7 @@ func (b *BlockGen) OffsetTime(seconds int64) { // The generator function is called with a new block generator for // every block. Any transactions and uncles added to the generator // become part of the block. If gen is nil, the blocks will be empty -// and their coinbase will be the zero address. +// and their etherbase will be the zero address. // // Blocks created by GenerateChain do not contain valid proof of work // values. Inserting them into BlockChain requires use of FakePow or @@ -212,7 +212,7 @@ func makeHeader(config *params.ChainConfig, parent *types.Block, state *state.St return &types.Header{ Root: state.IntermediateRoot(config.IsEIP158(parent.Number())), ParentHash: parent.Hash(), - Coinbase: parent.Coinbase(), + Etherbase: parent.Etherbase(), Difficulty: ethash.CalcDifficulty(config, time.Uint64(), &types.Header{ Number: parent.Number(), Time: new(big.Int).Sub(time, big.NewInt(10)), @@ -265,7 +265,7 @@ func makeHeaderChain(parent *types.Header, n int, db ethdb.Database, seed int) [ // makeBlockChain creates a deterministic chain of blocks rooted at parent. func makeBlockChain(parent *types.Block, n int, db ethdb.Database, seed int) []*types.Block { blocks, _ := GenerateChain(params.TestChainConfig, parent, db, n, func(i int, b *BlockGen) { - b.SetCoinbase(common.Address{0: byte(seed), 19: byte(i)}) + b.SetEtherbase(common.Address{0: byte(seed), 19: byte(i)}) }) return blocks } diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index 2260c62fbd..96b9a001e5 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -65,7 +65,7 @@ func ExampleGenerateChain() { gen.AddTx(tx2) case 2: // Block 3 is empty but was mined by addr3. - gen.SetCoinbase(addr3) + gen.SetEtherbase(addr3) gen.SetExtra([]byte("yeehaw")) case 3: // Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data). diff --git a/core/evm.go b/core/evm.go index 4912aa6505..0817b82416 100644 --- a/core/evm.go +++ b/core/evm.go @@ -49,7 +49,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author Transfer: Transfer, GetHash: GetHashFn(header, chain), Origin: msg.From(), - Coinbase: beneficiary, + Etherbase: beneficiary, BlockNumber: new(big.Int).Set(header.Number), Time: new(big.Int).Set(header.Time), Difficulty: new(big.Int).Set(header.Difficulty), diff --git a/core/gen_genesis.go b/core/gen_genesis.go index 4d75704a6d..da1cdbb910 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -22,7 +22,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) { GasLimit math.HexOrDecimal64 `json:"gasLimit" gencodec:"required"` Difficulty *math.HexOrDecimal256 `json:"difficulty" gencodec:"required"` Mixhash common.Hash `json:"mixHash"` - Coinbase common.Address `json:"coinbase"` + Etherbase common.Address `json:"coinbase"` Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc" gencodec:"required"` Number math.HexOrDecimal64 `json:"number"` GasUsed math.HexOrDecimal64 `json:"gasUsed"` @@ -36,7 +36,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) { enc.GasLimit = math.HexOrDecimal64(g.GasLimit) enc.Difficulty = (*math.HexOrDecimal256)(g.Difficulty) enc.Mixhash = g.Mixhash - enc.Coinbase = g.Coinbase + enc.Etherbase = g.Etherbase if g.Alloc != nil { enc.Alloc = make(map[common.UnprefixedAddress]GenesisAccount, len(g.Alloc)) for k, v := range g.Alloc { @@ -58,7 +58,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { GasLimit *math.HexOrDecimal64 `json:"gasLimit" gencodec:"required"` Difficulty *math.HexOrDecimal256 `json:"difficulty" gencodec:"required"` Mixhash *common.Hash `json:"mixHash"` - Coinbase *common.Address `json:"coinbase"` + Etherbase *common.Address `json:"coinbase"` Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc" gencodec:"required"` Number *math.HexOrDecimal64 `json:"number"` GasUsed *math.HexOrDecimal64 `json:"gasUsed"` @@ -91,8 +91,8 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { if dec.Mixhash != nil { g.Mixhash = *dec.Mixhash } - if dec.Coinbase != nil { - g.Coinbase = *dec.Coinbase + if dec.Etherbase != nil { + g.Etherbase = *dec.Etherbase } if dec.Alloc == nil { return errors.New("missing required field 'alloc' for Genesis") diff --git a/core/genesis.go b/core/genesis.go index fd6ed61159..85c291169d 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -51,7 +51,7 @@ type Genesis struct { GasLimit uint64 `json:"gasLimit" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` Mixhash common.Hash `json:"mixHash"` - Coinbase common.Address `json:"coinbase"` + Etherbase common.Address `json:"coinbase"` Alloc GenesisAlloc `json:"alloc" gencodec:"required"` // These fields are used for consensus tests. Please don't use them @@ -243,7 +243,7 @@ func (g *Genesis) ToBlock() (*types.Block, *state.StateDB) { GasUsed: new(big.Int).SetUint64(g.GasUsed), Difficulty: g.Difficulty, MixDigest: g.Mixhash, - Coinbase: g.Coinbase, + Etherbase: g.Etherbase, Root: root, } if g.GasLimit == 0 { diff --git a/core/state_processor.go b/core/state_processor.go index 689c83785f..de983135f5 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -50,7 +50,7 @@ func NewStateProcessor(config *params.ChainConfig, bc *BlockChain, engine consen // Process processes the state changes according to the Ethereum rules by running // the transaction messages using the statedb and applying any rewards to both -// the processor (coinbase) and any included uncles. +// the processor (etherbase) and any included uncles. // // Process returns the receipts and logs accumulated during the process and // returns the amount of gas that was used in the process. If any of the diff --git a/core/state_transition.go b/core/state_transition.go index e7a0685893..488ff7d7f3 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -255,7 +255,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *big requiredGas = new(big.Int).Set(st.gasUsed()) st.refundGas() - st.state.AddBalance(st.evm.Coinbase, new(big.Int).Mul(st.gasUsed(), st.gasPrice)) + st.state.AddBalance(st.evm.Etherbase, new(big.Int).Mul(st.gasUsed(), st.gasPrice)) return ret, requiredGas, st.gasUsed(), vmerr != nil, err } diff --git a/core/types/block.go b/core/types/block.go index 1d00d9f930..ca6002c1b3 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -70,7 +70,7 @@ func (n *BlockNonce) UnmarshalText(input []byte) error { type Header struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"` - Coinbase common.Address `json:"miner" gencodec:"required"` + Etherbase common.Address `json:"miner" gencodec:"required"` Root common.Hash `json:"stateRoot" gencodec:"required"` TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` @@ -107,7 +107,7 @@ func (h *Header) HashNoNonce() common.Hash { return rlpHash([]interface{}{ h.ParentHash, h.UncleHash, - h.Coinbase, + h.Etherbase, h.Root, h.TxHash, h.ReceiptHash, @@ -307,17 +307,17 @@ func (b *Block) GasUsed() *big.Int { return new(big.Int).Set(b.header.GasUsed func (b *Block) Difficulty() *big.Int { return new(big.Int).Set(b.header.Difficulty) } func (b *Block) Time() *big.Int { return new(big.Int).Set(b.header.Time) } -func (b *Block) NumberU64() uint64 { return b.header.Number.Uint64() } -func (b *Block) MixDigest() common.Hash { return b.header.MixDigest } -func (b *Block) Nonce() uint64 { return binary.BigEndian.Uint64(b.header.Nonce[:]) } -func (b *Block) Bloom() Bloom { return b.header.Bloom } -func (b *Block) Coinbase() common.Address { return b.header.Coinbase } -func (b *Block) Root() common.Hash { return b.header.Root } -func (b *Block) ParentHash() common.Hash { return b.header.ParentHash } -func (b *Block) TxHash() common.Hash { return b.header.TxHash } -func (b *Block) ReceiptHash() common.Hash { return b.header.ReceiptHash } -func (b *Block) UncleHash() common.Hash { return b.header.UncleHash } -func (b *Block) Extra() []byte { return common.CopyBytes(b.header.Extra) } +func (b *Block) NumberU64() uint64 { return b.header.Number.Uint64() } +func (b *Block) MixDigest() common.Hash { return b.header.MixDigest } +func (b *Block) Nonce() uint64 { return binary.BigEndian.Uint64(b.header.Nonce[:]) } +func (b *Block) Bloom() Bloom { return b.header.Bloom } +func (b *Block) Etherbase() common.Address { return b.header.Etherbase } +func (b *Block) Root() common.Hash { return b.header.Root } +func (b *Block) ParentHash() common.Hash { return b.header.ParentHash } +func (b *Block) TxHash() common.Hash { return b.header.TxHash } +func (b *Block) ReceiptHash() common.Hash { return b.header.ReceiptHash } +func (b *Block) UncleHash() common.Hash { return b.header.UncleHash } +func (b *Block) Extra() []byte { return common.CopyBytes(b.header.Extra) } func (b *Block) Header() *Header { return CopyHeader(b.header) } @@ -404,7 +404,7 @@ func (h *Header) String() string { [ ParentHash: %x UncleHash: %x - Coinbase: %x + Etherbase: %x Root: %x TxSha %x ReceiptSha: %x @@ -417,7 +417,7 @@ func (h *Header) String() string { Extra: %s MixDigest: %x Nonce: %x -]`, h.Hash(), h.ParentHash, h.UncleHash, h.Coinbase, h.Root, h.TxHash, h.ReceiptHash, h.Bloom, h.Difficulty, h.Number, h.GasLimit, h.GasUsed, h.Time, h.Extra, h.MixDigest, h.Nonce) +]`, h.Hash(), h.ParentHash, h.UncleHash, h.Etherbase, h.Root, h.TxHash, h.ReceiptHash, h.Bloom, h.Difficulty, h.Number, h.GasLimit, h.GasUsed, h.Time, h.Extra, h.MixDigest, h.Nonce) } type Blocks []*Block diff --git a/core/types/block_test.go b/core/types/block_test.go index 93435ca00c..4f5ba52b28 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -43,7 +43,7 @@ func TestBlockEncoding(t *testing.T) { check("Difficulty", block.Difficulty(), big.NewInt(131072)) check("GasLimit", block.GasLimit(), big.NewInt(3141592)) check("GasUsed", block.GasUsed(), big.NewInt(21000)) - check("Coinbase", block.Coinbase(), common.HexToAddress("8888f1f195afa192cfee860698584c030f4c9db1")) + check("Etherbase", block.Etherbase(), common.HexToAddress("8888f1f195afa192cfee860698584c030f4c9db1")) check("MixDigest", block.MixDigest(), common.HexToHash("bd4472abb6659ebe3ee06ee4d7b72a00a9f4d001caca51342001075469aff498")) check("Root", block.Root(), common.HexToHash("ef1552a40b7165c3cd773806b9e0c165b75356e0314bf0706f279c729f51e017")) check("Hash", block.Hash(), common.HexToHash("0a5843ac1cb04865017cb35a57b50b07084e5fcee39b5acadade33149f4fff9e")) diff --git a/core/types/bloom9_test.go b/core/types/bloom9_test.go index a28ac0e7af..0a929a6971 100644 --- a/core/types/bloom9_test.go +++ b/core/types/bloom9_test.go @@ -72,8 +72,8 @@ func TestBloom9(t *testing.T) { func TestAddress(t *testing.T) { block := &Block{} - block.Coinbase = common.Hex2Bytes("22341ae42d6dd7384bc8584e50419ea3ac75b83f") - fmt.Printf("%x\n", crypto.Keccak256(block.Coinbase)) + block.Etherbase = common.Hex2Bytes("22341ae42d6dd7384bc8584e50419ea3ac75b83f") + fmt.Printf("%x\n", crypto.Keccak256(block.Etherbase)) bin := CreateBloom(block) fmt.Printf("bin = %x\n", common.LeftPadBytes(bin, 64)) diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go index bcff7a940d..87122122f7 100644 --- a/core/types/gen_header_json.go +++ b/core/types/gen_header_json.go @@ -15,7 +15,7 @@ func (h Header) MarshalJSON() ([]byte, error) { type Header struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"` - Coinbase common.Address `json:"miner" gencodec:"required"` + Etherbase common.Address `json:"miner" gencodec:"required"` Root common.Hash `json:"stateRoot" gencodec:"required"` TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` @@ -33,7 +33,7 @@ func (h Header) MarshalJSON() ([]byte, error) { var enc Header enc.ParentHash = h.ParentHash enc.UncleHash = h.UncleHash - enc.Coinbase = h.Coinbase + enc.Etherbase = h.Etherbase enc.Root = h.Root enc.TxHash = h.TxHash enc.ReceiptHash = h.ReceiptHash @@ -54,7 +54,7 @@ func (h *Header) UnmarshalJSON(input []byte) error { type Header struct { ParentHash *common.Hash `json:"parentHash" gencodec:"required"` UncleHash *common.Hash `json:"sha3Uncles" gencodec:"required"` - Coinbase *common.Address `json:"miner" gencodec:"required"` + Etherbase *common.Address `json:"miner" gencodec:"required"` Root *common.Hash `json:"stateRoot" gencodec:"required"` TxHash *common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash *common.Hash `json:"receiptsRoot" gencodec:"required"` @@ -80,10 +80,10 @@ func (h *Header) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'sha3Uncles' for Header") } h.UncleHash = *dec.UncleHash - if dec.Coinbase == nil { + if dec.Etherbase == nil { return errors.New("missing required field 'miner' for Header") } - h.Coinbase = *dec.Coinbase + h.Etherbase = *dec.Etherbase if dec.Root == nil { return errors.New("missing required field 'stateRoot' for Header") } diff --git a/core/vm/evm.go b/core/vm/evm.go index 093c7d4c14..0171a7c6be 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -67,7 +67,7 @@ type Context struct { GasPrice *big.Int // Provides information for GASPRICE // Block information - Coinbase common.Address // Provides information for COINBASE + Etherbase common.Address // Provides information for ETHERBASE GasLimit *big.Int // Provides information for GASLIMIT BlockNumber *big.Int // Provides information for NUMBER Time *big.Int // Provides information for TIME diff --git a/core/vm/instructions.go b/core/vm/instructions.go index b6d6e22c4c..05242d6949 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -451,8 +451,8 @@ func opBlockhash(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack return nil, nil } -func opCoinbase(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { - stack.push(evm.Coinbase.Big()) +func opEtherbase(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { + stack.push(evm.Etherbase.Big()) return nil, nil } diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 9ef192fdf9..80dcacaf68 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -346,8 +346,8 @@ func NewFrontierInstructionSet() [256]operation { validateStack: makeStackFunc(1, 1), valid: true, }, - COINBASE: { - execute: opCoinbase, + ETHERBASE: { + execute: opEtherbase, gasCost: constGasFunc(GasQuickStep), validateStack: makeStackFunc(0, 1), valid: true, diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index 0c65507355..40829991d8 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -89,7 +89,7 @@ const ( const ( // 0x40 range - block operations BLOCKHASH OpCode = 0x40 + iota - COINBASE + ETHERBASE TIMESTAMP NUMBER DIFFICULTY @@ -259,7 +259,7 @@ var opCodeToString = map[OpCode]string{ // 0x40 range - block operations BLOCKHASH: "BLOCKHASH", - COINBASE: "COINBASE", + ETHERBASE: "COINBASE", TIMESTAMP: "TIMESTAMP", NUMBER: "NUMBER", DIFFICULTY: "DIFFICULTY", @@ -421,7 +421,7 @@ var stringToOp = map[string]OpCode{ "RETURNDATASIZE": RETURNDATASIZE, "RETURNDATACOPY": RETURNDATACOPY, "BLOCKHASH": BLOCKHASH, - "COINBASE": COINBASE, + "COINBASE": ETHERBASE, "TIMESTAMP": TIMESTAMP, "NUMBER": NUMBER, "DIFFICULTY": DIFFICULTY, diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index 818da1be26..85a418b411 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -31,7 +31,7 @@ func NewEnv(cfg *Config) *vm.EVM { GetHash: func(uint64) common.Hash { return common.Hash{} }, Origin: cfg.Origin, - Coinbase: cfg.Coinbase, + Etherbase: cfg.Etherbase, BlockNumber: cfg.BlockNumber, Time: cfg.Time, Difficulty: cfg.Difficulty, diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index edbf541766..37f92f5b28 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -35,7 +35,7 @@ type Config struct { ChainConfig *params.ChainConfig Difficulty *big.Int Origin common.Address - Coinbase common.Address + Etherbase common.Address BlockNumber *big.Int Time *big.Int GasLimit uint64 diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 2c4dc50265..1c9a11068a 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -70,7 +70,7 @@ func TestEVM(t *testing.T) { byte(vm.PUSH1), byte(vm.ORIGIN), byte(vm.BLOCKHASH), - byte(vm.COINBASE), + byte(vm.ETHERBASE), }, nil, nil) } diff --git a/core/vm/vm_jit.go b/core/vm/vm_jit.go index eb3acfb10d..798f62dcdf 100644 --- a/core/vm/vm_jit.go +++ b/core/vm/vm_jit.go @@ -62,7 +62,7 @@ type RuntimeData struct { caller i256 origin i256 callValue i256 - coinBase i256 + etherBase i256 difficulty i256 gasLimit i256 number uint64 @@ -193,7 +193,7 @@ func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *bi self.data.caller = address2llvm(caller.Address()) self.data.origin = address2llvm(self.env.Origin()) self.data.callValue = big2llvm(value) - self.data.coinBase = address2llvm(self.env.Coinbase()) + self.data.etherBase = address2llvm(self.env.Etherbase()) self.data.difficulty = big2llvm(self.env.Difficulty()) self.data.gasLimit = big2llvm(self.env.GasLimit()) self.data.number = self.env.BlockNumber().Uint64() diff --git a/eth/api.go b/eth/api.go index d64e4e6c75..c3025c2694 100644 --- a/eth/api.go +++ b/eth/api.go @@ -61,11 +61,6 @@ func (api *PublicEthereumAPI) Etherbase() (common.Address, error) { return api.e.Etherbase() } -// Coinbase is the address that mining rewards will be send to (alias for Etherbase) -func (api *PublicEthereumAPI) Coinbase() (common.Address, error) { - return api.Etherbase() -} - // Hashrate returns the POW hashrate func (api *PublicEthereumAPI) Hashrate() hexutil.Uint64 { return hexutil.Uint64(api.e.Miner().HashRate()) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index 58f6e9a624..ee84ce829e 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -108,7 +108,7 @@ func newTester() *downloadTester { func (dl *downloadTester) makeChain(n int, seed byte, parent *types.Block, parentReceipts types.Receipts, heavy bool) ([]common.Hash, map[common.Hash]*types.Header, map[common.Hash]*types.Block, map[common.Hash]types.Receipts) { // Generate the block chain blocks, receipts := core.GenerateChain(params.TestChainConfig, parent, dl.peerDb, n, func(i int, block *core.BlockGen) { - block.SetCoinbase(common.Address{seed}) + block.SetEtherbase(common.Address{seed}) // If a heavy chain is requested, delay blocks to raise difficulty if heavy { diff --git a/eth/fetcher/fetcher_test.go b/eth/fetcher/fetcher_test.go index 85d2f8645e..6fe27cd05a 100644 --- a/eth/fetcher/fetcher_test.go +++ b/eth/fetcher/fetcher_test.go @@ -46,7 +46,7 @@ var ( // reassembly. func makeChain(n int, seed byte, parent *types.Block) ([]common.Hash, map[common.Hash]*types.Block) { blocks, _ := core.GenerateChain(params.TestChainConfig, parent, testdb, n, func(i int, block *core.BlockGen) { - block.SetCoinbase(common.Address{seed}) + block.SetEtherbase(common.Address{seed}) // If the block number is multiple of 3, send a bonus transaction to the miner if parent == genesis && i%3 == 0 { diff --git a/eth/handler_test.go b/eth/handler_test.go index 6752cd2a84..58c7cc474c 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -326,7 +326,7 @@ func testGetNodeData(t *testing.T, protocol int) { block.AddTx(tx2) case 2: // Block 3 is empty but was mined by account #2. - block.SetCoinbase(acc2Addr) + block.SetEtherbase(acc2Addr) block.SetExtra([]byte("yeehaw")) case 3: // Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data). @@ -418,7 +418,7 @@ func testGetReceipt(t *testing.T, protocol int) { block.AddTx(tx2) case 2: // Block 3 is empty but was mined by account #2. - block.SetCoinbase(acc2Addr) + block.SetEtherbase(acc2Addr) block.SetExtra([]byte("yeehaw")) case 3: // Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data). diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 8d1a6f7462..f90f54eba0 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -749,7 +749,7 @@ func (s *PublicBlockChainAPI) rpcOutputBlock(b *types.Block, inclTx bool, fullTx "sha3Uncles": head.UncleHash, "logsBloom": head.Bloom, "stateRoot": head.Root, - "miner": head.Coinbase, + "miner": head.Etherbase, "difficulty": (*hexutil.Big)(head.Difficulty), "totalDifficulty": (*hexutil.Big)(s.b.GetTd(b.Hash())), "extraData": hexutil.Bytes(head.Extra), diff --git a/internal/jsre/deps/web3.js b/internal/jsre/deps/web3.js index 1aa6545281..0a38755cbd 100644 --- a/internal/jsre/deps/web3.js +++ b/internal/jsre/deps/web3.js @@ -1192,7 +1192,7 @@ module.exports = SolidityTypeInt; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file param.js * @author Marek Kotewicz * @date 2015 @@ -1211,7 +1211,7 @@ var SolidityParam = function (value, offset) { /** * This method should be used to get length of params's dynamic part - * + * * @method dynamicPartLength * @returns {Number} length of dynamic part (in bytes) */ @@ -1239,7 +1239,7 @@ SolidityParam.prototype.withOffset = function (offset) { * @param {SolidityParam} result of combination */ SolidityParam.prototype.combine = function (param) { - return new SolidityParam(this.value + param.value); + return new SolidityParam(this.value + param.value); }; /** @@ -1271,8 +1271,8 @@ SolidityParam.prototype.offsetAsBytes = function () { */ SolidityParam.prototype.staticPart = function () { if (!this.isDynamic()) { - return this.value; - } + return this.value; + } return this.offsetAsBytes(); }; @@ -1304,7 +1304,7 @@ SolidityParam.prototype.encode = function () { * @returns {String} */ SolidityParam.encodeList = function (params) { - + // updating offsets var totalOffset = params.length * 32; var offsetParams = params.map(function (param) { @@ -1746,13 +1746,13 @@ if (typeof XMLHttpRequest === 'undefined') { /** * Utils - * + * * @module utils */ /** * Utility functions - * + * * @class [utils] config * @constructor */ @@ -1819,7 +1819,7 @@ module.exports = { You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file sha3.js * @author Marek Kotewicz * @date 2015 @@ -1884,7 +1884,7 @@ var sha3 = require('./sha3.js'); var utf8 = require('utf8'); var unitMap = { - 'noether': '0', + 'noether': '0', 'wei': '1', 'kwei': '1000', 'Kwei': '1000', @@ -2267,18 +2267,18 @@ var isAddress = function (address) { * @param {String} address the given HEX adress * @return {Boolean} */ -var isChecksumAddress = function (address) { +var isChecksumAddress = function (address) { // Check each case address = address.replace('0x',''); var addressHash = sha3(address.toLowerCase()); - for (var i = 0; i < 40; i++ ) { + for (var i = 0; i < 40; i++ ) { // the nth letter should be uppercase if the nth digit of casemap is 1 if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) { return false; } } - return true; + return true; }; @@ -2290,15 +2290,15 @@ var isChecksumAddress = function (address) { * @param {String} address the given HEX adress * @return {String} */ -var toChecksumAddress = function (address) { +var toChecksumAddress = function (address) { if (typeof address === 'undefined') return ''; address = address.toLowerCase().replace('0x',''); var addressHash = sha3(address); var checksumAddress = '0x'; - for (var i = 0; i < address.length; i++ ) { - // If ith character is 9 to f then make it uppercase + for (var i = 0; i < address.length; i++ ) { + // If ith character is 9 to f then make it uppercase if (parseInt(addressHash[i], 16) > 7) { checksumAddress += address[i].toUpperCase(); } else { @@ -2615,7 +2615,7 @@ module.exports = Web3; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file allevents.js * @author Marek Kotewicz * @date 2014 @@ -2705,7 +2705,7 @@ module.exports = AllSolidityEvents; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file batch.js * @author Marek Kotewicz * @date 2015 @@ -2750,7 +2750,7 @@ Batch.prototype.execute = function () { requests[index].callback(null, (requests[index].format ? requests[index].format(result.result) : result.result)); } }); - }); + }); }; module.exports = Batch; @@ -3083,7 +3083,7 @@ module.exports = ContractFactory; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file errors.js * @author Marek Kotewicz * @date 2015 @@ -3125,7 +3125,7 @@ module.exports = { You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file event.js * @author Marek Kotewicz * @date 2014 @@ -3196,7 +3196,7 @@ SolidityEvent.prototype.signature = function () { /** * Should be used to encode indexed params and options to one final object - * + * * @method encode * @param {Object} indexed * @param {Object} options @@ -3227,7 +3227,7 @@ SolidityEvent.prototype.encode = function (indexed, options) { if (value === undefined || value === null) { return null; } - + if (utils.isArray(value)) { return value.map(function (v) { return '0x' + coder.encodeParam(i.type, v); @@ -3249,17 +3249,17 @@ SolidityEvent.prototype.encode = function (indexed, options) { * @return {Object} result object with decoded indexed && not indexed params */ SolidityEvent.prototype.decode = function (data) { - + data.data = data.data || ''; data.topics = data.topics || []; var argTopics = this._anonymous ? data.topics : data.topics.slice(1); var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(""); - var indexedParams = coder.decodeParams(this.types(true), indexedData); + var indexedParams = coder.decodeParams(this.types(true), indexedData); var notIndexedData = data.data.slice(2); var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData); - + var result = formatters.outputLogFormatter(data); result.event = this.displayName(); result.address = data.address; @@ -3294,7 +3294,7 @@ SolidityEvent.prototype.execute = function (indexed, options, callback) { indexed = {}; } } - + var o = this.encode(indexed, options); var formatter = this.decode.bind(this); return new Filter(this._requestManager, o, watches.eth(), formatter, callback); @@ -3355,7 +3355,7 @@ var extend = function (web3) { } }; - ex.formatters = formatters; + ex.formatters = formatters; ex.utils = utils; ex.Method = Method; ex.Property = Property; @@ -4348,7 +4348,7 @@ module.exports = HttpProvider; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file iban.js * @author Marek Kotewicz * @date 2015 @@ -4548,7 +4548,7 @@ Iban.prototype.address = function () { var base36 = this._iban.substr(4); var asBn = new BigNumber(base36, 36); return padLeft(asBn.toString(16), 20); - } + } return ''; }; @@ -4593,7 +4593,7 @@ var IpcProvider = function (path, net) { var _this = this; this.responseCallbacks = {}; this.path = path; - + this.connection = net.connect({path: this.path}); this.connection.on('error', function(e){ @@ -4603,7 +4603,7 @@ var IpcProvider = function (path, net) { this.connection.on('end', function(){ _this._timeout(); - }); + }); // LISTEN FOR CONNECTION RESPONSES @@ -4642,7 +4642,7 @@ Will parse the response and make an array out of it. IpcProvider.prototype._parseResponse = function(data) { var _this = this, returnValues = []; - + // DE-CHUNKER var dechunkedData = data .replace(/\}[\n\r]?\{/g,'}|--|{') // }{ @@ -4746,7 +4746,7 @@ IpcProvider.prototype.send = function (payload) { try { result = JSON.parse(data); } catch(e) { - throw errors.InvalidResponse(data); + throw errors.InvalidResponse(data); } return result; @@ -4921,7 +4921,7 @@ Method.prototype.extractCallback = function (args) { /** * Should be called to check if the number of arguments is correct - * + * * @method validateArgs * @param {Array} arguments * @throws {Error} if it is not @@ -4934,7 +4934,7 @@ Method.prototype.validateArgs = function (args) { /** * Should be called to format input args of method - * + * * @method formatInput * @param {Array} * @return {Array} @@ -4988,7 +4988,7 @@ Method.prototype.attachToObject = function (obj) { obj[name[0]] = obj[name[0]] || {}; obj[name[0]][name[1]] = func; } else { - obj[name[0]] = func; + obj[name[0]] = func; } }; @@ -5052,8 +5052,8 @@ var DB = function (web3) { this._requestManager = web3._requestManager; var self = this; - - methods().forEach(function(method) { + + methods().forEach(function(method) { method.attachToObject(self); method.setRequestManager(web3._requestManager); }); @@ -5155,12 +5155,12 @@ function Eth(web3) { var self = this; - methods().forEach(function(method) { + methods().forEach(function(method) { method.attachToObject(self); method.setRequestManager(self._requestManager); }); - properties().forEach(function(p) { + properties().forEach(function(p) { p.attachToObject(self); p.setRequestManager(self._requestManager); }); @@ -5378,8 +5378,8 @@ var methods = function () { var properties = function () { return [ new Property({ - name: 'coinbase', - getter: 'eth_coinbase' + name: 'etherbase', + getter: 'eth_etherbase' }), new Property({ name: 'mining', @@ -5471,7 +5471,7 @@ var Net = function (web3) { var self = this; - properties().forEach(function(p) { + properties().forEach(function(p) { p.attachToObject(self); p.setRequestManager(web3._requestManager); }); @@ -5622,7 +5622,7 @@ var Shh = function (web3) { var self = this; - methods().forEach(function(method) { + methods().forEach(function(method) { method.attachToObject(self); method.setRequestManager(self._requestManager); }); @@ -5632,11 +5632,11 @@ Shh.prototype.filter = function (fil, callback) { return new Filter(this._requestManager, fil, watches.shh(), formatters.outputPostFormatter, callback); }; -var methods = function () { +var methods = function () { var post = new Method({ - name: 'post', - call: 'shh_post', + name: 'post', + call: 'shh_post', params: 1, inputFormatter: [formatters.inputPostFormatter] }); @@ -5957,7 +5957,7 @@ module.exports = { You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file namereg.js * @author Marek Kotewicz * @date 2015 @@ -6144,7 +6144,7 @@ module.exports = Property; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file requestmanager.js * @author Jeffrey Wilcke * @author Marek Kotewicz @@ -6211,7 +6211,7 @@ RequestManager.prototype.sendAsync = function (data, callback) { if (err) { return callback(err); } - + if (!Jsonrpc.isValidResponse(result)) { return callback(errors.InvalidResponse(result)); } @@ -6244,7 +6244,7 @@ RequestManager.prototype.sendBatch = function (data, callback) { } callback(err, results); - }); + }); }; /** @@ -6348,7 +6348,7 @@ RequestManager.prototype.poll = function () { } var payload = Jsonrpc.toBatchPayload(pollsData); - + // map the request id to they poll id var pollsIdMap = {}; payload.forEach(function(load, index){ @@ -6378,7 +6378,7 @@ RequestManager.prototype.poll = function () { } else return false; }).filter(function (result) { - return !!result; + return !!result; }).filter(function (result) { var valid = Jsonrpc.isValidResponse(result); if (!valid) { @@ -6453,16 +6453,16 @@ var pollSyncing = function(self) { self.callbacks.forEach(function (callback) { if (self.lastSyncState !== sync) { - + // call the callback with true first so the app can stop anything, before receiving the sync data if(!self.lastSyncState && utils.isObject(sync)) callback(null, true); - + // call on the next CPU cycle, so the actions of the sync stop can be processes first setTimeout(function() { callback(null, sync); }, 0); - + self.lastSyncState = sync; } }); @@ -6517,7 +6517,7 @@ module.exports = IsSyncing; You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ -/** +/** * @file transfer.js * @author Marek Kotewicz * @date 2015 @@ -6536,7 +6536,7 @@ var exchangeAbi = require('../contracts/SmartExchange.json'); * @param {Function} callback, callback */ var transfer = function (eth, from, to, value, callback) { - var iban = new Iban(to); + var iban = new Iban(to); if (!iban.isValid()) { throw new Error('invalid iban address'); } @@ -6544,7 +6544,7 @@ var transfer = function (eth, from, to, value, callback) { if (iban.isDirect()) { return transferToAddress(eth, from, iban.address(), value, callback); } - + if (!callback) { var address = eth.icapNamereg().addr(iban.institution()); return deposit(eth, from, address, value, iban.client()); @@ -6553,7 +6553,7 @@ var transfer = function (eth, from, to, value, callback) { eth.icapNamereg().addr(iban.institution(), function (err, address) { return deposit(eth, from, address, value, iban.client(), callback); }); - + }; /** diff --git a/les/backend.go b/les/backend.go index 4c33417c03..e21ee899af 100644 --- a/les/backend.go +++ b/les/backend.go @@ -137,11 +137,6 @@ func (s *LightDummyAPI) Etherbase() (common.Address, error) { return common.Address{}, fmt.Errorf("not supported") } -// Coinbase is the address that mining rewards will be send to (alias for Etherbase) -func (s *LightDummyAPI) Coinbase() (common.Address, error) { - return common.Address{}, fmt.Errorf("not supported") -} - // Hashrate returns the POW hashrate func (s *LightDummyAPI) Hashrate() hexutil.Uint { return 0 diff --git a/les/helper_test.go b/les/helper_test.go index b33454e1d0..e139b610be 100644 --- a/les/helper_test.go +++ b/les/helper_test.go @@ -98,7 +98,7 @@ func testChainGen(i int, block *core.BlockGen) { block.AddTx(tx3) case 2: // Block 3 is empty but was mined by account #2. - block.SetCoinbase(acc2Addr) + block.SetEtherbase(acc2Addr) block.SetExtra([]byte("yeehaw")) data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001") tx, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data), signer, testBankKey) diff --git a/light/lightchain_test.go b/light/lightchain_test.go index 40a4d396a8..247efbac75 100644 --- a/light/lightchain_test.go +++ b/light/lightchain_test.go @@ -38,7 +38,7 @@ var ( // makeHeaderChain creates a deterministic chain of headers rooted at parent. func makeHeaderChain(parent *types.Header, n int, db ethdb.Database, seed int) []*types.Header { blocks, _ := core.GenerateChain(params.TestChainConfig, types.NewBlockWithHeader(parent), db, n, func(i int, b *core.BlockGen) { - b.SetCoinbase(common.Address{0: byte(seed), 19: byte(i)}) + b.SetEtherbase(common.Address{0: byte(seed), 19: byte(i)}) }) headers := make([]*types.Header, len(blocks)) for i, block := range blocks { @@ -245,7 +245,7 @@ func makeHeaderChainWithDiff(genesis *types.Block, d []int, seed byte) []*types. var chain []*types.Header for i, difficulty := range d { header := &types.Header{ - Coinbase: common.Address{seed}, + Etherbase: common.Address{seed}, Number: big.NewInt(int64(i + 1)), Difficulty: big.NewInt(int64(difficulty)), UncleHash: types.EmptyUncleHash, diff --git a/light/odr_test.go b/light/odr_test.go index c0c5438fdb..5cfaab25e7 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -211,7 +211,7 @@ func testChainGen(i int, block *core.BlockGen) { block.AddTx(tx3) case 2: // Block 3 is empty but was mined by account #2. - block.SetCoinbase(acc2Addr) + block.SetEtherbase(acc2Addr) block.SetExtra([]byte("yeehaw")) data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001") tx, _ := types.SignTx(types.NewTransaction(block.TxNonce(testBankAddress), testContractAddr, big.NewInt(0), big.NewInt(100000), nil, data), signer, testBankKey) diff --git a/miner/miner.go b/miner/miner.go index fec0a40f5a..6e89b0d614 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -48,10 +48,10 @@ type Miner struct { worker *worker - coinbase common.Address - mining int32 - eth Backend - engine consensus.Engine + etherbase common.Address + mining int32 + eth Backend + engine consensus.Engine canStart int32 // can start indicates whether we can start the mining operation shouldStart int32 // should start indicates whether we should start after sync @@ -93,7 +93,7 @@ out: atomic.StoreInt32(&self.canStart, 1) atomic.StoreInt32(&self.shouldStart, 0) if shouldStart { - self.Start(self.coinbase) + self.Start(self.etherbase) } // unsubscribe. we're only interested in this event once events.Unsubscribe() @@ -103,10 +103,10 @@ out: } } -func (self *Miner) Start(coinbase common.Address) { +func (self *Miner) Start(etherbase common.Address) { atomic.StoreInt32(&self.shouldStart, 1) - self.worker.setEtherbase(coinbase) - self.coinbase = coinbase + self.worker.setEtherbase(etherbase) + self.etherbase = etherbase if atomic.LoadInt32(&self.canStart) == 0 { log.Info("Network syncing, will start miner afterwards") @@ -178,6 +178,6 @@ func (self *Miner) PendingBlock() *types.Block { } func (self *Miner) SetEtherbase(addr common.Address) { - self.coinbase = addr + self.etherbase = addr self.worker.setEtherbase(addr) } diff --git a/miner/worker.go b/miner/worker.go index bf24970f5c..98b4302eb2 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -111,8 +111,8 @@ type worker struct { proc core.Validator chainDb ethdb.Database - coinbase common.Address - extra []byte + etherbase common.Address + extra []byte currentMu sync.Mutex current *Work @@ -127,7 +127,7 @@ type worker struct { atWork int32 } -func newWorker(config *params.ChainConfig, engine consensus.Engine, coinbase common.Address, eth Backend, mux *event.TypeMux) *worker { +func newWorker(config *params.ChainConfig, engine consensus.Engine, etherbase common.Address, eth Backend, mux *event.TypeMux) *worker { worker := &worker{ config: config, engine: engine, @@ -141,7 +141,7 @@ func newWorker(config *params.ChainConfig, engine consensus.Engine, coinbase com chain: eth.BlockChain(), proc: eth.BlockChain().Validator(), possibleUncles: make(map[common.Hash]*types.Block), - coinbase: coinbase, + etherbase: etherbase, agents: make(map[Agent]struct{}), unconfirmed: newUnconfirmedBlocks(eth.BlockChain(), miningLogAtDepth), } @@ -161,7 +161,7 @@ func newWorker(config *params.ChainConfig, engine consensus.Engine, coinbase com func (self *worker) setEtherbase(addr common.Address) { self.mu.Lock() defer self.mu.Unlock() - self.coinbase = addr + self.etherbase = addr } func (self *worker) setExtra(extra []byte) { @@ -267,7 +267,7 @@ func (self *worker) update() { txs := map[common.Address]types.Transactions{acc: {ev.Tx}} txset := types.NewTransactionsByPriceAndNonce(self.current.signer, txs) - self.current.commitTransactions(self.mux, txset, self.chain, self.coinbase) + self.current.commitTransactions(self.mux, txset, self.chain, self.etherbase) self.currentMu.Unlock() } @@ -412,9 +412,9 @@ func (self *worker) commitNewWork() { Extra: self.extra, Time: big.NewInt(tstamp), } - // Only set the coinbase if we are mining (avoid spurious block rewards) + // Only set the etherbase if we are mining (avoid spurious block rewards) if atomic.LoadInt32(&self.mining) == 1 { - header.Coinbase = self.coinbase + header.Etherbase = self.etherbase } if err := self.engine.Prepare(self.chain, header); err != nil { log.Error("Failed to prepare header for mining", "err", err) @@ -450,7 +450,7 @@ func (self *worker) commitNewWork() { return } txs := types.NewTransactionsByPriceAndNonce(self.current.signer, pending) - work.commitTransactions(self.mux, txs, self.chain, self.coinbase) + work.commitTransactions(self.mux, txs, self.chain, self.etherbase) // compute uncles for the new block. var ( @@ -502,7 +502,7 @@ func (self *worker) commitUncle(work *Work, uncle *types.Header) error { return nil } -func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsByPriceAndNonce, bc *core.BlockChain, coinbase common.Address) { +func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsByPriceAndNonce, bc *core.BlockChain, etherbase common.Address) { gp := new(core.GasPool).AddGas(env.header.GasLimit) var coalescedLogs []*types.Log @@ -529,7 +529,7 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB // Start executing the transaction env.state.Prepare(tx.Hash(), common.Hash{}, env.tcount) - err, logs := env.commitTransaction(tx, bc, coinbase, gp) + err, logs := env.commitTransaction(tx, bc, etherbase, gp) switch err { case core.ErrGasLimitReached: // Pop the current out-of-gas transaction without shifting in the next from the account @@ -580,10 +580,10 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB } } -func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, coinbase common.Address, gp *core.GasPool) (error, []*types.Log) { +func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, etherbase common.Address, gp *core.GasPool) (error, []*types.Log) { snap := env.state.Snapshot() - receipt, _, err := core.ApplyTransaction(env.config, bc, &coinbase, gp, env.state, env.header, tx, env.header.GasUsed, vm.Config{}) + receipt, _, err := core.ApplyTransaction(env.config, bc, ðerbase, gp, env.state, env.header, tx, env.header.GasUsed, vm.Config{}) if err != nil { env.state.RevertToSnapshot(snap) return err, nil diff --git a/mobile/types.go b/mobile/types.go index 088c7c6b33..147b625c03 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -105,7 +105,7 @@ func (h *Header) String() string { func (h *Header) GetParentHash() *Hash { return &Hash{h.header.ParentHash} } func (h *Header) GetUncleHash() *Hash { return &Hash{h.header.UncleHash} } -func (h *Header) GetCoinbase() *Address { return &Address{h.header.Coinbase} } +func (h *Header) GetEtherbase() *Address { return &Address{h.header.Etherbase} } func (h *Header) GetRoot() *Hash { return &Hash{h.header.Root} } func (h *Header) GetTxHash() *Hash { return &Hash{h.header.TxHash} } func (h *Header) GetReceiptHash() *Hash { return &Hash{h.header.ReceiptHash} } @@ -182,7 +182,7 @@ func (b *Block) String() string { func (b *Block) GetParentHash() *Hash { return &Hash{b.block.ParentHash()} } func (b *Block) GetUncleHash() *Hash { return &Hash{b.block.UncleHash()} } -func (b *Block) GetCoinbase() *Address { return &Address{b.block.Coinbase()} } +func (b *Block) GetEtherbase() *Address { return &Address{b.block.Etherbase()} } func (b *Block) GetRoot() *Hash { return &Hash{b.block.Root()} } func (b *Block) GetTxHash() *Hash { return &Hash{b.block.TxHash()} } func (b *Block) GetReceiptHash() *Hash { return &Hash{b.block.ReceiptHash()} } diff --git a/tests/block_test_util.go b/tests/block_test_util.go index a789e6d887..759ec1f02c 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -65,7 +65,7 @@ type btBlock struct { type btHeader struct { Bloom types.Bloom - Coinbase common.Address + Etherbase common.Address MixHash common.Hash Nonce types.BlockNonce Number *big.Int @@ -145,7 +145,7 @@ func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis { GasUsed: t.json.Genesis.GasUsed.Uint64(), Difficulty: t.json.Genesis.Difficulty, Mixhash: t.json.Genesis.MixHash, - Coinbase: t.json.Genesis.Coinbase, + Etherbase: t.json.Genesis.Etherbase, Alloc: t.json.Pre, } } @@ -201,8 +201,8 @@ func validateHeader(h *btHeader, h2 *types.Header) error { if h.Bloom != h2.Bloom { return fmt.Errorf("Bloom: want: %x have: %x", h.Bloom, h2.Bloom) } - if h.Coinbase != h2.Coinbase { - return fmt.Errorf("Coinbase: want: %x have: %x", h.Coinbase, h2.Coinbase) + if h.Etherbase != h2.Etherbase { + return fmt.Errorf("Etherbase: want: %x have: %x", h.Etherbase, h2.Etherbase) } if h.MixHash != h2.MixDigest { return fmt.Errorf("MixHash: want: %x have: %x", h.MixHash, h2.MixDigest) diff --git a/tests/gen_btheader.go b/tests/gen_btheader.go index 5d65e0dbce..1c170a2a66 100644 --- a/tests/gen_btheader.go +++ b/tests/gen_btheader.go @@ -17,7 +17,7 @@ var _ = (*btHeaderMarshaling)(nil) func (b btHeader) MarshalJSON() ([]byte, error) { type btHeader struct { Bloom types.Bloom - Coinbase common.Address + Etherbase common.Address MixHash common.Hash Nonce types.BlockNonce Number *math.HexOrDecimal256 @@ -35,7 +35,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) { } var enc btHeader enc.Bloom = b.Bloom - enc.Coinbase = b.Coinbase + enc.Etherbase = b.Etherbase enc.MixHash = b.MixHash enc.Nonce = b.Nonce enc.Number = (*math.HexOrDecimal256)(b.Number) @@ -56,7 +56,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) { func (b *btHeader) UnmarshalJSON(input []byte) error { type btHeader struct { Bloom *types.Bloom - Coinbase *common.Address + Etherbase *common.Address MixHash *common.Hash Nonce *types.BlockNonce Number *math.HexOrDecimal256 @@ -79,8 +79,8 @@ func (b *btHeader) UnmarshalJSON(input []byte) error { if dec.Bloom != nil { b.Bloom = *dec.Bloom } - if dec.Coinbase != nil { - b.Coinbase = *dec.Coinbase + if dec.Etherbase != nil { + b.Etherbase = *dec.Etherbase } if dec.MixHash != nil { b.MixHash = *dec.MixHash diff --git a/tests/gen_stenv.go b/tests/gen_stenv.go index c780524bc3..02772186b2 100644 --- a/tests/gen_stenv.go +++ b/tests/gen_stenv.go @@ -15,14 +15,14 @@ var _ = (*stEnvMarshaling)(nil) func (s stEnv) MarshalJSON() ([]byte, error) { type stEnv struct { - Coinbase common.UnprefixedAddress `json:"currentCoinbase" gencodec:"required"` + Etherbase common.UnprefixedAddress `json:"currentCoinbase" gencodec:"required"` Difficulty *math.HexOrDecimal256 `json:"currentDifficulty" gencodec:"required"` GasLimit *math.HexOrDecimal256 `json:"currentGasLimit" gencodec:"required"` Number math.HexOrDecimal64 `json:"currentNumber" gencodec:"required"` Timestamp math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"` } var enc stEnv - enc.Coinbase = common.UnprefixedAddress(s.Coinbase) + enc.Etherbase = common.UnprefixedAddress(s.Etherbase) enc.Difficulty = (*math.HexOrDecimal256)(s.Difficulty) enc.GasLimit = (*math.HexOrDecimal256)(s.GasLimit) enc.Number = math.HexOrDecimal64(s.Number) @@ -32,7 +32,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) { func (s *stEnv) UnmarshalJSON(input []byte) error { type stEnv struct { - Coinbase *common.UnprefixedAddress `json:"currentCoinbase" gencodec:"required"` + Etherbase *common.UnprefixedAddress `json:"currentCoinbase" gencodec:"required"` Difficulty *math.HexOrDecimal256 `json:"currentDifficulty" gencodec:"required"` GasLimit *math.HexOrDecimal256 `json:"currentGasLimit" gencodec:"required"` Number *math.HexOrDecimal64 `json:"currentNumber" gencodec:"required"` @@ -42,10 +42,10 @@ func (s *stEnv) UnmarshalJSON(input []byte) error { if err := json.Unmarshal(input, &dec); err != nil { return err } - if dec.Coinbase == nil { + if dec.Etherbase == nil { return errors.New("missing required field 'currentCoinbase' for stEnv") } - s.Coinbase = common.Address(*dec.Coinbase) + s.Etherbase = common.Address(*dec.Etherbase) if dec.Difficulty == nil { return errors.New("missing required field 'currentDifficulty' for stEnv") } diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 64bf09cb42..141e385ca6 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -74,7 +74,7 @@ type stPostState struct { //go:generate gencodec -type stEnv -field-override stEnvMarshaling -out gen_stenv.go type stEnv struct { - Coinbase common.Address `json:"currentCoinbase" gencodec:"required"` + Etherbase common.Address `json:"currentCoinbase" gencodec:"required"` Difficulty *big.Int `json:"currentDifficulty" gencodec:"required"` GasLimit *big.Int `json:"currentGasLimit" gencodec:"required"` Number uint64 `json:"currentNumber" gencodec:"required"` @@ -82,7 +82,7 @@ type stEnv struct { } type stEnvMarshaling struct { - Coinbase common.UnprefixedAddress + Etherbase common.UnprefixedAddress Difficulty *math.HexOrDecimal256 GasLimit *math.HexOrDecimal256 Number math.HexOrDecimal64 @@ -134,7 +134,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD if err != nil { return nil, err } - context := core.NewEVMContext(msg, block.Header(), nil, &t.json.Env.Coinbase) + context := core.NewEVMContext(msg, block.Header(), nil, &t.json.Env.Etherbase) context.GetHash = vmTestBlockHash evm := vm.NewEVM(context, statedb, config, vmconfig) @@ -178,7 +178,7 @@ func makePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB func (t *StateTest) genesis(config *params.ChainConfig) *core.Genesis { return &core.Genesis{ Config: config, - Coinbase: t.json.Env.Coinbase, + Etherbase: t.json.Env.Etherbase, Difficulty: t.json.Env.Difficulty, GasLimit: t.json.Env.GasLimit.Uint64(), Number: t.json.Env.Number, diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go index 0aa37955ce..268b56b2d6 100644 --- a/tests/vm_test_util.go +++ b/tests/vm_test_util.go @@ -136,7 +136,7 @@ func (t *VMTest) newEVM(statedb *state.StateDB, vmconfig vm.Config) *vm.EVM { Transfer: transfer, GetHash: vmTestBlockHash, Origin: t.json.Exec.Origin, - Coinbase: t.json.Env.Coinbase, + Etherbase: t.json.Env.Etherbase, BlockNumber: new(big.Int).SetUint64(t.json.Env.Number), Time: new(big.Int).SetUint64(t.json.Env.Timestamp), GasLimit: t.json.Env.GasLimit,