Evgenii Stratonikov
82b230f19f
core: rename *block.Base.GetHashableData to GetSignedPart()
...
This allow to use `Block` as a Verifiable item.
When tx is provided, it is set as an interop's script container.
Otherwise, block is set.
2020-04-17 11:12:40 +03:00
Evgenii Stratonikov
a92872931c
interop/crypto: allow ECDsaVerify to verify ScriptContainer
...
When verifying transaction or block, verification script can be
a simple PUSHNULL + SYSCALL, which means that script-encontaining
entity should be verified.
2020-04-17 11:12:40 +03:00
Evgenii Stratonikov
8f08065a8e
interop/crypto: allow ECDsaVerify to accept interop items
...
When invokes with interop item on stack, it should check
for the signature of Verifiable item it contains.
2020-04-17 11:12:40 +03:00
Evgenii Stratonikov
2879f89337
crypto: declare Verifiable and ScriptContainer interfaces
2020-04-17 11:12:40 +03:00
Roman Khimov
266138c00c
Merge pull request #866 from nspcc-dev/drop-consensus-timestamp
...
consensus: drop timestamp from outer payload
2020-04-17 10:01:02 +03:00
Roman Khimov
c7ab99ddc1
consensus: drop timestamp from outer payload
...
It's not used really and NEO3 doesn't have it on the wire.
2020-04-17 00:09:40 +03:00
Roman Khimov
888be75445
Merge pull request #863 from nspcc-dev/drop-publish-tx
...
Drop publish tx
2020-04-16 21:23:37 +03:00
Roman Khimov
c7c788d10b
Merge pull request #781 from nspcc-dev/neo3/native
...
Implement Native contract mechanism
2020-04-16 18:41:13 +03:00
Roman Khimov
e150bd7bb0
Merge pull request #859 from nspcc-dev/neo3/partial_consensus_message_decoding
...
consensus: added partial message decoding
2020-04-16 16:58:59 +03:00
Evgenii Stratonikov
76700f31cf
core: implement skeletons for NEO/GAS native contracts
2020-04-16 15:55:35 +03:00
Evgenii Stratonikov
25354c44f9
core: implement NativeContract support
2020-04-16 15:55:34 +03:00
Evgenii Stratonikov
3831aec53f
vm: make NewBigInteger accept *big.Int
...
It creates big.Int internally anyway, so this is the most flexible way.
2020-04-16 15:54:58 +03:00
Evgenii Stratonikov
9586af32f2
core: move runtime.CheckWitness interop to a separate package
2020-04-16 15:54:58 +03:00
Evgenii Stratonikov
8a2130f5b6
core: extend Blockchainer with GetStandByValidators()
...
A list of standby validators can be needed in native contracts.
2020-04-16 15:54:58 +03:00
Evgenii Stratonikov
b446753c57
core,vm: move get/putContextScriptHash to vm
package
2020-04-16 15:54:52 +03:00
Roman Khimov
40991d3be3
transaction: drop AgencyType and VotingType
...
I have no idea what are they about.
2020-04-16 14:44:46 +03:00
Roman Khimov
4912e4f425
*: drop Publish transaction type
...
It shouldn't be used even in NEO 2 as it was substituted by contract
deployment interop functions.
2020-04-16 14:40:20 +03:00
Anna Shaleva
9dd5ab5e2b
consensus: added partial message decoding
...
closes #849
2020-04-16 14:35:58 +03:00
Evgenii Stratonikov
be407332b9
vm: add TryInteger() to StackItem interface
...
Conversion should be done in a StackItem, not in an Element.
2020-04-16 14:05:32 +03:00
Evgenii Stratonikov
dd38e3ec3b
smartcontract: add smartcontract manifest
...
Manifest contains all of smartcontract's metadata including
parameters, return value, permissions etc.
2020-04-16 14:05:32 +03:00
Roman Khimov
e29d881901
Merge pull request #856 from nspcc-dev/neo3/feature/valid_until_block
...
core: add validUntilBlock field to transaction
2020-04-15 16:24:07 +03:00
Anna Shaleva
70da3c86f1
rpc: fix typo
...
Fixed typo in annotation of CalculateInputs method of RPC Client.
2020-04-15 13:46:44 +03:00
Anna Shaleva
5fa11987d2
core: add validUntilBlock field to transaction
...
1. closes #841
2. Commented out test cases where binary transaction are used.
These test cases marked with `TODO NEO3.0: Update binary` and need to be
updated.
3. Updated other tests.
4. Added cache to calculateValidUntilBlock() RPC-client method.
2020-04-15 13:46:43 +03:00
Roman Khimov
1e3c36433f
Merge pull request #844 from nspcc-dev/neo3/nonce
...
core: add nonce field to transaction
2020-04-14 16:24:02 +03:00
Roman Khimov
804386fdb6
Merge pull request #854 from nspcc-dev/fix/coverage
...
.circleci: count coverage only for cli/ and pkg/
2020-04-14 16:23:07 +03:00
Roman Khimov
01e27535ae
Merge pull request #855 from nspcc-dev/fix/ecdsatest
...
core: fix typo in TestECDSAVerify
2020-04-14 16:22:06 +03:00
Anna Shaleva
65503aa9b4
core: add nonce field to transaction
...
1. Closes #840 : added Nonce field to transaction.Transaction and
removed Nonce field from transaction.MinerTx
2. Added following methods to different tx types:
- NewMinerTx()
- NewMinerTxWithNonce(...)
- NewEnrollmentTx(...)
- NewIssueTx()
- NewPublishTx(...)
- NewRegisterTx(...)
- NewStateTx(...)
in order to avoid code duplication when new transaction is created.
3. Commented out test cases where binary transaction/block are used.
These test cases marked with `TODO NEO3.0: Update binary` and need to be
updated.
4. Updated other tests
5. Added constant Nonce to GoveringTockenTx, UtilityTokenTx and genesis
block to avoid data variability. Also marked with TODO.
2020-04-14 16:19:41 +03:00
Evgenii Stratonikov
a99e0d7ba6
core: fix typo in TestECDSAVerify
2020-04-14 16:15:50 +03:00
Evgenii Stratonikov
ad9d927ae4
.circleci: count coverage only for cli/ and pkg/
...
examples/ contain only smart-contract examples and
is here for illustrative purposes.
2020-04-14 16:10:24 +03:00
Roman Khimov
ace5614a3d
Merge pull request #783 from nspcc-dev/neo3/movecrypto
...
Implement Neo.Crypto.* interops
2020-04-14 15:54:30 +03:00
Roman Khimov
3809b10744
Merge pull request #852 from nspcc-dev/fix/coverage
...
.circleci: enable -coverpkg=all
2020-04-14 15:54:07 +03:00
Evgenii Stratonikov
86c9bcbffe
.circleci: use a separate job for coverage testing
...
When using -race flag more memory can be consumed.
2020-04-14 15:17:09 +03:00
Evgenii Stratonikov
9630f63224
.circleci: enable -coverpkg=all
...
We want to count test for coverage irregardless
of where it is located. Previously error "no non-test Go files"
was preventing us from doing so. This commit fixes it.
2020-04-14 15:11:36 +03:00
Roman Khimov
5faa532f2e
Merge pull request #853 from nspcc-dev/bump-db-version
...
core: bump DB version to make it differ from 2.0 branch
2020-04-14 14:16:54 +03:00
Roman Khimov
c40d7aa7f4
core: bump DB version to make it differ from 2.0 branch
2020-04-14 12:54:57 +03:00
Evgenii Stratonikov
4ad29d0867
compiler: emit Neo.Crypto.ECDsaVerify syscall instead of CHECKSIG
...
Also change the name of `VerifySignature` interop, to match
syscall's name. It also accepts arguments in different order.
2020-04-13 13:47:39 +03:00
Evgenii Stratonikov
948729137f
vm: remove HASH160/HASH256 opcodes
2020-04-13 13:47:39 +03:00
Evgenii Stratonikov
c23af595c9
core: implement Neo.Crypto.ECDsaCheckMultisig interop
2020-04-13 13:47:39 +03:00
Evgenii Stratonikov
5a30af2c75
core: implement Neo.Crypto.ECDsaVerify interop
2020-04-13 13:46:31 +03:00
Evgenii Stratonikov
1611ede58c
crypto/keys: implement NewPublicKeyFromBytes()
...
It is convenient to have a single function instead of
allocating new `PublicKey` and using `DecodeBytes()` on it.
2020-04-13 13:13:15 +03:00
Anna Shaleva
d1f92a585b
core: add NewTransactionFromBytes method to Transaction
...
Added `NewTransactionFromBytes(b []byte)` method to
transaction.Transaction in order to avoid code duplication.
2020-04-13 12:04:43 +03:00
Roman Khimov
405fa9c411
Merge pull request #847 from nspcc-dev/cli-invoke-nomethod-check
...
cli: check for method presence for invokefunction commands
2020-04-13 12:00:39 +03:00
Roman Khimov
1ebc6394c6
cli: check for method presence for invokefunction commands
...
Fixes #828 .
2020-04-13 11:19:37 +03:00
Roman Khimov
522e8e15af
Merge pull request #838 from nspcc-dev/refactoring/interop
...
core: move interop to a separate package
2020-04-13 10:26:42 +03:00
Evgenii Stratonikov
30cc2c5783
core: move enumerator/iterator interops to a separate packages
2020-04-11 10:56:36 +03:00
Evgenii Stratonikov
7ffc6c0936
core: move interopContext to a separate package
2020-04-11 10:56:36 +03:00
Evgenii Stratonikov
90a08986d6
core: fix typo in function doc-comment
2020-04-11 10:56:36 +03:00
Evgenii Stratonikov
89d1f7ce75
core: remove unneeded comment
...
Serialization interops are already implemented.
2020-04-11 10:56:36 +03:00
Evgenii Stratonikov
a7c19d445b
core: move Blockchainer interface to a separate package
2020-04-11 10:56:36 +03:00
Evgenii Stratonikov
efddcf3bfe
core: remove interop methods from interopContext
...
If interops are defined as a separate functions
they can be implemented in a separate packages
which can help us to structure core.
2020-04-11 10:56:35 +03:00