mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-02 19:40:34 +00:00
core: adjust System.Runtime.GasLeft interop
Part of #1055. In test mode it should return -1.
This commit is contained in:
parent
8fed383523
commit
990ef5525c
1 changed files with 5 additions and 1 deletions
|
@ -11,7 +11,11 @@ import (
|
||||||
|
|
||||||
// GasLeft returns remaining amount of GAS.
|
// GasLeft returns remaining amount of GAS.
|
||||||
func GasLeft(_ *interop.Context, v *vm.VM) error {
|
func GasLeft(_ *interop.Context, v *vm.VM) error {
|
||||||
|
if v.GasLimit == -1 {
|
||||||
|
v.Estack().PushVal(v.GasLimit)
|
||||||
|
} else {
|
||||||
v.Estack().PushVal(v.GasLimit - v.GasConsumed())
|
v.Estack().PushVal(v.GasLimit - v.GasConsumed())
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue