rpc: return amount of consumed GAS in invoke*

This commit is contained in:
Evgenii Stratonikov 2020-01-21 15:37:47 +03:00
parent 2f865480d3
commit 4718375db1
2 changed files with 2 additions and 1 deletions

View file

@ -1382,6 +1382,7 @@ func (bc *Blockchain) GetTestVM() (*vm.VM, storage.Store) {
tmpStore := storage.NewMemCachedStore(bc.dao.store)
systemInterop := bc.newInteropContext(trigger.Application, tmpStore, nil, nil)
vm := bc.spawnVMWithInterops(systemInterop)
vm.SetPriceGetter(getPrice)
return vm, tmpStore
}

View file

@ -400,7 +400,7 @@ func (s *Server) runScriptInVM(script []byte) *wrappers.InvokeResult {
_ = vm.Run()
result := &wrappers.InvokeResult{
State: vm.State(),
GasConsumed: "0.1",
GasConsumed: vm.GasConsumed().String(),
Script: hex.EncodeToString(script),
Stack: vm.Estack(),
}