Commit graph

23 commits

Author SHA1 Message Date
Anna Shaleva
33c971b0e4 core: add InitializeCache method to Contract interface
Make the contracts cache initialization unified. The order of cache
iniitialization is not important and Nottary contract is added to the
bc.contracts.Contracts wrt P2PSigExtensions setting, thus no functional
changes, just refactoring for future applications.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-04-26 12:57:48 +03:00
Roman Khimov
0ad6e295ea core: make GetHeaderHash accept uint32
It should've always been this way because block indexes are uint32.
2022-11-25 14:30:51 +03:00
Roman Khimov
fab8dfb9f8 vm: move State type into a package of its own
It's used a lot in other places that need it, but don't need whole VM at the
same time.
2022-07-08 18:34:52 +03:00
Roman Khimov
d70caf1da1 core: move GetScriptContainer to runtime
It also brings ToStackItem to Block and Transaction, previously this was
avoided to separate block and transaction packages from VM. But turns out
`transaction` depends on `stackitem` already, so this makes little sense (but
can be shuffled in another way if needed).

Context.Container is still a hash.Hashable because we have a number of
occasions (header or MPT root verification) where there is no ToStackItem
implementation possible. Maybe they can go with `nil` Container, but I don't
want to have this risk for now.
2022-06-08 18:12:41 +03:00
Anna Shaleva
d8f7d5d5b6 core: adjust Signer to stackitem conversion
Follow the https://github.com/neo-project/neo/pull/2708.
2022-05-23 14:01:42 +03:00
Elizaveta Chichindaeva
28908aa3cf [#2442] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-04 19:48:27 +03:00
Anna Shaleva
473955c2d6 core: use proper current block height/hash for interop API 2022-04-29 18:00:46 +03:00
Anna Shaleva
47d52bd9c5 core: add getTransactionSigners method to native Ledger 2022-04-29 11:18:58 +03:00
Anna Shaleva
b431e47d2a core: add GetTransactionVMState to native Ledger contract
Close #2343.
2022-04-05 10:37:02 +03:00
Anna Shaleva
9a41356a3b core: add getUint256FromItem helper to native ledger 2022-04-04 12:33:29 +03:00
Roman Khimov
aefb26255a dao: drop DAO interface
It's a remnant from the days when we had Simple and Cached DAO
implementations, now it makes zero sense.
2022-02-16 18:24:20 +03:00
Roman Khimov
ab2e60458d interop: drop blockchainer dependency
Use local interface.
2022-01-14 19:57:16 +03:00
Roman Khimov
3cebd2b129 interop: use non-Cached wrapped DAO
Cached only caches NEP-17 tracking data now, it makes no sense here.
2021-07-30 15:45:17 +03:00
Roman Khimov
f4a9139a05
Merge pull request #2071 from nspcc-dev/fix-more-vm-bugs
Fix more VM bugs
2021-07-19 22:00:17 +03:00
Roman Khimov
5f13de3a76 *: simplify some integer checks with IsUint64()
If we need a positive number we can do `IsUint64()` instead of checking that
`Int64()` is `> 0`.
2021-07-19 15:42:42 +03:00
Evgeniy Stratonikov
3a4e0caeb8 core/block: add Nonce field to header
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-07-15 15:58:49 +03:00
Roman Khimov
9d2712573f *: enable godot linter and fix all its warnings
It's important for NeoGo to have clean documentation. No functional changes.
2021-05-12 23:17:03 +03:00
Roman Khimov
cfc067dd24 *: remove dead code
Found by deadcode via golangci-lint.
2021-05-12 18:13:14 +03:00
Evgeniy Stratonikov
3278d23852 native: rename Price to CPUFee
Method price is now multiplied by `BaseExecFee`.
2021-03-11 10:12:30 +03:00
Evgeniy Stratonikov
100f2db3fb native: implement CryptoLib contract 2021-03-10 19:24:19 +03:00
Evgeniy Stratonikov
f9f1fe03b2 core: refactor native call
1. `System.Contract.CallNative` expects version on stack.
2. Actual method is determined based on current
   instruction pointer.
3. Native hashes don't longer depend on NEF checksum.
2021-02-26 10:59:09 +03:00
Anna Shaleva
99f58d9cd5 core: fix native Ladger parameter type
Affects dumps.
2021-02-12 18:58:31 +03:00
Roman Khimov
ac527650eb native: add Ledger contract, fix #1696
But don't change the way we process/store transactions and blocks. Effectively
it's just an interface for smart contracts that replaces old syscalls.

Transaction definition is moved temporarily to runtime package and Block
definition is removed (till we solve #1691 properly).
2021-02-04 13:12:11 +03:00