Roman Khimov
3d18f09def
core: fix CalculateClaimable for NEP5 NEO
...
It's not stored as Fixed8, so calculations need to be adjusted for that.
2020-06-05 19:20:16 +03:00
Roman Khimov
39dfebccc4
core: no longer treat sysfee as claimable
...
As it's not on Neo 3, it just gets burned and that's it. Only network fee is
being redistributed to CNs.
2020-06-05 19:20:16 +03:00
Roman Khimov
50ed4c5967
core: don't return an error from CalculateClaimable
...
As it never returns one.
2020-06-05 19:20:16 +03:00
Roman Khimov
1bc6d29c0d
core: fix potential NPE in GetUtilityTokenBalance
2020-06-05 19:20:16 +03:00
Roman Khimov
9f5fd21160
core: drop UXTO NEO and GAS transactions from the genesis block
...
They're no longer required. Adjust test chain for that, now it only has
invocations, transfers NEO/GAS and pays the fees with NEP5 GAS.
2020-06-05 19:20:16 +03:00
Roman Khimov
a9955719da
native: make mint/burn for 0 no-ops
...
Prevent emitting useless transfer events and doing useless gets/puts.
2020-06-05 19:20:16 +03:00
Roman Khimov
fed95e0069
smartcontract: (un)marshal AnyType value as null
...
Neo 3 can emit Null in its transfer notifications in `from` or `to` fields
when minting/burning tokens (unlike Neo 2 that emitted util.Uint256{} for this
case), then it gets converted to Parameter as AnyType and we have to JSONize
it somehow for proper RPC functioning.
2020-06-05 19:20:16 +03:00
Roman Khimov
c6ae954e4e
rpc: drop getaccountstate method
...
It's not relevant for Neo 3.
2020-06-05 19:20:16 +03:00
Roman Khimov
657bb7575e
rpc: change getunclaimed to getunclaimedgas
...
getunclaimed doesn't exist on Neo 3 and getunclaimedgas works for NEP5 GAS.
2020-06-05 19:20:16 +03:00
Roman Khimov
d856df36a7
rpc: drop support for gettxout method
...
Neo 3 doesn't need it.
2020-06-05 19:20:16 +03:00
Roman Khimov
232e1a2598
rpc: drop support for getassetstate
...
It's for UTXO assets and it's absent in Neo 3.
2020-06-05 19:20:16 +03:00
Roman Khimov
63eb6069b2
rpc: drop support for getunspents method
...
Irrelevant for Neo 3.
2020-06-05 19:20:16 +03:00
Roman Khimov
337e65b696
rpc: drop UTXO transfer support, remove Balancer
...
Nothing uses them now and they're irrelevant for Neo 3.
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
9a4e53b58e
rpc/client: no longer add UTXO GAS for fees
...
It's already being paid with NEP5 GAS.
2020-06-05 19:20:16 +03:00
Roman Khimov
670396b908
rpc: drop getclaimable RPC call support
...
It's not present in NEO 3 and it's not needed there.
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
Roman Khimov
ed0a3e4af5
rpc/client: drop neoscan support
...
It was used as getunspents substitute and it's not longer relevant for NEO 3.
2020-06-05 19:20:16 +03:00
Roman Khimov
31ef0c4339
core: don't check systemfee with UTXO outputs
...
SystemFee is already being checked by verifyTx against Sender's balance.
2020-06-05 19:20:16 +03:00
Roman Khimov
d9400800e3
transaction: drop Gas field from InvocationTX
...
It essentialy is the new SystemFee, so use that. Had to increase GAS transfer
in test chain to 1000 to pay for deployment.
2020-06-05 19:20:16 +03:00
Roman Khimov
30c74152ce
core: add balance checks for NEP5 transfer to TestCreateBasicChain
2020-06-05 19:20:16 +03:00
Roman Khimov
0a35ee00c6
core: print txes in LE in TestCreateBasicChain
...
LE is human and RPC compatible representation, BE hex is almost unusable.
2020-06-05 19:20:16 +03:00
Roman Khimov
bf6525e54d
core: fix GetUtilityTokenBalance
...
The value stored in NEP5 tracker for GAS is Fixed8 already, so we need to
type-cast it, but not multiply by 10⁸ again.
2020-06-05 19:20:16 +03:00
Roman Khimov
7e586cc6ab
native: deduce transferred assets from sender on transfer
...
When money is being sent usually they go away from someone's pocket, so that
there is a little less money left there. Not in our case as it turns out, we
actually were adding money both to sender and receiver which is nice, but a
bit different from usual economic's expectations.
2020-06-05 19:20:16 +03:00
Roman Khimov
46cd14a892
Merge pull request #1002 from nspcc-dev/neo3/interop/sort_find
...
core: sort results of Storage.Find interop and NEO.getRegisterValidators
2020-05-30 15:34:41 +03:00
Anna Shaleva
8fb67615f8
core: sort results of Storage.Find and NEO.getRegisterValidators
...
Closes #909
We need to match elements order with C# implementation.
2020-05-29 17:33:01 +03:00
Roman Khimov
eec462b00c
network: fix Inv types for Neo 3
...
They actually use the same types as for messages. Fixes
2020-05-29T00:06:17.593+0300 WARN peer disconnected {"addr": "168.62.167.190:20333", "reason": "handling CMDInv message: invalid inventory type", "peerCount": 3}
2020-05-29 15:02:20 +03:00
Roman Khimov
56b24bf83e
capability: prevent panic on wrong capabilities receival
...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xad7b95]
goroutine 134 [running]:
github.com/nspcc-dev/neo-go/pkg/network/capability.(*Capability).DecodeBinary(0xc00024a300, 0xc00015c900)
/home/rik/dev/neo-go/pkg/network/capability/capability.go:69 +0x85
github.com/nspcc-dev/neo-go/pkg/io.(*BinReader).ReadArray(0xc00015c900, 0xd54880, 0xc00018ecd8, 0xc00071fbe0, 0x1, 0x1)
/home/rik/dev/neo-go/pkg/io/binaryReader.go:141 +0x22f
github.com/nspcc-dev/neo-go/pkg/network/capability.(*Capabilities).DecodeBinary(0xc00018ecd8, 0xc00015c900)
/home/rik/dev/neo-go/pkg/network/capability/capability.go:17 +0x6d
github.com/nspcc-dev/neo-go/pkg/network/payload.(*AddressAndTime).DecodeBinary(0xc00018ecc0, 0xc00015c900)
/home/rik/dev/neo-go/pkg/network/payload/address.go:34 +0x59
github.com/nspcc-dev/neo-go/pkg/io.(*BinReader).ReadArray(0xc00015c900, 0xcb9e00, 0xc00024a2a0, 0x0, 0x0, 0x0)
/home/rik/dev/neo-go/pkg/io/binaryReader.go:141 +0x22f
github.com/nspcc-dev/neo-go/pkg/network/payload.(*AddressList).DecodeBinary(0xc00024a2a0, 0xc00015c900)
/home/rik/dev/neo-go/pkg/network/payload/address.go:78 +0x54
github.com/nspcc-dev/neo-go/pkg/network.(*Message).decodePayload(0xc000277890, 0xc000292020, 0xc0003da000)
/home/rik/dev/neo-go/pkg/network/message.go:158 +0x31a
github.com/nspcc-dev/neo-go/pkg/network.(*Message).Decode(0xc000277890, 0xc00071ff48, 0xc00036e090, 0xc000276e40)
/home/rik/dev/neo-go/pkg/network/message.go:114 +0x19b
github.com/nspcc-dev/neo-go/pkg/network.(*TCPPeer).handleConn(0xc00036e090)
/home/rik/dev/neo-go/pkg/network/tcp_peer.go:154 +0x244
created by github.com/nspcc-dev/neo-go/pkg/network.(*TCPTransport).Dial
/home/rik/dev/neo-go/pkg/network/tcp_transport.go:40 +0x1ad
2020-05-29 00:11:54 +03:00
Anna Shaleva
1dffe0bea9
network: remove outdated fields
...
After #980 there were outdated fields present in message test.
2020-05-27 19:32:50 +03:00
Roman Khimov
a446821753
Merge pull request #980 from nspcc-dev/neo3/protocol/version_payload_optimisation
...
protocol: add node capabilities
2020-05-27 19:13:00 +03:00
Anna Shaleva
7547a3efe1
network: minor code refactoring
...
We need to handle IPv6 addresses correctly and net.JoinHostPort takes it
into account.
2020-05-27 19:04:09 +03:00
Anna Shaleva
8c5c248e79
protocol: add capabilities to address payload
...
Part of #871
2020-05-27 19:02:25 +03:00
Anna Shaleva
c590cc02f4
protocol: add capabilities to version payload
...
closes #871
2020-05-27 19:01:14 +03:00
Roman Khimov
fba4b20cc8
Merge pull request #989 from nspcc-dev/doc-update
...
Documentation update
2020-05-27 14:29:43 +03:00
Evgenii Stratonikov
f39b51deee
compiler: restore support for GetUnspentCoins
...
Revert a587274
.
2020-05-27 12:01:50 +03:00
Evgenii Stratonikov
44709cf6fe
core: make GetUnspentCoins interop return array, fix #978 .
2020-05-27 12:01:50 +03:00
Roman Khimov
77b92de074
interop: add some top-level doc.go
2020-05-27 12:01:50 +03:00
Roman Khimov
7e96f82a5b
compiler/interop: add support for working with witnesses
2020-05-27 12:01:50 +03:00
Roman Khimov
87e7e157ae
interop/util: extend documentation
2020-05-27 12:01:50 +03:00
Roman Khimov
85cc0639bb
interop/transaction: update documentation
2020-05-27 12:01:50 +03:00
Roman Khimov
e32d0e01af
compiler|transaction: remove transaction.GetUnspentCoins support
...
It's useless. Even though there is Neo.Transaction.GetUnspentCoins syscall
that can be used, its return type is an interop structure that's not accepted
by any other syscall, so you can't really do anything with it. And there is no
such interface for the .net Framework.
2020-05-27 12:01:50 +03:00
Roman Khimov
1cbd75ab9e
compiler|transaction: fix transaction.GetScript build, add to interop
...
There is no such syscall as Neo.Transaction.GetScript and GetScript should be
available for contract's use.
2020-05-27 12:01:50 +03:00
Roman Khimov
559e8a16da
compiler/storage: add read-only related interops
2020-05-27 12:01:50 +03:00
Roman Khimov
bfd8fe5960
interop/storage: update documentation
2020-05-27 12:01:50 +03:00
Roman Khimov
ddb9497649
interop/runtime: update documentation, fix Notify
...
Notify doesn't return anything!
2020-05-27 12:01:50 +03:00
Roman Khimov
6d2b2d7263
compiler/iterator: add missing iterator.Concat function
...
We have a syscall for it, so it should be exposed.
2020-05-27 12:01:50 +03:00
Roman Khimov
5733573d2e
Merge pull request #987 from nspcc-dev/neo3/protocol/compression
...
protocol: add payload compression
2020-05-26 23:31:17 +03:00
Anna Shaleva
0cbd7823ab
protocol: add payload compression
...
closes #872
2020-05-26 22:19:10 +03:00
Roman Khimov
01b5299355
interop/iterator: documentation update
2020-05-26 20:07:44 +03:00
Roman Khimov
2bf7329a15
interop/input|output: update documentation
2020-05-26 20:07:37 +03:00