Roman Khimov
e4b52d3947
core/rpc: add continue
flag to iterating functions
...
Most of the time we don't need to get all transfers from the DB and
deserialize them.
2020-09-21 22:23:34 +03:00
Roman Khimov
373c669c6a
core/state: reverse the order of ForEachTransfer
...
When using limits we're usually concerned about the most recent
transfers. Returning 3 transfers from the middle of the chain isn't very
helpful.
2020-09-21 22:05:15 +03:00
Roman Khimov
ff11a5f990
state: use more efficient encoding for amount
...
It's variable-length anyway, so wasting 8 bytes for what typically is 1 byte
makes no sense.
2020-09-21 21:51:33 +03:00
Roman Khimov
806b89db76
state: store the length of NEP5TransferLog in the first byte
...
We lose `size` field after serialization/deserialization which can lead to
adding more than NEP5TransferBatchSize elements into the NEP5TransferLog.
2020-09-21 21:51:11 +03:00
Roman Khimov
e7d13e6db2
*: fix misspellings found in Go Report Card
2020-08-14 12:16:24 +03:00
Anna Shaleva
0dd1730632
core: store NEP5Transfer asset by ID instead of hash
...
To avoid problems with retrieving decimals for migrated contracts.
2020-07-29 15:15:48 +03:00
Anna Shaleva
b9bdab8ec8
core: store nep5balances using contract id
...
Closes #1194
2020-07-29 15:15:48 +03:00
Anna Shaleva
abe3c94b95
core: use big.Int to store NEP5 balances
...
closes #1133
2020-07-09 13:26:39 +03:00
Anna Shaleva
43b28ffa06
core: get rid of NEP5TransferSize
...
Part of #1133
It will help us to use big.Int to store amount of NEP5 tokens. As far as
big.Int doesn't have constant size, we shouldn't use `NEP5TransferSize`
constant anymore.
2020-07-09 13:25:03 +03:00
Anna Shaleva
aa554f0a9a
core: update block timestamp format
...
Changed block.Timestamp from uint32 to uint64
2020-04-27 17:56:44 +03:00
Evgenii Stratonikov
32401a567e
core: store NEP5Transfers in batches
...
This is an append-only log which is read only during some RPCs.
It is rather slow to get it from base every time we need to append to
it. This commit stores all NEP5Transfers in batches, so that
only a last batch needs to be unmarshaled during block processing.
2020-03-12 14:51:12 +03:00
Evgenii Stratonikov
3c6d9653b0
core/state: add Size() method to NEP5TransferLog
2020-03-12 12:58:30 +03:00
Evgenii Stratonikov
df2598c8dc
core: store NEP5 balances separately
...
There is no need to take and unmarshal an account structure only
to get it's NEP5 balances.
2020-03-12 12:58:28 +03:00
Evgenii Stratonikov
95a8fa234f
rpc: implement getnep5transfers RPC
2020-03-05 18:22:40 +03:00
Evgenii Stratonikov
f92fd3c948
core: track NEP5 transfers
2020-03-05 18:22:40 +03:00
Evgenii Stratonikov
e8c4179a9c
core: track NEP5 balances
2020-03-05 18:22:19 +03:00