Skip to content

Commit f298ffd

Browse files
committed
Renamed State => StateDB
1 parent 3664cd5 commit f298ffd

18 files changed

Lines changed: 73 additions & 73 deletions

‎cmd/mist/debugger.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type DebuggerWindow struct {
4040
vm *vm.DebugVm
4141
Db *Debugger
4242

43-
state *state.State
43+
state *state.StateDB
4444
}
4545

4646
func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {

‎cmd/utils/vm_env.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
type VMEnv struct {
13-
state *state.State
13+
state *state.StateDB
1414
block *types.Block
1515

1616
transactor []byte
@@ -20,7 +20,7 @@ type VMEnv struct {
2020
Gas *big.Int
2121
}
2222

23-
func NewEnv(state *state.State, block *types.Block, transactor []byte, value *big.Int) *VMEnv {
23+
func NewEnv(state *state.StateDB, block *types.Block, transactor []byte, value *big.Int) *VMEnv {
2424
return &VMEnv{
2525
state: state,
2626
block: block,
@@ -37,7 +37,7 @@ func (self *VMEnv) Time() int64 { return self.block.Time }
3737
func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
3838
func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
3939
func (self *VMEnv) Value() *big.Int { return self.value }
40-
func (self *VMEnv) State() *state.State { return self.state }
40+
func (self *VMEnv) State() *state.StateDB { return self.state }
4141
func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
4242
func (self *VMEnv) Depth() int { return self.depth }
4343
func (self *VMEnv) SetDepth(i int) { self.depth = i }

‎core/block_manager.go‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ type BlockManager struct {
6262
// Transiently state. The trans state isn't ever saved, validated and
6363
// it could be used for setting account nonces without effecting
6464
// the main states.
65-
transState *state.State
65+
transState *state.StateDB
6666
// Mining state. The mining state is used purely and solely by the mining
6767
// operation.
68-
miningState *state.State
68+
miningState *state.StateDB
6969

7070
// The last attempted block is mainly used for debugging purposes
7171
// This does not have to be a valid block and will be set during
@@ -96,19 +96,19 @@ func (self *BlockManager) Stop() {
9696
statelogger.Debugln("Stopping state manager")
9797
}
9898

99-
func (sm *BlockManager) CurrentState() *state.State {
99+
func (sm *BlockManager) CurrentState() *state.StateDB {
100100
return sm.eth.ChainManager().CurrentBlock.State()
101101
}
102102

103-
func (sm *BlockManager) TransState() *state.State {
103+
func (sm *BlockManager) TransState() *state.StateDB {
104104
return sm.transState
105105
}
106106

107-
func (sm *BlockManager) MiningState() *state.State {
107+
func (sm *BlockManager) MiningState() *state.StateDB {
108108
return sm.miningState
109109
}
110110

111-
func (sm *BlockManager) NewMiningState() *state.State {
111+
func (sm *BlockManager) NewMiningState() *state.StateDB {
112112
sm.miningState = sm.eth.ChainManager().CurrentBlock.State().Copy()
113113

114114
return sm.miningState
@@ -118,7 +118,7 @@ func (sm *BlockManager) ChainManager() *ChainManager {
118118
return sm.bc
119119
}
120120

121-
func (sm *BlockManager) TransitionState(statedb *state.State, parent, block *types.Block) (receipts types.Receipts, err error) {
121+
func (sm *BlockManager) TransitionState(statedb *state.StateDB, parent, block *types.Block) (receipts types.Receipts, err error) {
122122
coinbase := statedb.GetOrNewStateObject(block.Coinbase)
123123
coinbase.SetGasPool(block.CalcGasLimit(parent))
124124

@@ -131,7 +131,7 @@ func (sm *BlockManager) TransitionState(statedb *state.State, parent, block *typ
131131
return receipts, nil
132132
}
133133

134-
func (self *BlockManager) ProcessTransactions(coinbase *state.StateObject, state *state.State, block, parent *types.Block, txs types.Transactions) (types.Receipts, types.Transactions, types.Transactions, types.Transactions, error) {
134+
func (self *BlockManager) ProcessTransactions(coinbase *state.StateObject, state *state.StateDB, block, parent *types.Block, txs types.Transactions) (types.Receipts, types.Transactions, types.Transactions, types.Transactions, error) {
135135
var (
136136
receipts types.Receipts
137137
handled, unhandled types.Transactions
@@ -342,7 +342,7 @@ func (sm *BlockManager) ValidateBlock(block, parent *types.Block) error {
342342
return nil
343343
}
344344

345-
func (sm *BlockManager) AccumelateRewards(statedb *state.State, block, parent *types.Block) error {
345+
func (sm *BlockManager) AccumelateRewards(statedb *state.StateDB, block, parent *types.Block) error {
346346
reward := new(big.Int).Set(BlockReward)
347347

348348
knownUncles := ethutil.Set(parent.Uncles)

‎core/state_transition.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ type StateTransition struct {
3131
gas, gasPrice *big.Int
3232
value *big.Int
3333
data []byte
34-
state *state.State
34+
state *state.StateDB
3535
block *types.Block
3636

3737
cb, rec, sen *state.StateObject
3838
}
3939

40-
func NewStateTransition(coinbase *state.StateObject, tx *types.Transaction, state *state.State, block *types.Block) *StateTransition {
40+
func NewStateTransition(coinbase *state.StateObject, tx *types.Transaction, state *state.StateDB, block *types.Block) *StateTransition {
4141
return &StateTransition{coinbase.Address(), tx.Recipient, tx, new(big.Int), new(big.Int).Set(tx.GasPrice), tx.Value, tx.Data, state, block, coinbase, nil, nil}
4242
}
4343

@@ -188,7 +188,7 @@ func (self *StateTransition) TransitionState() (err error) {
188188
}
189189

190190
// Converts an transaction in to a state object
191-
func MakeContract(tx *types.Transaction, state *state.State) *state.StateObject {
191+
func MakeContract(tx *types.Transaction, state *state.StateDB) *state.StateObject {
192192
addr := tx.CreationAddress(state)
193193

194194
contract := state.GetOrNewStateObject(addr)

‎core/transaction_pool.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (pool *TxPool) CurrentTransactions() []*types.Transaction {
186186
return txList
187187
}
188188

189-
func (pool *TxPool) RemoveInvalid(state *state.State) {
189+
func (pool *TxPool) RemoveInvalid(state *state.StateDB) {
190190
pool.mutex.Lock()
191191
defer pool.mutex.Unlock()
192192

‎core/types/block.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type Block struct {
7777
Coinbase []byte
7878
// Block Trie state
7979
//state *ethutil.Trie
80-
state *state.State
80+
state *state.StateDB
8181
// Difficulty for the current block
8282
Difficulty *big.Int
8383
// Creation time
@@ -151,7 +151,7 @@ func (block *Block) HashNoNonce() []byte {
151151
return crypto.Sha3(ethutil.Encode(block.miningHeader()))
152152
}
153153

154-
func (block *Block) State() *state.State {
154+
func (block *Block) State() *state.StateDB {
155155
return block.state
156156
}
157157

‎core/types/transaction.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (tx *Transaction) IsContract() bool {
7777
return tx.CreatesContract()
7878
}
7979

80-
func (tx *Transaction) CreationAddress(state *state.State) []byte {
80+
func (tx *Transaction) CreationAddress(state *state.StateDB) []byte {
8181
// Generate a new address
8282
return crypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:]
8383
}

‎core/vm_env.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99
)
1010

1111
type VMEnv struct {
12-
state *state.State
12+
state *state.StateDB
1313
block *types.Block
1414
tx *types.Transaction
1515
depth int
1616
}
1717

18-
func NewEnv(state *state.State, tx *types.Transaction, block *types.Block) *VMEnv {
18+
func NewEnv(state *state.StateDB, tx *types.Transaction, block *types.Block) *VMEnv {
1919
return &VMEnv{
2020
state: state,
2121
block: block,
@@ -31,7 +31,7 @@ func (self *VMEnv) Time() int64 { return self.block.Time }
3131
func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
3232
func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
3333
func (self *VMEnv) Value() *big.Int { return self.tx.Value }
34-
func (self *VMEnv) State() *state.State { return self.state }
34+
func (self *VMEnv) State() *state.StateDB { return self.state }
3535
func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
3636
func (self *VMEnv) Depth() int { return self.depth }
3737
func (self *VMEnv) SetDepth(i int) { self.depth = i }

‎javascript/javascript_runtime.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (self *JSRE) initStdFuncs() {
128128
*/
129129

130130
func (self *JSRE) dump(call otto.FunctionCall) otto.Value {
131-
var state *state.State
131+
var state *state.StateDB
132132

133133
if len(call.ArgumentList) > 0 {
134134
var block *types.Block

‎state/dump.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type World struct {
2020
Accounts map[string]Account `json:"accounts"`
2121
}
2222

23-
func (self *State) Dump() []byte {
23+
func (self *StateDB) Dump() []byte {
2424
world := World{
2525
Root: ethutil.Bytes2Hex(self.Trie.GetRoot()),
2626
Accounts: make(map[string]Account),

0 commit comments

Comments
 (0)