Commit graph

184 commits

Author SHA1 Message Date
Anna Shaleva
c3431f4fff cli: add extra validUntilBlockIncrement to transferNEP5
When we export tx to a file, we might need validUntilBlock to be larger
a bit in order to use it in future.
2020-07-07 13:23:01 +03:00
Anna Shaleva
3c551788c9 cli: fix parseCosigner method 2020-07-06 10:06:18 +03:00
Anna Shaleva
1880e96844 cli: fix contract deploy&invoke
We should add cosigners to deplyment and invocation transactions.
2020-07-06 10:01:14 +03:00
Roman Khimov
4f8e4628dc cli/rpc: hide parameter encoding details for Invoke* calls
The script is passed as a hex string, but no one should care. The hash is a
hex-encoded LE value, but no one should care either. Hex might change to
base64, LE to BE, no one outside these functions should care about that.
2020-07-02 16:41:34 +03:00
Roman Khimov
0819583413 cli/rpc: test-invoke deployment script to get the system fee value
Fix #1134.
2020-07-02 16:41:31 +03:00
Anna Shaleva
3875c0a923 cli: deploy contract using manifest.json instead of yaml config
1. We have all necessary information in manifest.json, so don't need
   config.yaml for deployment anymore. It also allow us to be consistent
   with C# cli (it uses only .manifest.json and .nef files for contract
   deployment)
2. Remove EntryPoint and Methods from ProjectConfig as compiler is able
   to generate this information by itself.
2020-06-30 18:22:47 +03:00
Anna Shaleva
4dfb0eb438 compiler, cli: generate manifest.json and debug.json independently
We should be able to generate manifest.json without debug.json and vice
versa.
2020-06-30 14:33:19 +03:00
Roman Khimov
08c516014f
Merge pull request #1132 from nspcc-dev/neo3/rpc/fixed8_marshalling
*: switch from Fixed8 to int64
2020-06-29 21:44:40 +03:00
Anna Shaleva
73b630db9b *: switch from fixed8 to int64
Follow C# implementation, we have to marshall JSON Fixed8 fields without
taking into account decimals.
2020-06-29 21:39:27 +03:00
Anna Shaleva
2f6065f541 compiler, cli: introduce *.manifest.json
Add ability to generate NEO3-compatable *.manifest.json into compiler.
This file represets contract manifest and includes ABI information, so
we don't need to create separate *.abi.json file. NEO3 debugger also
needs *.manifest.json only. So, switched from *.abi.json to
*.manifest.json file.
2020-06-29 09:15:29 +03:00
Anna Shaleva
c7746da023 cli, compiler: switch from .avm to .nef
We don't generate clear .avm instructions anymore. Instead, use .nef
files with additional metadata.
2020-06-29 09:15:29 +03:00
alexvanin
642a221e39 cli: update wallet path argument name in cli context
In #1104 wallet path argument has changed from `--path` to `--wallet`
but cli application still getting wallet path with `ctx.String("path")`
instead of `ctx.String("wallet")`.
2020-06-25 18:46:24 +03:00
Evgenii Stratonikov
f66199c99f cli: hardcode NEO and GAS token info
Don't make extra network queries for already known contracts.
2020-06-25 17:21:26 +03:00
Evgenii Stratonikov
b599b395e8 cli: output nep5 token hashes in LE
CLI use always operates with little-endian representation.
2020-06-25 17:21:26 +03:00
Evgenii Stratonikov
65cb6dd0ad cli: change name for wallet path flag
`-p` is used for `--privnet`, `-w` is for wallet.
Fix CLI error:
balance flag redefined: p
panic: balance flag redefined: p
2020-06-25 17:21:18 +03:00
Roman Khimov
176c0e98d6 cli/server: dump genesis block state when restoring
Neo 3 node does it too and it's very useful because now the genesis block also
does some state changes that are important.
2020-06-24 16:09:54 +03:00
Roman Khimov
66df805f3b cli/server: update value conversion for Neo 3
Version is no longer being stored for the value, so there is no need for '00'
byte.
2020-06-24 10:21:24 +03:00
Roman Khimov
fb18eda515 cli/server: update toNeoStorageKey key conversion for Neo 3
Follow #1037 changes with contract IDs and update padding, the number of
value bytes is being stored now as 17th byte instead of number of zeroes.
2020-06-24 10:21:24 +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
d22286cbbc client/cli: add network option to the RPC client
It doesn't affect anything yet, but it's going to be used in the future for
network-specific behavior. It also renames short '--timeout' form to '-s'
avoiding conlict with '-t' used for '--testnet'.
2020-06-18 12:11:13 +03:00
Roman Khimov
16ce63e653 cli: unify RPC endpoint flags under options package
This makes rpc flags consistent across all commands, previously some commands
used 'endpoint, e' and some 'rpc, r', some had ability to change timeout and
some hadn't. Now 'rpc-endpoint, r' is used everywhere along with 'timeout, t'.
2020-06-18 12:10:59 +03:00
Roman Khimov
f2c4b9b1d9 cli: move network options to their own package
They will be reused.
2020-06-18 12:10:14 +03:00
Roman Khimov
26f11a52d9 config: move NetMode into its own micropackage
It's going to be used a bit more and pulling whole config just for one type is
a bit wrong.
2020-06-18 12:09:57 +03:00
Evgenii Stratonikov
651976b2ca config: remove AddressVersion from the configuration
It is never used and is the same constant for both mainnet, testnet and
privnet.
2020-06-17 15:55:22 +03:00
Evgenii Stratonikov
b3b1137030 cli: allow to convert wallet from NEO2 to NEO3 format
This command may be helpful to have during transition.
2020-06-17 15:49:34 +03:00
Roman Khimov
fe31c7ed2d
Merge pull request #1047 from nspcc-dev/neo3/rpc/invoke
rpc: update invoke* RPC-calls
2020-06-11 21:39:20 +03:00
Anna Shaleva
9e7fca013e rpc: update CLI and RPC client invoke* calls
part of #1036
2020-06-11 20:32:05 +03:00
Evgenii Stratonikov
76a2f62fbd cli: use manifest during contract deployment 2020-06-11 10:45:25 +03:00
Anna Shaleva
0af5b9339d rpc, cli: remove invoke RPC-call
part of #1036
2020-06-10 20:30:55 +03:00
Roman Khimov
709146f295 transaction: drop Inputs and Outputs, forget UTXO 2020-06-05 19:20:16 +03:00
Roman Khimov
0a09a20900 transaction: drop Register transaction type
And everything associated like SystemFee configuration.
2020-06-05 19:20:16 +03:00
Roman Khimov
e358c70ecc cli/wallet: drop classic transfer support
We do have 'nep5 transfer' and that's enough for now.
2020-06-05 19:20:16 +03:00
Roman Khimov
c0e044961d cli/wallet: add ability to save NEP5 transfer transaction
It allows to use multisig cli operations for multisig transaction creation and
send.
2020-06-05 19:20:16 +03:00
Roman Khimov
d496cc9687 cli/wallet: switch claim command to claim NEP5 GAS 2020-06-05 19:20:16 +03:00
Roman Khimov
3b2644da4f rpc/client: pass token as simple hash into TransferNEP5
It doesn't need full wallet.Token structure.
2020-06-05 19:20:16 +03:00
Anna Shaleva
7acf5b2841 core: add SystemFee and NetworkFee to transaction
closes #831
2020-05-20 23:26:48 +03:00
Anna Shaleva
2ec1d76320 compiler: add ability to generate .abi.json file
A part of integration with NEO Blockchain Toolkit (see #902). To be
able to deploy smart-contract compiled with neo-go compiler via NEO
Express, we have to generate additional .abi.json file. This file
contains the following information:
 - hash of the compiled contract
 - smart-contract metadata (title, description, version, author,
email, has-storage, has-dynamic-invoke, is-payable)
 - smart-contract entry point
 - functions
 - events

However, this .abi.json file is slightly different from the one,
described in manifest.go, so we have to add auxilaury stractures for
json marshalling. The .abi.json format used by NEO-Express is described
[here](https://github.com/neo-project/neo-devpack-dotnet/blob/master/src/Neo.Compiler.MSIL/FuncExport.cs#L66).
2020-05-04 08:37:39 +03:00
Anna Shaleva
861aca1547 rpc, smartcontract: move contract metadata to smartcontract package 2020-05-04 08:37:39 +03:00
Anna Shaleva
2b5c14160c core: add sender field to transaction
closes #860
2020-04-20 17:21:28 +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
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
Roman Khimov
1ebc6394c6 cli: check for method presence for invokefunction commands
Fixes #828.
2020-04-13 11:19:37 +03:00
Evgenii Stratonikov
450263bcae cli: rename contract compile --emitdebug to --debug
It is more intuitive and easier to type.
2020-04-08 15:54:25 +03:00
Evgenii Stratonikov
c71ad6a5db cli: output contract after compiling only with --verbose flag
Also remove Debug from compiler option as it is used only in CLI.
2020-04-08 13:09:51 +03:00
Evgenii Stratonikov
73c7b408b7 cli: rename --debug flag in contract compile 2020-04-08 13:09:51 +03:00
Evgenii Stratonikov
5bdee683e6 cli,compiler: support emitting debug info in a file 2020-04-06 15:30:07 +03:00
Anna Shaleva
5a984fdf88 config: move config.go out of config/
closes #423
2020-03-31 17:55:59 +03:00
Roman Khimov
79b930f6de
Merge pull request #790 from nspcc-dev/fix/deploy
cli: fix type in flags.Fixed8FromContext
2020-03-24 17:37:08 +03:00
Evgenii Stratonikov
7310666479 cli: fix type in flags.Fixed8FromContext 2020-03-24 17:17:28 +03:00