mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 01:41:48 +00:00
core,vm: implement System.Runtime.GasLeft syscall
This commit is contained in:
parent
a7d4fff897
commit
a4e4439967
5 changed files with 31 additions and 0 deletions
12
pkg/core/interop/runtime/util.go
Normal file
12
pkg/core/interop/runtime/util.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package runtime
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm"
|
||||
)
|
||||
|
||||
// GasLeft returns remaining amount of GAS.
|
||||
func GasLeft(_ *interop.Context, v *vm.VM) error {
|
||||
v.Estack().PushVal(int64(v.GasLimit - v.GasConsumed()))
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue