Commit graph

154 commits

Author SHA1 Message Date
Evgeniy Kulikov
a5e85d69de Replace assertion for rpc/server_test.go (#156)
fix #155
fix circle-ci
2019-02-22 08:47:02 +01:00
dauTT
19201dcf52 Implemented rpc server method GetRawTransaction (#135)
* Added utility function GetVarSize

* 1) Added Size method: this implied that Fixed8 implements now the serializable interface. 2) Added few arithmetic operation (Add, Sub, div): this will be used to calculated networkfeeand feePerByte. Changed return value of the Value() method to int instead of int64. Modified fixed8_test accordingly.

* Implemented Size or MarshalJSON method.
- Structs accepting the Size method implement the serializable interface.
- Structs accepting the MarshalJSON method implements the customized json marshaller interface.

* Added fee calculation

* Implemented rcp server method GetRawTransaction

* Updated Tests

* Fixed:
1) NewFixed8 will accept as input int64
2) race condition affecting configDeafault, blockchainDefault

* Simplified Size calculation

* 1) Removed global variable blockchainDefault, configDefault
2) Extended Blockchainer interface to include the methods: References, FeePerByte, SystemFee, NetworkFee
3) Deleted fee_test.go, fee.go. Moved corresponding methods to blockchain_test.go and blockchain.go respectively
4) Amended tx_raw_output.go

* Simplified GetVarSize Method

* Replaced ValueAtAndType with ValueWithType

* Cosmetic changes + Added test case getrawtransaction_7

* Clean up Print statement

* Filled up keys

* Aligned verbose logic with the C#-neo implementation

* Implemented @Kim requests
Refactor server_test.go

* Small fixes

* Fixed verbose logic
Added more tests
Cosmetic changes

* Replaced assert.NoError with require.NoError

* Fixed tests by adding context.Background() as argument

* Fixed tests
2019-02-20 18:39:32 +01:00
Evgeniy Kulikov
20bb05b335 Fix #140 (improve error message) (#142)
- return errors like in C# code (neo-project/neo#587)
- update tests
- small refactoring
2019-02-20 16:28:11 +00:00
Anastasia Prasolova
a56511ced3 PublicKey from serialized bytes (#154)
* small fixes

* gofmt

* fix in raw tx build

* fixes after review

* balance getter interface

* moved address and signature calculation to public key

* errors handling

* PublicKey() returns PublicKey instead of bytes slice

* fixes after review

* fixes after review

* public key creation from asn1 serialized key
2019-02-20 14:34:28 +01:00
Anastasia Prasolova
2fd2866f7f Key signature and wallet address get functions added to Public key (#144)
* small fixes

* gofmt

* fix in raw tx build

* fixes after review

* balance getter interface

* moved address and signature calculation to public key

* errors handling

* PublicKey() returns PublicKey instead of bytes slice

* fixes after review

* fixes after review
2019-02-19 18:37:35 +00:00
Evgeniy Kulikov
cdba88b9f2 Code refactoring (#143)
- simplify code
- prealoc slices
- check errors in tests
- regexp Compile replaced with MustCompile
- uint* cannot be negative
2019-02-19 14:22:33 +01:00
Evgeniy Kulikov
9c24bf9139 Blockchain graceful shutdown (#139)
* Blockchain graceful shutdown

- fix #138
- stop blockchain goroutine
- close leveldb database

* fix possible context leak (go vet)
2019-02-19 12:48:48 +01:00
Evgeniy Kulikov
c0a5c100ca Fix API documentation link (#141) 2019-02-19 12:48:02 +01:00
57cb289bcd make State a set as in reference C# implementation (#123)
* make State a set as in reference C# implementation

* fix issues
2019-02-19 12:47:25 +01:00
Evgeniy Kulikov
001a0e601e Add RPC Server method ValidateAddress (#134)
* Add RPC Server method ValidateAddress

- implement rpc method validateaddress (https://docs.neo.org/en-us/node/cli/2.9.4/api/validateaddress.html)
- add tests
- add to README.md

* revert go.sum

* remove break

* more tests and C# errors

* simplify

* fix after master merge
2019-02-13 18:18:47 +00:00
Evgeniy Kulikov
763452fe33 Fix #130: Wrong answer for RPC server method getaccountstate (#131)
* Fix #130: Wrong answer for RPC server method getaccountstate

- fixed RPC Server response
- fixed RPC Server tests
- remove unused package from go.mod

* add index and type checker

* fix review comments (thx @aprasolova)
2019-02-13 18:01:52 +00:00
Evgeniy Kulikov
67cbcac643 Fix typos (#133)
* Fix typos

* revert chains/unit_testnet

* revert chains

* fix review comments (thx @AlexVanin)
2019-02-13 18:01:10 +00:00
Evgeniy Kulikov
845d719698 Fix possible data race (#136)
- balancer / wif / http.Client could be with data race
- add getter / setter with sync.Mutex
- now http.Client is pointer
- now you can provide your http.Client to rpcClient
2019-02-12 20:03:21 +01:00
Evgeniy Kulikov
630919bf7d Fix typos and warnings for GoReport / GolangCiLinter (#132)
- typos
- gofmt -s
- govet warnings
- golangci-lint run
2019-02-09 16:53:58 +01:00
Anastasia Prasolova
d183ea3c1f BalanceGetter interface shortened (#127)
* small fixes

* gofmt

* fix in raw tx build

* fixes after review

* balance getter interface
2019-02-08 16:32:01 +01:00
dauTT
7e43717657 Implemented rcp method GetAccountState (#124)
* Implemented rcp method GetAccountState

* code clean up

* Removed empty line

* Used consistently github.com/pkg/errors package. Amended error message

* Get rid of fmt.Sprintf and use either errors.Errorf or errors.Wrapf

* cosmetic changes
2019-02-08 09:04:38 +01:00
Anastasia Prasolova
a5e2df6942 small fix of utxo calculation on raw transaction build (#126)
* small fixes

* gofmt

* fix in raw tx build

* fixes after review
2019-02-07 12:44:51 +01:00
Anastasia Prasolova
a058598ecc Parse stack params (#119)
* small fixes

* gofmt

* bytearray parsing

* tests

* removed unnecessary files

* added more types for bytearray

* iter

* made TryParseArray parameter variadic

* fixes after review

* fix after review

* misprints

* updated array reverse

* imports/fmt

* naming
2019-02-05 13:22:10 +01:00
Evgeniy Kulikov
7c1147f04f [FIX] http/Transport.Dial is deprecated (#125)
---

cc @anthdm / @fyrchik / @aprasolova / @AlexVanin / @decentralisedkev
2019-02-05 09:29:39 +01:00
Evgeniy Kulikov
9252937375 Simplify code and improve performance (crypto/PublicKey.DecodeBinary) (#121)
- optimize crypto/PublicKey.DecodeBinary
- add new method crypto/PublicKey.DecodeBytes
2019-01-28 13:03:02 +01:00
Evgeniy Kulikov
f000b76879 [FIX] Formatting and code-style (#118)
* [FIX] Formatting and code-style

- gofmt
- import resort
- prealloc slices
- simplify code

* fix vet
2019-01-25 12:20:35 +01:00
df2e9f68ef Add StackParam JSON Unmarshaler (#116) 2019-01-22 13:15:04 +01:00
dauTT
1360e1de68 Added rpc unit tests (#107)
* Fixed small incosistencies related to comments and variable name

* For testing purposes we have to move the method newBlockchain from the cli/server/server.go to  pkg/core/blockchain.go. In addition we have to rename it to NewBlockchainLevelDB in order to be able to export it and avoid naming conflicts. In future we still need to think how to switch between different blockchain implementation easily but for the time being this is not possible.

* Added unit tests for the rpc server

* Added unit_testnet chain fixture

* fixed port number

* Added errors handling

* move unit_testnet chain from 'cli/chains' to 'pkg/rpc/chains'
2019-01-22 13:14:52 +01:00
Anastasia Prasolova
77296f6481 Small fixes (#117)
* small fixes

* gofmt
2019-01-22 13:14:40 +01:00
Anastasia Prasolova
74f0019df2 SendToAddress RPC call (#114)
* func to get private key from raw bytes

* added function to create raw transfer tx

* fixes

* more fixes

* prettify code and comments; neoscan interaction put in dedicated files
2018-12-21 10:32:18 +01:00
Anthony De Meulemeester
9c605735b7
[WIP] Remove version from CI (#111)
* removed version from CI

* removed more version deps
2018-12-06 11:32:52 +01:00
Evgeniy Kulikov
3305782ac9 Remove mention of the bump version (#112)
Relates to [https://github.com/CityOfZion/neo-go/issues/110#issuecomment-444820802](issue)
2018-12-06 11:31:41 +01:00
Anastasia Prasolova
fa1da2cb91 Function to get private key from ASN.1 serialized structure (#109)
* func to get privkey from raw bytes

* comments fix

* review fixes; version

* version
2018-12-05 20:04:31 +01:00
Sathvik Birudavolu
5b57a10250 Fix NEP2Encrypt add Unit Tests (#108)
* fix NEP2 add unit tests

* version update
2018-12-05 12:30:13 +01:00
dauTT
e2f42e92a0 Implemented rcp method GetAssetState (#103)
* Fix missing dot in configPath

* Add rpc GetAssetState method

* Update rpc README.md

* Update version to 0.45.10
2018-11-26 22:12:33 +01:00
aprasolova
de45c58551 RPC invocation parameters (#106)
* added rpc.invoke and parameters marshalling

* removed debug output

* stringer and marshalling corrections

* version
2018-11-26 16:57:53 +01:00
Evgeniy Kulikov
6ccb518ab0 Optimizations + some improvements (#105)
* Optimizations + some improvements

- optimized pkg/core/storage.HeaderHashes
- optimized pkg/rpc.performRequest (used json.Encoder)
- fixes for pkg/util.ReadVarUint and pkg/util.WriteVarUint
- optimized and fix fixed8 (Fixed8DecodeString / MarshalJSON) + tests
- optimized and fix uint160 (Bytes / Uint160DecodeString / Equal / MarshalJSON) + tests
- optimized and fix uint256 (Bytes / Equal / MarshalJSON) + tests
- preallocate for pkg/vm.buildStackOutput
- add go.mod / go.sum

* update version
2018-11-26 16:56:45 +01:00
Anthony De Meulemeester
c8d7671d26
Updated readme with new location of the neo-storm repository (#101) 2018-09-27 08:27:32 +02:00
Anthony De Meulemeester
903bb86f96
Task/fix sc template (#100)
* Fixed security issue in smart contract template

* Bumped version

* fixed typo
2018-09-27 08:21:31 +02:00
Anthony De Meulemeester
d77354db66
Add missing compiler interop API functions (#93)
* added runtime serialize and deserialize functions

* removed getCurrentBlock from runtime functions

* Added block and header stdlib interop functions

* added transaction interop api

* added asset interop api

* bumped version

* Added missing storage.Find storage API function

* Fixed wrong example in the compiler README

* updated the compiler README to be more accurate on compiler features
2018-08-19 20:47:10 +02:00
Anthony De Meulemeester
34a37ff51d
added filter payloads for spv client compliance (#90)
* added filter payloads for spv client compliance

* bumped version
2018-08-10 16:32:49 +02:00
suzumi49n
2bc023b7e0 Fix/args config path (#91)
* fix args config path

* update version
2018-07-22 08:46:49 +02:00
Anthony De Meulemeester
311313f2ff
implemented smart contract utility function FromAddress (#88)
* implemented smart contract utility function FromAddress

* bumped version
2018-07-02 15:02:00 +02:00
4bd4635e49 add rpc.GetRawTransaction() method (#87) 2018-06-27 07:48:39 +02:00
f69451d36d Add Error fields to RPC responses (#84)
Also add `Script` field to `InvokeResult` structure.
2018-05-13 20:32:45 +02:00
1d9045877c Add JSON unmarshallers for numeric types from util (#83)
Uint160, Uint256, Fixed8 now have UnmarshalJSON method.
2018-05-09 07:20:16 +02:00
Anthony De Meulemeester
35551282b0
Porting the NEX ICO template to neo-go as first class smart contract example (#78)
* Initial draft of the ICO template ported from NEX.

* filled in token configuration

* added kyc storage prefix

* fixed byte array conversion + added tests

* fixed broken test + made 1 file for the token sale example.

* implemented the NEP5 handlers

* bumped version
2018-05-06 08:03:26 +02:00
0ca8865402 add ParseString constructor to util.Fixed8 (#79) 2018-05-04 19:41:42 +02:00
cff42de061 Add proper field names for JSON RPC (#80) 2018-05-04 19:15:35 +02:00
Steven Jack
68ca254dd2 Adds basic docker-compose support for standing up a cluster (#74)
* Adds docker-compose support

* Remove old config

* Bump port numbers so doesnt conflict with running dev version

* Update privnet node  list
2018-04-28 20:20:27 +02:00
Anthony De Meulemeester
648563c3e2
Compiler (#73)
Compiler and VM update
2018-04-22 20:11:37 +02:00
Steven Jack
a73757df66 Install missing dep (#72) 2018-04-19 19:57:12 +02:00
Anthony De Meulemeester
2cdfee211a
Persisting more states (#71)
* added persistence of assets and spentcoins.

* contract params

* bumped version
2018-04-16 22:15:30 +02:00
Steven Jack
7883f305e7 Docker setup (#70)
* Adds docker setup

* Add build args

* Remove spaec

* Bump version

* Adds run prefix
2018-04-16 10:41:23 +02:00
Steven Jack
8ea013ab60 Incorrect import (#69)
* Update incorrect import

* Bumps version
2018-04-15 18:56:18 +02:00