Commit graph

17 commits

Author SHA1 Message Date
decentralisedkev
dc5de1fa6d
[Peer] Refactor (#240)
[Peer]

- Closes #239

- moved response handlers to their own functions

- removed DefaultConfig from LocalConfig file

- passed peer as a parameter to all response handlers

- added peer start height

- refactored NewPeer function to be more concise and clear

- removed empty lines at end of functions

- Added AddMessage/RemoveMessage for Detector in outgoing and ingoing
requests for Block and Headers
2019-03-28 19:09:55 +00:00
dauTT
ce1fe72607 Finalized size calculation methodology (#215)
- Simplified Transactioner interface
-  Added size calculation test
- Added utility methods in the address pkg: FromUint160, Uint160Decode
2019-03-25 01:04:54 +00:00
dauTT
beab4d186f Fixed Txn Attribute econding/decoding (issue: #216) (#217) 2019-03-24 23:11:54 +00:00
decentralisedkev
7d84d44b08
[chain] (#209)
- Add basic skeleton for chain struct
2019-03-23 19:09:25 +00:00
decentralisedkev
30e5aa8f48
Add Chain saving functionality to Database (#206)
* [database]

- Add Prefix method to interface
- Convert leveldb error to `database error`
- Be explicit with prefixedKey in `Table` as slices can be pointers

* [protocol]
- Add stringer method to protocol

* [Chaindb]

- Added saveBlock() which will allow us to save a block into the
database. The block is broken up into transactions and Headers. The
headers are saved as is. The transactions are saved as is, then the
utxos in the transactions are collected to make the utxo db.

- Verification for blocks and transactions will reside in the same
package. Note that the save methods are all unexported, while the Get
methods are exported. Making it so that any can call a get method, but
only code in this package may save to the database. The other code which
will reside in this package will be code verification logic.

* [chaindb]

- Added saveHeader function which saveHeaders  uses

- Update the latest header, each time we save a header instead of after a batch. This is so that we can call saveHeader without saveHeaders. This functionality can be rolled back if the performance of updating the header after a batch is significant

- small refactor in test code
2019-03-23 16:57:05 +00:00
dauTT
6f496754fb 1) Fixed String method in Uint256 (#208)
2) Added ReverseString Method to Uint256
2019-03-23 16:52:36 +00:00
decentralisedkev
e12255dd73
[connmgr] Refactor Connmgr (#205)
* [connmgr]

- Refactor Connmgr
- Remove un-needed async code
- Add comment for Request
2019-03-21 23:18:02 +00:00
decentralisedkev
9a1ef38689
[Database] (#202)
Remove unnecesary methods
2019-03-21 21:28:03 +00:00
decentralisedkev
c1b6738bdb
VM: Add basic vm (#166)
* VM:Add abstract stack item

* VM: Add stackItems; Array, Boolean, Int and ByteArray

* VM: Add tests for stack item

* VM: first pass at Random Access Stack object

* VM: Add Sub, Mul, Mod LSH, RSH

* VM: moved test helper functions into separate file

* VM: removed helper functions from stack_test.go

* Add conversions for bytearray and Int stack items

* Add instructions file for vm

* - Add guide to stack readme
- Add testReadInt64

* Add Builder

* Refactor Int, Boolean, ByteArray conversion

* Add Context stack Item

* Add Invocation stack - convenience RAS

* rename testhelper to test_helper

* Move opcode file

* - Add `Add` OpCode
- Add Opcode Function map

* - Add test for math `Add` opcode
- basic opcode execution

* Add popTwoIntegers convenience func

* Add `SUB` Opcode

* Export Context Read methods
- Return errors where failable

* - Add `Op` to handleOP func signature
- Add PushNBytes OPcode

* remove error on NewBoolean
- Expose underlying with Getter on Boolean StackItem
- Add Equals method for ByteArray

* Make Next() method on Context failable, refactor peekContext and Peek

* Add ExecuteOp, Step and Run methods on the VM

* Add Equal Opcode

* Add THROWIFNOT Opcode

* Add RET Opcode

* Refactor PushNBytes Opcode

* refactor Add, Sub to return VMSTATE
add popTwoByteArrays helper function

* Add basic tests for vm

* clarify vm states

* Add astack

* [VM]

Pass ResultStack to the opcode handlers

* [VM]

refactor handlers to have rstack as argument

* [Stack]

- Change RemoveCurrentContext for PopCurrentContext
- Add CopTo method to stack

* [VM]

Add Result stack Len check in simple run test

* [VM] fix typo

* [Peer/Stall]

Change seconds to milliseconds in test
2019-03-18 21:40:21 +00:00
BlockChainDev
de3137197a remove extra base58 2019-03-17 23:02:34 +00:00
decentralisedkev
f8979fe7af
Fix lint errors (#182)
* golint and minor changes to make code readable
2019-03-17 18:26:35 +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