diff options
author | Felix Lange <fjl@twurst.com> | 2015-09-02 18:55:11 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-10-17 16:24:34 +0800 |
commit | de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608 (patch) | |
tree | 59930f3d627940e1b73030ee2c5685104a04ee34 /core/state/errors.go | |
parent | 10ed107ba2001d1aabba3d319ba88c5ce6e8fdc0 (diff) | |
download | dexon-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.tar.gz dexon-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.tar.zst dexon-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.zip |
core, core/state: move gas tracking out of core/state
The amount of gas available for tx execution was tracked in the
StateObject representing the coinbase account. This commit makes the gas
counter a separate type in package core, which avoids unintended
consequences of intertwining the counter with state logic.
Diffstat (limited to 'core/state/errors.go')
-rw-r--r-- | core/state/errors.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/core/state/errors.go b/core/state/errors.go deleted file mode 100644 index a08ed2d23..000000000 --- a/core/state/errors.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014 The go-ethereum Authors -// This file is part of the go-ethereum library. -// -// The go-ethereum library is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// The go-ethereum library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. - -package state - -import ( - "fmt" - "math/big" -) - -type GasLimitErr struct { - Message string - Is, Max *big.Int -} - -func IsGasLimitErr(err error) bool { - _, ok := err.(*GasLimitErr) - - return ok -} -func (err *GasLimitErr) Error() string { - return err.Message -} -func GasLimitError(is, max *big.Int) *GasLimitErr { - return &GasLimitErr{Message: fmt.Sprintf("GasLimit error. Max %s, transaction would take it to %s", max, is), Is: is, Max: max} -} |