Commit graph

157 commits

Author SHA1 Message Date
Anna Shaleva
2096ad6e81 *: remove io/ioutil uses
Close #1764.
2022-03-17 19:39:18 +03:00
Evgeniy Stratonikov
a2cef15932 compiler: emit bindings configuration
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-02-28 15:36:14 +03:00
Roman Khimov
870fd024c9
Merge pull request #2367 from nspcc-dev/rpc/thread-safe
rpc: take care of RPC clients
2022-02-24 20:11:15 +03:00
Evgeniy Stratonikov
da03d895de cli/smartcontract: generate bindings to an existing contract
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-02-23 15:40:06 +03:00
AnnaShaleva
0092330fe1 rpc: carefully review places where Client.cache.initDone is used
1. Keep initDone check only for the places where cache is directly accessed.
   We don't need to check it in other places, otherwise we have a mess of
   duplicating checks.
2. Fix bug in code related to block deserialisation. There's no magic, so
   checking that initialisation is done is not enough for proper block
   deserialisation. We need to manually fill StateRootEnabled field.
3. Since transaction doesn't need network magic to compute its hash, we don't
   need to perform Client initialisation before transaction-related requests.
4. Check that cache is initialised before accessing network magic.
5. Refactor the way Policy contract hash is fetched for Client requests.
   We don't really need Client initialisation for that, it's OK to fetch Policy
   hash on-the-fly.
2022-02-22 12:52:14 +03:00
Anna Shaleva
b88f2b389f cli: check execution state while saving invoked tx 2022-02-02 11:28:29 +03:00
Evgeniy Stratonikov
945b56e350 cli/smartcontract: set correct version for pkg/interop
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:52:58 +03:00
Evgeniy Stratonikov
25583f9aeb compiler: make pkg/interop a separate module
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:21:26 +03:00
Evgeniy Stratonikov
9871dc8f5a compiler: update x/tools package
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-01-20 13:21:26 +03:00
AnnaShaleva
aefb6f9fee *: fix tests failing due to path.Join usage
Solution:
Use `file/filepath` package to construct expected path. This package is OS-aware, see https://github.com/golang/go/issues/30616.
2021-11-29 11:11:09 +03:00
Roman Khimov
49149afecf
Merge pull request #2244 from nspcc-dev/dont-panic-on-stdin-ioctl-issues
Dont panic on stdin ioctl issues
2021-11-04 20:36:54 +03:00
Roman Khimov
7679a17bc6 cli: provide better error message in case of password read failure 2021-11-03 19:36:11 +03:00
Evgeniy Stratonikov
7758378d28 compiler: allow to overload methods in manifest
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-10-29 20:15:21 +03:00
Evgeniy Stratonikov
0db5dd5fd7 cli/smartcontract: allow to deploy contracts with scope
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-10-13 15:55:42 +03:00
Roman Khimov
42a9d3d7b8 nef: add Source field
Follow neo-project/neo#2605.
2021-09-24 00:19:37 +03:00
Evgeniy Stratonikov
2a78ec8003 cli/wallet: show tx fee before relaying
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-09-21 11:31:56 +03:00
Evgeniy Stratonikov
adcae12331 cli/smartcontract: reuse read functions in contractDeploy
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-08-06 12:05:36 +03:00
Evgeniy Stratonikov
868198a36e cli/smartcontract: add manifest add-group command
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-08-06 12:05:32 +03:00
Evgeniy Stratonikov
6fe2ace43b cli/smartcontract: refactor contract deploy a bit
Provide cosigners explicitly during deploy and don't read wallet twice.
This is needed because manifest validation requires valid sender address.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-08-06 12:05:32 +03:00
Roman Khimov
2a57e48897 cli/sc: add sysgas option to add some gas
Sometimes on-chain invocations need a bit more GAS than expected after test
invocations, so let the user compensate for that. 2.x has similar option since
483fefbb62.
2021-07-02 11:57:47 +03:00
Evgeniy Stratonikov
4249674ddc compiler: check for contract permissions
On many occassions we can determine at compile-time if contract config lacks
some properties it needs. This includes all native contract invocations
through stdlib, as both hashes and methods are known at compile-time
there.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-06-28 11:49:29 +03:00
Anna Shaleva
50296975e2 crypto: allow to provide non-default scrypt parameters 2021-06-11 15:22:28 +03:00
Evgeniy Stratonikov
4467e2cbfd cli,compiler: allow to specify manifest permissions 2021-06-04 11:16:22 +03:00
Evgeniy Stratonikov
e3e0e2a8a8 cli: allow to specify CustomContracts/Groups signer
The syntax is `CalledByEntry,CustomContracts:hash1:hash2`.
2021-05-28 15:46:33 +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
Anna Shaleva
e48eb10522 cli: unify 'contract deploy' and 'contract invoke*' commands
These commands share a lot of code.
2021-04-23 12:40:13 +03:00
Anna Shaleva
16fa191ccb cli: move combining signers and accounts to a separate package
This code will be reused in other packages.
2021-04-23 10:27:43 +03:00
Anna Shaleva
94316fa36d cli: move GetDataFromContext and ParseParams to a helpers package 2021-04-23 10:26:09 +03:00
Anna Shaleva
d12ae0998f cli: return numWordsRead from GetDataFromContext
It's needed when we have extra args after the 'data' argument. Then
these args are started right from numWordsRead offset.
2021-04-23 10:23:06 +03:00
Anna Shaleva
2ab420ed18 cli: move cosigners parsing to a separate function
We have a lot of common code which is shared between `smartcontract` and
`wallet` cli packages. It's convinient to keep it in a separate helper
package in order to avoid functional cli packages dependencies.
2021-04-23 10:11:01 +03:00
Roman Khimov
881ed3065e
Merge pull request #1909 from nspcc-dev/cli/default-cosigner-scope
cli, rpc: use CalledByEntry as a default cosigner's scope
2021-04-19 14:43:31 +03:00
Anna Shaleva
2a144d0420 cli: use CalledByEntry as default cosigner's scope 2021-04-19 11:52:28 +03:00
Anna Shaleva
4e66293612 cli: allow to provide 'data' for 'contract deploy' command 2021-04-19 10:52:42 +03:00
Anna Shaleva
1a8ea8e2d6 cli: specify usage text for 'contract deploy' command 2021-04-19 10:50:15 +03:00
Roman Khimov
8f14c61c34
Merge pull request #1906 from nspcc-dev/cli/transfer_param
cli: allow to pass 'data' for nep17 transfer command
2021-04-19 10:43:42 +03:00
Anna Shaleva
db868f033e cli: allow to provide data for nep17 transfer commands 2021-04-19 10:20:29 +03:00
Anna Shaleva
df24c51262 cli: use AddressFlag for calc-hash 2021-04-16 12:41:28 +03:00
Roman Khimov
26eff7110c cli/smartcontract: allow deploying contracts from multisig accounts
By providing `--out` flag.
2021-04-07 11:50:24 +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
Anna Shaleva
0a5072a1da core: allow to compile test contracts with yaml config
And refactored Rubl test contract (it should support NEP-17 and
onNEP17Payment).
2021-03-22 15:32:26 +03:00
Anna Shaleva
6c0faa4ea3 rpc: provide cosigners accounts to CreateTxFromScript
We need to define network fee for each of cosigners, and the only way to
do it is to access the cosigner's script.
2021-03-04 10:37:35 +03:00
Anna Shaleva
b1b9a8cf66 rpc: refactor CreateTxFromScript signature
Make cosigners non-variadic.
2021-03-03 13:42:15 +03:00
Roman Khimov
c58dc7e453
Merge pull request #1758 from nspcc-dev/cli/0x
cli: support Uint160 hashes with 0x prefix
2021-02-19 16:23:56 +03:00
Anna Shaleva
488e75a246 cli: add filebytes parameter type 2021-02-19 10:52:45 +03:00
Evgeniy Stratonikov
b8024dbfa8 cli: support Uint160 hashes with 0x prefix 2021-02-18 14:38:50 +03:00
Evgeniy Stratonikov
f6176b30f2 cli: support escape codes 2021-02-11 16:06:11 +03:00
Roman Khimov
79e11c93a1 cli: allow to specify cosigners with Neo addresses
Make it a bit more usable.
2021-01-27 22:32:29 +03:00
Roman Khimov
48e3a41133 cli: remove outdated contract deploy comment
It's relevant for Neo 2.0, but not 3.0.
2021-01-27 21:45:44 +03:00
Roman Khimov
fac2a0d7e3 cli: provide -m flag for manifest when deploying a contract
It's a bit easier to use. Previously we couldn't have it because it was used
for '--mainnet', but we no longer specify the network, so it can be used for
'--manifest'.
2021-01-27 21:39:14 +03:00
Roman Khimov
054ca27e9c state: use checksums and names to calculate contract hashes
It allows to deploy the same NEF using one sender and get different contract
hashes. See neo-project/neo#2240.
2021-01-22 12:22:48 +03:00