Commit graph

91 commits

Author SHA1 Message Date
Evgenii Stratonikov
e4c3339c91 util: move Fixed8 to encoding/fixedn package 2020-12-09 11:18:18 +03:00
Evgenii Stratonikov
cd5219086a wallet: export NewAccountFromPrivateKey()
Don't perform back-and-forth conversion, don't handle error
which never occur.
2020-12-04 12:45:53 +03:00
Evgenii Stratonikov
239a8c3de7 cli: fix wallet convert and add tests
Close #1589.
2020-12-04 12:45:53 +03:00
Evgenii Stratonikov
8be9158e2f cli: remove explicit client.Init() calls
This is done inside `GetRPCClient()`.
2020-12-03 17:57:18 +03:00
Roman Khimov
1cf1fe5d74 *: introduce stable contract hashes
Follow neo-project/neo#2044.
2020-11-27 21:47:08 +03:00
Evgenii Stratonikov
31eca342eb *: replace all NEP5 occurences to NEP17 2020-11-24 13:08:24 +03:00
Anna Shaleva
860d2ca7a7 cli: prettify transfer error
Let the user know what's wrong when cannot find suitable token.
2020-11-13 12:43:56 +03:00
Anna Shaleva
2f9d64821f cli: add ExitError where needed 2020-11-05 10:37:06 +03:00
Anna Shaleva
b8a88f9378 rpc: allow to use address, id or name instead of scripthash [Client]
... for getcontractstate RPC client method.
2020-11-03 17:58:24 +03:00
Evgenii Stratonikov
897c9198f8 cli: allow to send multisig deploy/invoke tx
It allows to invoke native contracts as committee
from CLI in privnet, e.g. to set new oracle nodes.

Also don't require `out` flag in `multisig sign`
if tx is to be pushed.
2020-10-07 11:48:06 +03:00
Evgenii Stratonikov
d50a14359a cli/wallet: save tx only if --out was provided
Also don't print tx hash twice.
2020-10-07 10:04:19 +03:00
Evgenii Stratonikov
b2a3a0851e emit: accept multiple opcodes in Opcode() 2020-10-06 18:03:25 +03:00
Roman Khimov
eff5f10579 cli: use '--address' instead of '--addr' and allow '-a' everywhere 2020-09-29 12:48:22 +03:00
Roman Khimov
fdcc72dad0 cli/wallet: make 'addr' optional for NEP5 balances query
Iterate over all accounts by default.
2020-09-28 18:15:51 +03:00
Roman Khimov
aba9c9c0a8 cli/wallet: print token symbol and name in balance output
Make it a bit more user-friendly.
2020-09-28 16:47:47 +03:00
Roman Khimov
c6a9e652b4 cli/wallet: improve token parameter help 2020-09-28 11:28:00 +03:00
Evgenii Stratonikov
40a24bad64 cli: add tests for wallet import-deployed
Fix bugs with import, allow to sign tx with contract.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
583ef546f9 cli: add tests for wallet claim
Fix a NEO contract hash used in tx.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
dff2ac1387 cli: add test for candidate register/unregister/vote
Also fix a bug with tx signing.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
6e5a637da9 cli: add tests for multisig sign
This test is also a good example of how to
create and sign multisig transaction from scratch.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
9817da7c4e cli: add tests for nep5 import/remove
Also unify `remove` and `import` arguments.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
075f353062 cli: add tests for nep5 multitransfer
Also fix a bug when token's hash was incorrectly processed.
2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
5d7f177811 cli: add tests for wallet/account creation 2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
0dda247719 cli: move input handling to a separate package 2020-09-18 12:05:31 +03:00
Evgenii Stratonikov
911be78cc7 cli: use Writer from app instead of Stdout
It is useful in tests.
2020-09-18 12:05:31 +03:00
Evgenii Stratonikov
cdfb2429f2 cli: allow to create accounts for deployed contracts 2020-08-27 11:32:55 +03:00
Evgenii Stratonikov
6bdaefcfa4 rpc/client: use CreateTxFromScript where possible
There is substantial overlap between `CreateTxFromScript` and
`SignAndPushInvocationTx`. This commit refactors both of them
to reuse common code.
2020-08-18 11:24:48 +03:00
Roman Khimov
e7d13e6db2 *: fix misspellings found in Go Report Card 2020-08-14 12:16:24 +03:00
Evgenii Stratonikov
78eade24a3 cli/wallet: decrypt account immediately 2020-08-12 16:54:59 +03:00
Evgenii Stratonikov
832ec5eaa0 cli: implement candidate (un)register 2020-08-12 16:54:59 +03:00
Evgenii Stratonikov
88e926fbc3 cli: move wallet vote to validator vote 2020-08-12 16:54:58 +03:00
Roman Khimov
c3c88a57cd
Merge pull request #1281 from nspcc-dev/drop-go-1.12-and-fix-some-things
Drop go 1.12 and fix some things
2020-08-07 13:34:54 +03:00
Roman Khimov
0e2784cd2c always wrap errors when creating new ones with fmt.Errorf()
It doesn't really change anything in most of the cases, but it's a useful
habit anyway.

Fix #350.
2020-08-07 12:21:52 +03:00
Evgenii Stratonikov
05c24d9401 cli: support voting
Closes #1206.
2020-08-06 20:39:13 +03:00
Evgenii Stratonikov
2dd6ef964e cli: allow to transfer multiple tokens in multitransfer
Like this:
./neogo wallet nep5 multitransfer -w wallet1_solo.json
  --from NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK -r http://127.0.0.1:30333
    neo:NYqxsNMHxDg3T19APYP27mBZFfauC4zngR:2
    neo:NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK:3
    gas:NYqxsNMHxDg3T19APYP27mBZFfauC4zngR:2
2020-08-04 10:36:06 +03:00
Evgenii Stratonikov
e013477bc9 rpc,cli: support multitransfer transactions
Allow to transfer single asset to multiple recepients
in a single transaction. It is currently a separate command in CLI
and can be merged in future.
2020-07-24 17:01:30 +03:00
Anna Shaleva
c2534b1a0b rpc: adjust sendrawtransaction RPC-call
It should return tx has instead of boolean.
2020-07-22 08:37:46 +03:00
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
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
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
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
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
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