Commit graph

688 commits

Author SHA1 Message Date
BlockChainDev
329f8f388c Add ExecuteOp, Step and Run methods on the VM 2019-03-16 22:05:00 +00:00
BlockChainDev
a7e973030c Remove context_test
rename invocation to invocationstack
export vmstate
2019-03-16 21:52:05 +00:00
BlockChainDev
9eb11d2822 Make Next() method on Context failable
refactor peekContext and Peek
2019-03-16 21:45:48 +00:00
BlockChainDev
48413900ca remove error on NewBoolean
Expose underlying with Getter on Boolean StackItem
Add Equals method for ByteArray
2019-03-16 21:44:03 +00:00
BlockChainDev
80fd427517 - Add Op to handleOP func signature
- Add PushNBytes OPcode
2019-03-15 23:37:54 +00:00
BlockChainDev
9a59755745 Export Context Read methods
- Return errors where failable
2019-03-15 23:21:30 +00:00
BlockChainDev
280d526f41 Add SUB Opcode 2019-03-15 22:55:08 +00:00
BlockChainDev
abc3b46f1c Add popTwoIntegers convenience func 2019-03-15 22:54:52 +00:00
BlockChainDev
baf9d2b768 - Add test for math Add opcode
- basic opcode execution
2019-03-15 22:42:35 +00:00
BlockChainDev
c7fb4c3bdf - Add Add OpCode
- Add Opcode Function map
2019-03-15 22:36:16 +00:00
BlockChainDev
101d48cd27 Move opcode file 2019-03-15 22:35:12 +00:00
BlockChainDev
ce2cad0817 rename testhelper to test_helper 2019-03-15 22:34:04 +00:00
BlockChainDev
f954e6f2ca Add Invocation stack - convenience RAS 2019-03-15 22:33:32 +00:00
BlockChainDev
1ff0caf40e Add Context stack Item 2019-03-15 22:32:08 +00:00
BlockChainDev
04c56b514c Refactor Int, Boolean, ByteArray conversion 2019-03-15 22:30:25 +00:00
BlockChainDev
e2ef6bd2f4 Add Builder 2019-03-15 22:27:34 +00:00
BlockChainDev
f60d65f1a4 - Add guide to stack readme
- Add testReadInt64
2019-02-28 13:51:02 +00:00
BlockChainDev
5789aba4b2 Add instructions file for vm 2019-02-27 22:52:58 +00:00
BlockChainDev
ce614cfbec Merge branch 'dev' into vm 2019-02-27 22:45:56 +00:00
BlockChainDev
da0a56f922 Add conversions for bytearray and Int stack items 2019-02-27 22:41:46 +00:00
BlockChainDev
8d55ea12f0 VM: removed helper functions from stack_test.go 2019-02-27 21:40:31 +00:00
BlockChainDev
263bc4c1b1 VM: moved test helper functions into separate file 2019-02-27 21:38:39 +00:00
BlockChainDev
64491a4d83 VM: Add Sub, Mul, Mod LSH, RSH 2019-02-27 21:38:11 +00:00
BlockChainDev
c163ae2019 VM: first pass at Random Access Stack object 2019-02-27 20:58:17 +00:00
BlockChainDev
b79602cc5d VM: Add tests for stack item 2019-02-27 20:56:19 +00:00
BlockChainDev
d8d27761ae VM: Add stackItems; Array, Boolean, Int and ByteArray 2019-02-27 20:55:48 +00:00
BlockChainDev
e29b85d0d7 VM:Add abstract stack item 2019-02-27 20:50:00 +00:00
Evgeniy Kulikov
94eb16c9ca Add CircleCI to dev-branch (#165) 2019-02-27 13:49:16 +00:00
Evgeniy Kulikov
bf16bcfc35 Setup TravisCI for dev branch (#161)
fix #157

before merge, needs #160 to be merged

Just need enable TravisCI, who has write access for this repo
2019-02-26 20:30:05 +00:00
Evgeniy Kulikov
926dd20792 Fix possible data race in pkg/stall (#163)
fix #162
2019-02-26 17:28:38 +00:00
Evgeniy Kulikov
1d1f81e168 Add go.mod to dev-branch (#160)
fix #158
2019-02-26 16:31:07 +00:00
BlockChainDev
7eafd1ac17 Remove extraneous packages 2019-02-25 22:44:56 +00:00
BlockChainDev
cda7a31e4e Initial commit 2019-02-25 22:44:14 +00:00
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