Commit graph

26 commits

Author SHA1 Message Date
Roman Khimov
411ebdf51e cli: add complete support for offline signing, fix #2662
See documentation update for an example. Some code is made generic as well,
GetCompleteTransaction can now be used directly on ParameterContext.
2022-09-01 15:30:34 +03:00
Roman Khimov
58707c2b1e context: handle the case when we have more sigs than needed
We can technically have more signatures in the file than we need and it's OK,
this case should be handled.
2022-09-01 15:30:33 +03:00
Anna Shaleva
0357d9f4f4 smartcontract: add hash check to paramcontext
Close #2344.
2022-02-24 10:21:08 +03:00
Roman Khimov
efb67a0ea3 context: scripts and signatures are base64-encoded in C# now
So use base64 too and add compatibility test. Unfortunately this breaks
support for old (hex-based) files, but those should be completed a long time
ago.
2021-07-23 11:57:35 +03:00
Roman Khimov
59b4377f90 context: support Neo.Network.P2P.Payloads.Transaction type
C# now uses this one, so use it by default, but also accept old one.
2021-07-23 11:33:51 +03:00
Anna Shaleva
4b933f88a7 core: simplify interop functions
We now have the only interop table (system interops).
2021-05-12 13:30:01 +03:00
Roman Khimov
d314f82db3 transaction: drop Network from Transaction
We only need it when signing/verifying.
2021-03-26 13:45:18 +03:00
Roman Khimov
df12adaa9e crypto: remove crypto.Verifiable interface
We can now verify any hash.Hashable thing.
2021-03-26 13:45:18 +03:00
Roman Khimov
dc980b5847 sc/context: add network magic into the context
See neo-project/neo#2393, we need this to be able to sign multisig
transactions.
2021-03-12 12:59:14 +03:00
Evgeniy Stratonikov
106c27782e cli/wallet: allow to cosign with a contract
Contracts have empty verification script and their hash is
calculated differently.
2021-03-09 15:45:02 +03:00
Evgeniy Stratonikov
b9136dbfc0 smartcontract: use hash in GetWitness()
All necessary info must already be in context.
2021-03-09 15:45:02 +03:00
Evgeniy Stratonikov
20d2386414 smartcontract: use script instead of address in context 2021-03-09 15:45:02 +03:00
Evgenii Stratonikov
7d91a3a89e pkg: move internal/ package to the root directory
This way we can use it in scripts and cli.
2020-11-24 16:39:56 +03:00
Anna Shaleva
90825efa16 core: move transaction's sender to cosigners
Closes #1184

Ported changes from https://github.com/neo-project/neo/pull/1752
2020-08-04 17:33:50 +03:00
Evgenii Stratonikov
51ae12e4fd *: move syscall handling out of VM
Remove interop-related structures from the `vm` package.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-07-29 13:41:08 +03:00
Roman Khimov
db027ad9c5 vm: zero GAS means no GAS, use fee data to properly limit execution
We were accepting transactions with zero system fee, but we shouldn't do
that. Also, transaction's verification execution has to be limited by network
fee.
2020-07-14 08:37:29 +03:00
Evgenii Stratonikov
8c18142e8a keys: implement PublicKeys.Copy()
Implement convenient wrapper over explicit allocation and copying.
2020-06-29 10:44:35 +03:00
Roman Khimov
b483c38593 block/transaction: add network magic into the hash
We make it explicit in the appropriate Block/Transaction structures, not via a
singleton as C# node does. I think this approach has a bit more potential and
allows better packages reuse for different purposes.
2020-06-18 12:39:50 +03:00
Roman Khimov
709146f295 transaction: drop Inputs and Outputs, forget UTXO 2020-06-05 19:20:16 +03:00
Roman Khimov
21efccd300 transaction: remove type field, set Version to 0
Two changes being done here, because they require a lot of updates to
tests. Now we're back into version 0 and we only have one type of
transaction.

It also removes GetType and GetScript interops, both are obsolete in Neo 3.
2020-06-05 19:20:16 +03:00
Roman Khimov
f445f7c602 transaction: drop Contract transaction type 2020-06-05 19:20:16 +03:00
Evgenii Stratonikov
941410a840 core: change verification scripts to new format
Verification scripts now invoke Neo.Crypto.* interops instead of
CHECKSIG/VERIFY opcodes.
2020-04-20 11:55:24 +03:00
Evgenii Stratonikov
9abda40171 testserdes: implement helpers for encode/decode routines
Frequently one needs to check if struct serializes/deserializes
properly. This commit implements helpers for such cases including:
1. JSON
2. io.Serializable interface
2020-03-27 10:27:46 +03:00
Evgenii Stratonikov
85755a4628 smartcontract: implement (*ParameterContext).GetWitness()
After all signatures were accumulated it should be possible
to extract Witness for the verifiable item.
2020-03-05 09:45:33 +03:00
Evgenii Stratonikov
cd487e3ad4 smartcontract: implement (*ParameterContext).AddSignature() 2020-03-05 09:45:11 +03:00
Evgenii Stratonikov
0d419d3899 smartcontract: implement ParameterContext 2020-03-05 09:43:14 +03:00