Commit graph

48 commits

Author SHA1 Message Date
Roman Khimov
9d6a5dc26f result: fix confirmations count for blocks
It's +1, current block actually had `-1` value calcuated that transformed into
4294967295.
2021-02-18 17:28:19 +03:00
Roman Khimov
1ef91fa409 rpc: encode port numbers as proper numbers in getpeers
The way C# node does it.
2021-02-18 17:28:19 +03:00
Roman Khimov
850d29060a result: assets are LE in JSON
LE/BE split is the worst NEO feature ever.
2021-02-18 17:28:19 +03:00
Roman Khimov
90a06ed7a5 rpc: fix IsFrozen JSONization for assets
C# node uses `frozen` as field name here.
2021-02-12 00:04:13 +03:00
Anna Shaleva
4a8259caea rpc: adjust getrawtransaction and gettransactionheight RPC call
We should not return transaction metadata from `getrawtransaction` in case
transaction is not in the mempool. Height shouldn't be returned from
`gettransactionheight` in case transaction is in the mempool.
2020-12-31 12:44:07 +03:00
Evgenii Stratonikov
df1792c80b mpt: export func for decoding node with type
`NodeObject` can contain auxilliary fields and shouldn't be used from outside.
2020-11-11 13:22:53 +03:00
Roman Khimov
68fc8168ec rpc: add getblocktransfertx RPC call
It uses a bit different output format than getalltransfertx, so
TransferTxEvent type was adjusted accordingly.
2020-11-02 19:01:48 +03:00
Roman Khimov
b8705bdb79 rpc/server: use strings for sys and net fees in TransferTx
The same they're displayed for transactions.
2020-09-15 20:34:34 +03:00
Roman Khimov
23719f7e72 rpc/server: add new getalltransfertx API
It unifies UTXO and NEP5 transfers for a given address and presents it with
transaction-level grouping (and additional metadata).
2020-09-15 12:46:39 +03:00
Roman Khimov
9aee3e5a34 transaction: set output position when decoding
We had a kludge for getrawtransaction to set this useless field, but
7e371588a7 broke it. Add it right into the
decoder now to fix all types of queries (getblock/getrawtransaction/gettxout).

Fixes #1392.
2020-09-07 15:37:57 +03:00
Evgenii Stratonikov
57a325b3d5 rpc: adjust getutxotransfers RPC 2020-08-07 18:12:40 +03:00
Roman Khimov
db98f8f30b
Merge pull request #1274 from nspcc-dev/lowercase-json-field-names-for-stateroot
rpc: use lowercase JSON field names for StateHeight
2020-08-07 12:24:59 +03:00
Evgenii Stratonikov
022fb04077 rpc: implement getutxotransfers RPC 2020-08-06 14:16:28 +03:00
Roman Khimov
ab5eff620b rpc: use lowercase JSON field names for StateHeight
Follow neo-project/neo#1808. Note that this is an incompatible change, but
this feature is still considered to be experimental upstream.
2020-08-05 18:15:29 +03:00
Evgenii Stratonikov
519a98039c rpc: implement verifyproof RPC
Test getproof and verifyproof together.
2020-06-08 17:31:59 +03:00
Evgenii Stratonikov
8cbbddddaf rpc: implement getproof RPC 2020-06-08 17:31:58 +03:00
Evgenii Stratonikov
fe8038e8b7 rpc/server: implement getstateheight RPC 2020-06-08 16:40:37 +03:00
Roman Khimov
9546e021a9 rpc/block: rework the way Block is JSONized
Our block.Block was JSONized in a bit different fashion than result.Block in
its Nonce and NextConsensus fields. It's not good for notifications because
third-party clients would probably expect to see the same format. Also, using
completely different Block representation in result is probably making our
client a bit weaker as this representation is harder to use with other neo-go
components.

So use the same approach we took for Transactions and wrap block.Base which is
to be serialized in proper way.
2020-05-14 17:28:14 +03:00
Roman Khimov
e1408b6525 rpc/server: add notification subscription
Note that the protocol differs a bit from #895 in its notifications format,
to avoid additional server-side processing we're omitting some metadata like:
 * block size and confirmations
 * transaction fees, confirmations, block hash and timestamp
 * application execution doesn't have ScriptHash populated

Some block fields may also differ in encoding compared to `getblock` results
(like nonce field).

I think these differences are unnoticieable for most use cases, so we can
leave them as is, but it can be changed in the future.
2020-05-13 17:17:41 +03:00
Roman Khimov
e41853d0a4
Merge pull request #789 from nspcc-dev/fix/tx_specific_data_marshalling
rpc: fix marshalling of type-specific tx data
2020-03-30 16:10:25 +03:00
Anna Shaleva
9c09ad9c89 rpc: fix marshalling of type-specific tx data
closes #585
2020-03-30 15:48:50 +03:00
Roman Khimov
2316e2c4a7 rpc: fix stack field name for invocation results
Follow C# implementation:
https://docs.neo.org/docs/en-us/reference/rpc/latest-version/api/invokefunction.html
2020-03-28 13:59:42 +03:00
Anna Shaleva
ca12c75b12 rpc: fix name of json nep5balance field
Problem: wrong json field name of result.NEP5Balances.Balances
(see for details:
https://github.com/neo-project/neo-modules/blob/master-2.x/RpcNep5Tracker/RpcNep5Tracker.cs#L295)

Solution: rename field from `balances` to `balance` to be consistent with C# client
2020-03-24 14:55:20 +03:00
Anna Shaleva
4911837949 rpc: fix wrong script marshalling in getcontractstate RPC server
problem: `script` field of result.ContractState is marshalled as []byte

solution: add marshaller for result.ContractState
2020-03-24 14:55:20 +03:00
Anna Shaleva
79f7862496 rpc: fix blockheader marshalling in getblockheader RPC server
Problem: wrong json marshalling of `nextconsensus` field of
result.Header

Solution: change field type from util.uint160 to address string
2020-03-24 14:55:20 +03:00
Roman Khimov
751e79d480
Merge pull request #785 from nspcc-dev/feature/uint160_marshalling
util: JSONify uint160 using LE instead of BE
2020-03-24 12:41:07 +03:00
Anna Shaleva
2187346158 rpc: fix json marshalling of result.AssetState
Modified result.AssetState:
	- removed `FeeMode` and `FeeAddress` fields
	- fixed json name of `ID` and `AssetType` fields
to be consistent with C# RPC server
2020-03-23 17:44:15 +03:00
Anna Shaleva
2001a40312 util: JSONify uint160 using LE instead of BE
closes #769
2020-03-23 17:38:58 +03:00
Evgenii Stratonikov
6ed2bd63b9 core: marshal AppExecResult.Stack as an array
Closes #782.
2020-03-23 16:27:47 +03:00
Roman Khimov
e9429374aa
Merge pull request #756 from nspcc-dev/feature/unclaimed
core/state: do not unmarshal Unclaimed balances in account
2020-03-16 13:21:23 +03:00
Evgenii Stratonikov
e503d1001d core/state: do not unmarshal Unclaimed balances in account 2020-03-16 12:19:32 +03:00
Evgenii Stratonikov
66727ab8fa rpc: marshal Asset hash in LE in getnep5balances RPC 2020-03-16 10:14:55 +03:00
Anna Shaleva
784bac0b38 rpc: bug with empty stack marshalling in getapplicationlog
Problem: cannot marshall empty raw message from appExecResult.Stack

Solution: add handler for case when appExecResult.Stack is an empty string
2020-03-13 12:50:51 +03:00
Anna Shaleva
c23a522d25 rpc: implement getunclaimed
closes #712
2020-03-11 18:33:15 +03:00
Roman Khimov
4b83e9a5cd
Merge pull request #732 from nspcc-dev/feature/getvalidators
rpc: implement getvalidators
2020-03-07 21:43:38 +03:00
Anna Shaleva
456a2d55fd rpc: implement getvalidators
closes #714
2020-03-07 18:05:40 +03:00
Evgeniy Kulikov
b34ac22434
[rpc/server] fix getblock verbose response
- Nonce should not trim leading zeros
- NextConsensus should returns address (uint160 -> base58)
2020-03-06 19:53:11 +03:00
Roman Khimov
fbdc60b731
Merge pull request #723 from nspcc-dev/feature/nep5
core,rpc: implement NEP5-related logic
2020-03-05 18:33:58 +03:00
Evgenii Stratonikov
95a8fa234f rpc: implement getnep5transfers RPC 2020-03-05 18:22:40 +03:00
Evgenii Stratonikov
2757882d26 rpc: implement getnep5balances RPC 2020-03-05 18:22:40 +03:00
Anna Shaleva
42e2aff381 rpc: implement getblockheader RPC
closes #711
2020-03-05 14:47:45 +03:00
Roman Khimov
e41d434a49 *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
Roman Khimov
4c8d327353 rpc: drop duplicating Invoke* structures
And use smartcontract.Parameter instead of vm.StackItem where
appropriate. Closes #689.
2020-03-03 15:38:03 +03:00
Roman Khimov
9b4fd99fbc vm: break circular references when recursing into ToContractParameters
Reference types can have circular pointers to each other, thus we need to
control recursion.
2020-03-03 15:38:03 +03:00
Evgenii Stratonikov
51c4868641 rpc: implement getclaimable RPC 2020-03-02 18:01:49 +03:00
Anna Shaleva
ff4384d7ff rpc: implement getapplicationlog RPC
Closes #500
2020-03-02 17:25:27 +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
69e1ad512f rpc: move result package into response
`response` is to be populated soon.
2020-02-21 15:12:04 +03:00