Commit graph

1521 commits

Author SHA1 Message Date
Anna Shaleva
b3621d4a86 smartcontract: remove unused structures
Removed following unused structures:
	-smartcontract.ContextItem
	-smartcontract.Signature
	-smartcontract.ParameterContext
2020-03-02 17:25:27 +03:00
Anna Shaleva
535f391550 smartcontract: add marshaller for Parameter
1) Add marshaller and tests for smartcontract.Parameter
2) Add unmarshaller and tests for missing types of smartcontract.Parameter:
	- MapType
	- BoolType
2020-03-02 17:25:27 +03:00
Anna Shaleva
648e0bb242 rpc/smartcontract: merge contract parameter types
Merged two types:
	- smartcontract.ParamType
	- rpc.StackParamType
into single one:
	- smartcontract.ParamType
as they duplicated the functionality.

NOTE: type smartcontract.MapType was added (as in C# implementation).

From now, list of supported smartcontract parameter types:
	UnknownType
	SignatureType
	BoolType
	IntegerType
	Hash160Type
	Hash256Type
	ByteArrayType
	PublicKeyType
	StringType
	ArrayType
	MapType
	InteropInterfaceType
	VoidType
2020-03-02 17:25:21 +03:00
Roman Khimov
5d4dfbfa1a
Merge pull request #684 from nspcc-dev/feature/getblocksysfee
rpc: implement getblocksysfee RPC
2020-02-21 18:48:56 +03:00
Anna Shaleva
76a0a6e7e8 rpc: implement getblocksysfee RPC
Closes #341
2020-02-21 18:45:52 +03:00
Roman Khimov
56f87cd44e
Merge pull request #676 from nspcc-dev/dedup-rpc-types
Split up RPC into separate packages

Closes #510.
2020-02-21 16:22:36 +03:00
Roman Khimov
8da20055d6 rpc: drop duplicating structures used in tests
We have proper results now, so use those. The only left is Invoke, but that
depends on another issue at the moment.
2020-02-21 15:23:11 +03:00
Roman Khimov
6a3be6081c smartcontract: support "ByteArray" string for ByteArrayType
We actually do emit it ourselves in String()
2020-02-21 15:23:11 +03:00
Roman Khimov
3fa9de764b rpc/client: only return the Result from calls, handle Error internally
Adjust structures accordingly and throw away most of them, they're useless.
2020-02-21 15:23:11 +03:00
Roman Khimov
28a26d2cae rpc/client: look into data first, then HTTP error code
In case of error our own server responds with an HTTP error and proper
JSON-RPC error in the body, so look there first as it has more specific data.
2020-02-21 15:12:04 +03:00
Roman Khimov
877b987ecf rpc: omitempty some fields in TransactionOutputRaw
These might be undefined for mempool transactions, thus they should be defined
as omitempty.
2020-02-21 15:12:04 +03:00
Roman Khimov
bba8ac15ff rpc: introduce proper type for sendrawtransaction, drop useless types
sendrawtransaction just returns a bool, sendtoaddress returns a proper
transaction and that should be the same as the one we have in
TransactionOutputRaw.
2020-02-21 15:12:04 +03:00
Roman Khimov
465476201c rpc/response: drop duplicating AccountState structure 2020-02-21 15:12:04 +03:00
Evgenii Stratonikov
b50704fd3b rpc: move server-related code to a separate package 2020-02-21 15:12:04 +03:00
Evgenii Stratonikov
d24c6d1d9e rpc: move client-related code to a separate package
This includes Client struct with RPC methods and
BalanceGetter implementation with NeoSCAN.
2020-02-21 15:12:04 +03:00
Evgenii Stratonikov
b6bc4e580a rpc: move functions for Tx building in request package/ 2020-02-21 15:12:04 +03:00
Evgenii Stratonikov
98a1e2170a rpc: move ContractDetails to request/ package 2020-02-21 15:12:04 +03:00
Evgenii Stratonikov
63751a6e6b rpc: merge neoscan-related definitions into one file
It will make refactoring easier.
2020-02-21 15:12:04 +03:00
Roman Khimov
f330f2f40b rpc: separate out request and response structures
Mostly as is, no real effort done yet to optimize them, so there are still a
lot of duplicates there, but at least we sort them out into different smaller
packages.
2020-02-21 15:12:04 +03:00
Roman Khimov
69e1ad512f rpc: move result package into response
`response` is to be populated soon.
2020-02-21 15:12:04 +03:00
Roman Khimov
1801e545a0 rpc: remove wrappers package, move things to result
These are all RPC call results, `wrappers` package doesn't make much sense to
me.
2020-02-21 15:12:04 +03:00
Roman Khimov
b8f7ab8e6a rpc: move Invoke to result package
It's just a data.
2020-02-21 15:12:04 +03:00
Roman Khimov
c189062f40 rpc: move ValidateAddress to the result package
Because it is a result of the RPC call.
2020-02-21 15:12:04 +03:00
Roman Khimov
bfa2d54e16 rpc: move validateAddress() function from wrappers into server
It's a server implementation detail, it has nothing to do with the data format
itself. It also makes no sense exporing it.
2020-02-21 15:12:04 +03:00
Roman Khimov
72a62f1292 result: add trivial test for peers management functions 2020-02-21 15:12:04 +03:00
Roman Khimov
723b33e108 network: implement unconnected/bad peers getters
Which allows node to respond to `getpeers` RPC request correctly.
2020-02-21 15:12:03 +03:00
Roman Khimov
d92e193e63 rpc/network: refactor getpeers logic
Deduplicate and simplify code.
2020-02-21 15:12:03 +03:00
Roman Khimov
336a94456f rpc: make blockHeightFromParam a pointer method
Makes no sense copying Server here.
2020-02-21 15:12:03 +03:00
Roman Khimov
f345db58ab
Merge pull request #678 from nspcc-dev/feature/breakfor
compiler: support break statement in for loops and switch statements

Closes #677.
Implements 4-th point from #628.
2020-02-21 12:22:16 +03:00
Roman Khimov
ef31d0dd3c
Merge pull request #685 from nspcc-dev/feature/wallet
cli: implement wallet import/export functionality, part of #26.
2020-02-21 12:21:25 +03:00
Evgenii Stratonikov
2fc6375958 cli: provide separate function for opening wallet 2020-02-21 12:14:53 +03:00
Evgenii Stratonikov
3d67d52537 cli: support account creation in existing wallet 2020-02-21 12:14:53 +03:00
Evgenii Stratonikov
20c98411fd cli: implement wallet WIF/NEP2 export
One positional argument can be provided. If so, it is
interpreted as address and only WIFs corresponding to it
are exported. If address is provided '--decrypt' flag can be
specified to export unencrypted WIFs.
2020-02-21 12:14:52 +03:00
Evgenii Stratonikov
a030411310 cli: implement multisig import to wallet 2020-02-21 12:14:33 +03:00
Evgenii Stratonikov
da89f18999 compiler: support break and continue in range loops 2020-02-21 12:03:37 +03:00
Evgenii Stratonikov
ccb53414f2 compiler: support break in switch statements 2020-02-21 12:03:37 +03:00
Evgenii Stratonikov
03dc6f7cbb compiler: support continue statement in for loops 2020-02-21 12:03:36 +03:00
Evgenii Stratonikov
fa2edc46e0 compiler: support break statement in for loops 2020-02-21 11:38:23 +03:00
Evgenii Stratonikov
25ffb56982 wallet: support creating multisig accounts
(*Account).ConvertMultisig() will convert an existing account
into a multisig one.
2020-02-21 11:19:35 +03:00
Evgenii Stratonikov
baa68e1d46 cli: implement wallet WIF import 2020-02-21 11:19:34 +03:00
Evgenii Stratonikov
a71c2c4bfd cli: move password getting to a separate function
Also do not ignore errors from `terminal.ReadPassword`.
2020-02-21 10:45:58 +03:00
Evgenii Stratonikov
5a727cabf8 wallet: add signature check contracts to new accounts 2020-02-21 10:45:57 +03:00
Evgenii Stratonikov
eacea8bff5 smartcontract: implement json.Unmarshaler for ParamType 2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
ea30122a09 wallet: rewrite file on save
When we are opening a file, it is expected that
it will be rewritten, not appended to a already existing wallet.
2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
ad6fa2aea9 wallet: set WIF and public key on account decrypt
They are set during account creation and open+decrypt is
expected to put account in the same state.
2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
d837eb3761 wallet: allow to create accounts from encrypted WIFs 2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
02954285c1 cli: declare wallet path flag once 2020-02-20 15:52:07 +03:00
Roman Khimov
cad1f074d4 CHANGELOG: fix typo 2020-02-19 17:26:10 +03:00
Roman Khimov
0fe9b632db CHANGELOG: release 0.73.0 2020-02-19 16:22:31 +03:00
Roman Khimov
36773816d5 go.mod: update dbft with nspcc-dev/dbft#26 2020-02-19 14:46:51 +03:00