neo-go/pkg/core/native
Ekaterina Pavlova 02727b14b7 vm: fix unclaimedGas calculation
Fix difference with C#:
```
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST
http://seed1t5.neo.org:20332 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "method": "getapplicationlog",
  "params":
  ["61681ce24dffea5481e9a50b10159b43b7ebfc21967b0b06fee7ff69c7123e3f"],
  "id": 1
}' | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time
  Current
                                 Dload  Upload   Total   Spent    Left
                                 Speed
100   429    0   269  100   160    582    346 --:--:-- --:--:-- --:--:--
   930
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "executions" : [
         {
            "exception" : null,
            "gasconsumed" : "198754",
            "notifications" : [],
            "stack" : [
               {
                  "type" : "Integer",
                  "value" : "0"
               }
            ],
            "trigger" : "Application",
            "vmstate" : "HALT"
         }
      ],
      "txid" :
      "0x61681ce24dffea5481e9a50b10159b43b7ebfc21967b0b06fee7ff69c7123e3
      f"
   }
}
```
(base) ekaterinapavlova@MacBook-Air-4 neo-go % curl -X POST  https://rpc
.t5.n3.nspcc.ru:20331 -H 'Content-Type: application/json' -d '{
  "jsonrpc": "2.0",
  "method": "getapplicationlog",
  "params":
  ["61681ce24dffea5481e9a50b10159b43b7ebfc21967b0b06fee7ff69c7123e3f"],
  "id": 1
}' | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time
  Current
                                 Dload  Upload   Total   Spent    Left
                                 Speed
100   583  100   423  100   160   1424    538 --:--:-- --:--:-- --:--:--
  1969
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "executions" : [
         {
            "exception" : "at instruction 120 (SYSCALL): can't calculate
             bonus of height unequal (BlockHeight + 1)",
            "gasconsumed" : "198754",
            "notifications" : [],
            "stack" : [
               {
                  "type" : "Integer",
                  "value" : "4704605"
               },
               {
                  "type" : "ByteString",
                  "value" : "KfYYlDe/fxqqqm1yr7o5XLnQ7uk="
               }
            ],
            "trigger" : "Application",
            "vmstate" : "FAULT"
         }
      ],
      "txid" :
      "0x61681ce24dffea5481e9a50b10159b43b7ebfc21967b0b06fee7ff69c7123e3
      f"
   }
}

```
```
(base) ekaterinapavlova@MacBook-Air-4 neo-go % ./bin/neo-go contract
invokefunction -r https://rpc.t5.n3.nspcc.ru:20331 -w ./testnet_wallet
.json 1e6f88377a6c6bc4f683a5fc61eed5645ec5f123 unclaimedGas
e9eed0b95c39baaf726daaaa1a7fbf379418f629 4704605
Enter account NWtk9HYWsf1njtSzA3XNgwZXRtriACcJ9G password >
Warning: FAULT VM state returned from the RPC node: at instruction 120
(SYSCALL): can't calculate bonus of height unequal (BlockHeight + 1).
Use --force flag to send the transaction anyway.
```

Close #3589

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-10-04 16:55:12 +03:00
..
native_test vm: fix unclaimedGas calculation 2024-10-04 16:55:12 +03:00
nativehashes native: autogenerate nativehashes package 2024-05-14 09:39:53 +03:00
nativenames core: add nativenames.All list 2024-04-25 13:26:54 +03:00
nativeprices core: move NotaryVerificationPrice to a separate package 2021-03-23 13:56:39 +03:00
noderoles *: introduce Genesis protocol configuration 2023-10-19 18:30:20 +03:00
compatibility_test.go *: improve for loop syntax 2024-08-30 21:45:18 +03:00
contract.go core: move P2PNotary node role out of P2PSigExtensions 2024-05-21 12:10:47 +03:00
contract_test.go native: implement HF-based update 2024-04-25 13:16:42 +03:00
crypto.go *: return errors.ErrUnsupported where appropriate 2024-08-27 12:51:12 +03:00
crypto_blspoints.go native: fix error message on unexpected BLS12-381 curve point 2023-10-05 13:46:05 +03:00
crypto_test.go native: adjust NamedCurveHash values 2024-05-13 10:10:56 +03:00
designate.go *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
interop.go native: implement HF-based update 2024-04-25 13:16:42 +03:00
invocation_test.go *: move NativeUpdateHistory logic under Hardforks management 2023-11-21 14:05:28 +03:00
ledger.go native: make Oracle service handle native Oracle updates 2024-04-25 13:26:54 +03:00
management.go *: fix linter issues 2024-08-14 12:36:15 +03:00
management_neotest_test.go neotest: calculate system fee for deployment transactions 2024-08-09 11:55:22 +03:00
management_test.go native: make Oracle service handle native Oracle updates 2024-04-25 13:26:54 +03:00
native_gas.go native: make Oracle service handle native Oracle updates 2024-04-25 13:26:54 +03:00
native_neo.go vm: fix unclaimedGas calculation 2024-10-04 16:55:12 +03:00
native_neo_candidate.go [#2442] English Check 2022-05-04 19:48:27 +03:00
native_neo_test.go stackitem: introduce Convertible interface 2021-07-19 15:42:42 +03:00
native_nep17.go native: support native method/event removal 2024-05-17 15:22:26 +03:00
nativenames_test.go [#2442] English Check 2022-05-04 19:48:27 +03:00
neo_types.go native: add committee change events 2024-03-19 23:00:06 +03:00
notary.go native: make Oracle service handle native Oracle updates 2024-04-25 13:26:54 +03:00
oracle.go native: make Oracle service handle native Oracle updates 2024-04-25 13:26:54 +03:00
oracle_types.go [#2442] English Check 2022-05-04 19:48:27 +03:00
oracle_types_test.go *: replace interface{} with any keyword 2023-04-04 13:22:42 +03:00
policy.go *: use slices package for sorting and searching 2024-08-27 12:29:44 +03:00
policy_test.go core: move Policy contract tests to native 2022-06-08 22:44:25 +03:00
std.go *: drop pkg/util/slice, use slices.Reverse 2024-08-24 22:41:48 +03:00
std_test.go core, interop: add strLen method for native StdLib contract 2023-11-20 19:23:33 +03:00
util.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00