deprecate GAS_PRICE
This commit is contained in:
parent
532fa3e5ca
commit
7c953bb675
|
@ -11,8 +11,9 @@ var (
|
|||
|
||||
type Word [32]byte
|
||||
|
||||
func (w Word) Copy() Word { return w }
|
||||
func (w Word) Bytes() []byte { return w[:] } // copied.
|
||||
func (w Word) String() string { return string(w[:]) }
|
||||
func (w Word) Copy() Word { return w }
|
||||
func (w Word) Bytes() []byte { return w[:] } // copied.
|
||||
func (w Word) IsZero() bool {
|
||||
accum := byte(0)
|
||||
for _, byt := range w {
|
||||
|
|
|
@ -52,7 +52,7 @@ const (
|
|||
CALLDATACOPY
|
||||
CODESIZE
|
||||
CODECOPY
|
||||
GASPRICE
|
||||
GASPRICE_DEPRECATED
|
||||
EXTCODESIZE
|
||||
EXTCODECOPY
|
||||
)
|
||||
|
@ -204,17 +204,17 @@ var opCodeToString = map[OpCode]string{
|
|||
SHA3: "SHA3",
|
||||
|
||||
// 0x30 range - closure state
|
||||
ADDRESS: "ADDRESS",
|
||||
BALANCE: "BALANCE",
|
||||
ORIGIN: "ORIGIN",
|
||||
CALLER: "CALLER",
|
||||
CALLVALUE: "CALLVALUE",
|
||||
CALLDATALOAD: "CALLDATALOAD",
|
||||
CALLDATASIZE: "CALLDATASIZE",
|
||||
CALLDATACOPY: "CALLDATACOPY",
|
||||
CODESIZE: "CODESIZE",
|
||||
CODECOPY: "CODECOPY",
|
||||
GASPRICE: "TXGASPRICE",
|
||||
ADDRESS: "ADDRESS",
|
||||
BALANCE: "BALANCE",
|
||||
ORIGIN: "ORIGIN",
|
||||
CALLER: "CALLER",
|
||||
CALLVALUE: "CALLVALUE",
|
||||
CALLDATALOAD: "CALLDATALOAD",
|
||||
CALLDATASIZE: "CALLDATASIZE",
|
||||
CALLDATACOPY: "CALLDATACOPY",
|
||||
CODESIZE: "CODESIZE",
|
||||
CODECOPY: "CODECOPY",
|
||||
GASPRICE_DEPRECATED: "TXGASPRICE_DEPRECATED",
|
||||
|
||||
// 0x40 range - block operations
|
||||
BLOCKHASH: "BLOCKHASH",
|
||||
|
|
11
vm/vm.go
11
vm/vm.go
|
@ -41,7 +41,6 @@ type VMParams struct {
|
|||
BlockHash Word
|
||||
BlockTime int64
|
||||
GasLimit uint64
|
||||
GasPrice uint64
|
||||
CallStackLimit uint64
|
||||
Origin Word
|
||||
}
|
||||
|
@ -69,8 +68,8 @@ func NewVM(appState AppState, params VMParams) *VM {
|
|||
// When the function returns, *gas will be the amount of remaining gas.
|
||||
func (vm *VM) Call(caller, callee *Account, code, input []byte, value uint64, gas *uint64) (output []byte, err error) {
|
||||
|
||||
if len(callee.Code) == 0 {
|
||||
panic("Call() requires callee with code")
|
||||
if len(code) == 0 {
|
||||
panic("Call() requires code")
|
||||
}
|
||||
|
||||
fmt.Printf("(%d) (%X) %X (code=%d) gas: %v (d) %X\n", vm.callDepth, caller.Address[:4], callee.Address, len(callee.Code), *gas, input)
|
||||
|
@ -351,9 +350,9 @@ func (vm *VM) Call(caller, callee *Account, code, input []byte, value uint64, ga
|
|||
copy(dest, data)
|
||||
fmt.Printf(" => [%v, %v, %v] %X\n", memOff, codeOff, length, data)
|
||||
|
||||
case GASPRICE: // 0x3A
|
||||
stack.Push64(vm.params.GasPrice)
|
||||
fmt.Printf(" => %X\n", vm.params.GasPrice)
|
||||
case GASPRICE_DEPRECATED: // 0x3A
|
||||
stack.Push(Zero)
|
||||
fmt.Printf(" => %X (GASPRICE IS DEPRECATED)\n")
|
||||
|
||||
case EXTCODESIZE: // 0x3B
|
||||
addr := stack.Pop()
|
||||
|
|
Loading…
Reference in New Issue