forked from TrueCloudLab/neoneo-go
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.
|
||||
func GasLeft(_ *interop.Context, v *vm.VM) error {
|
||||
v.Estack().PushVal(v.GasLimit - v.GasConsumed())
|
||||
if v.GasLimit == -1 {
|
||||
v.Estack().PushVal(v.GasLimit)
|
||||
} else {
|
||||
v.Estack().PushVal(v.GasLimit - v.GasConsumed())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue