Roman Khimov
58dc8d0c9b
*: always close the wallet after use
...
Fix #2631 .
2022-09-02 14:44:32 +03:00
Roman Khimov
fd8da6fdb9
*: do not get private key from Account to check if it CanSign()
...
We have this API now to performs checks.
2022-09-02 14:43:34 +03:00
Roman Khimov
4b136e8ab1
cli/sc: tune error messages for forced save/send
...
Here we're either saving or sending a transaction (depending on `out`), but
not both. Refs. #2664 .
2022-08-31 09:51:57 +03:00
Anna Shaleva
40315fe092
cli: check manifest for validness if it's got from user input
...
And adjust the test case along the way, unnamed arguments are not
allowed for valid manifest.
2022-08-22 14:59:34 +03:00
Roman Khimov
7e212de41a
cli: drop the use of deprecated APIs from sc/nep11/nep17
2022-08-19 21:52:43 +03:00
Roman Khimov
5c8f3a99dc
rpcclient: add management wrapper for ContractManagement
2022-08-17 11:42:20 +03:00
Roman Khimov
593fa4cac8
Merge pull request #2632 from nspcc-dev/rpcclient-actor
...
RPC client Actor interface
2022-08-09 17:21:24 +03:00
Roman Khimov
d9feec2be5
cli: use MVUBI for saved transactions
...
And DO NOT CHANGE TX in paramcontext InitAndSave, because it's really
unobvious and must not be done this way.
2022-08-07 22:33:57 +03:00
Roman Khimov
ba2e7063dd
cli: compensate VUB for prompt waiting time
...
We also have now ways to change it with actor package, so technically this
fixes #2618 .
2022-08-07 22:33:57 +03:00
Roman Khimov
7132b38425
cli: use actor.Actor for smart contract invocations
...
That's a proof of the concept mostly since it doesn't change much in this
particular case.
2022-08-07 22:33:56 +03:00
Roman Khimov
8385efe4b3
cli: simplify and fix invokeWithArgs logic
...
Saving into a file can't be successful without signAndPush flag (wallet
present). This situation can't happen in CLI invocations since
testinvokefunction doesn't have `--out` flag, but still it's a logic
error. Everything else can be simplified a bit taking that into account.
2022-08-07 22:33:56 +03:00
Roman Khimov
28e2010cbd
cli: add UsageText to commands that were missing it
...
Makes --help a bit more useful.
2022-08-05 18:28:02 +03:00
Roman Khimov
1518019be8
cli: add excessive arguments checks
...
Some commands don't accept arguments, but users try giving them and don't
notice a mistake. It's a bit more user-friendly to tell the user that there is
something wrong with the way he tries to use the command.
2022-08-05 15:50:12 +03:00
Roman Khimov
1e0750e3cd
rpc: merge response and request under pkg/neorpc
...
Move result there also.
2022-07-25 11:57:53 +03:00
Roman Khimov
8c668765d2
rpc/client: move to pkg/rpcclient
...
Better package name, closer to user.
2022-07-21 22:39:53 +03:00
Roman Khimov
593f4e8734
Merge pull request #2559 from nspcc-dev/cli/wallet-config
...
cli: allow to specify wallet via configuration file
2022-07-04 19:24:23 +03:00
Anna Shaleva
213bfe6bbf
cli: allow to specify wallet via configuration file
2022-07-04 12:57:47 +03:00
Evgeniy Stratonikov
5eaa34c75f
cli/smartcontract: do not print dot on a separate line
...
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-07-04 11:06:06 +03:00
Evgeniy Stratonikov
0dc606f50e
cli/smartcontract: print proper error message on failed testinvoke
...
Do not print info about `--force` flag if we don't send or save a transaction.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-06-29 15:12:35 +03:00
Evgeniy Stratonikov
ec21c14ca9
gomod: upgrade yaml package from v2 to v3
...
Close #2085 .
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-05-30 15:26:17 +03:00
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