Roman Khimov
6d074a96e9
*: make tests use TempDir(), fix #1319
...
Simplify things, drop TempFile at the same time (refs. #1764 )
2021-08-26 17:29:40 +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
Roman Khimov
e9cefc4bfc
*: fix all errcheck warnings in testing code
2021-05-12 21:45:12 +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
Anna Shaleva
2c81fc8b8e
*: upgrade tests to use T.Cleanup()
2021-03-01 17:08:00 +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
Evgenii Stratonikov
1c0c331e25
core: update System.Contract.Call
syscall
...
1. Remove `System.Contract.CallEx`.
2. Extend number of parameters.
3. Add return value count to `VM.Context`.
2021-01-14 18:23:36 +03:00
Evgenii Stratonikov
c49eb86a2e
cli: allow to calculate contract hash before deployment
2020-12-17 15:44:42 +03:00
Roman Khimov
cf8cf93e7a
native: change contract names, move them to separate package
...
Follow neo-project/neo#2138 and make RPC client's GetNativeContractHash
case-sensitive.
2020-12-14 15:24:15 +03:00
Roman Khimov
ab12eee346
native: move contract deployment to management contract
...
See neo-project/neo#2119 .
2020-12-14 15:23:46 +03:00
Evgenii Stratonikov
2341ae0c53
compiler: specify safe methods in config
2020-12-10 18:00:43 +03:00
Evgenii Stratonikov
1fee268f95
cli/smartcontract: return error if deploy script failed to run
2020-12-10 14:41:02 +03:00
Evgenii Stratonikov
e4c3339c91
util: move Fixed8
to encoding/fixedn package
2020-12-09 11:18:18 +03:00
Evgenii Stratonikov
573d1d10c0
cli: add tests for contract
command
2020-12-04 11:05:48 +03:00
Evgenii Stratonikov
d71e45bcc5
cli/contract: make --force
flag bool
2020-12-04 11:00:03 +03:00
Evgenii Stratonikov
8be9158e2f
cli: remove explicit client.Init()
calls
...
This is done inside `GetRPCClient()`.
2020-12-03 17:57:18 +03:00
Evgenii Stratonikov
2f39701d76
vm: provide writer in PrintOps()
...
Make it more flexible and testable. Fallback to using
stdout if no writer is provided.
2020-12-02 10:49:37 +03:00
Roman Khimov
470e1592d9
request: make CreateDeploymentScript work with NEFs
...
And use it in testing code.
2020-11-27 21:53:39 +03:00
Roman Khimov
1cf1fe5d74
*: introduce stable contract hashes
...
Follow neo-project/neo#2044 .
2020-11-27 21:47:08 +03:00