Commit graph

22 commits

Author SHA1 Message Date
Roman Khimov
ddd1d92ff1 pkg: hide it by moving to _pkg.dev
The idea here is to preserve the history of `dev` branch development and its
code when merging with the `master`. Later this code could be moved into the
masters code where appropriate.
2019-08-20 18:39:50 +03:00
Roman Khimov
2ddf1d15ab
Merge branch 'dev' into vm 2019-08-12 19:12:19 +03:00
Roman Khimov
bab187f4a8 pkg/vm: drop bogus err check in BoolAnd() and BoolOr()
GolangCI:
  nilness: impossible condition: nil != nil (from govet)
2019-08-12 18:00:54 +03:00
dauTT
6d2fb5d89f
Merge branch 'vm' into dauTT/vm-implement-MIN-MAX-WITHIN-opcodes-230 2019-04-03 20:36:54 +02:00
dauTT
045db09af2 Implemented LTE, GTE opcode (#260)
* Implemented LTE, GTE opcode
2019-04-02 23:43:52 +01:00
dauTT
7bf4d691a9 Implemented NUMEQUAL, NUMNOTEQUAL opcode (#256) 2019-03-30 15:01:06 +00:00
dauTT
1fbc0af5db VM: Implement BOOLAND, BOOLOR opcode (#251)
* Implemented BOOLAND, BOOLOR opcode
2019-03-29 21:22:44 +00:00
dauTT
9402540c3a Implemented LT, GT opcode (#259)
* Implemented LT, GT opcode
2019-03-29 19:35:16 +00:00
DauTT
d818c16297 Implemented MIN, MAX WITHIN opcode 2019-03-29 17:43:16 +01:00
dauTT
955bb373fc Implemented SHL, SHR opcode (#250) 2019-03-28 22:28:20 +00:00
dauTT
84b4b41288 Implemented DIV, MOD opcode (#237) 2019-03-28 20:32:32 +00:00
dauTT
139b770712 Implemented NZ, MUL opcode (#235) 2019-03-28 19:47:47 +00:00
dauTT
afe670f178 VM: Implement, ABS, NOT opcode (#233)
* Implemented, ABS, NOT opcode
2019-03-28 19:26:55 +00:00
dauTT
14e0ab48dd VM: Implemented SIGN, NEGATE opcode (#232)
* Implemented SIGN, NEGATE opcode
2019-03-28 18:30:36 +00:00
dauTT
d8e399f67d VM: Implement INC, DEC opcode (#231)
[VM]

- Implemented INC, DEC opcode
2019-03-26 23:15:13 +00:00
dauTT
24cd21bd8c VM:Implement THROW opcode (#219)
[VM]

- Changed vmstate from HALT to FAULT in Sub opcode
- Implemented THROW opcode + tests
- Renamed TestSimpleRun test to TestThrowIfNot
2019-03-26 21:19:41 +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
c177e5577e [VM]
refactor handlers to have rstack as argument
2019-03-18 21:14:03 +00:00
BlockChainDev
17c53d1081 refactor Add, Sub to return VMSTATE
add popTwoByteArrays helper function
2019-03-16 22:09:34 +00:00
BlockChainDev
80fd427517 - Add Op to handleOP func signature
- Add PushNBytes OPcode
2019-03-15 23:37:54 +00:00
BlockChainDev
abc3b46f1c Add popTwoIntegers convenience func 2019-03-15 22:54:52 +00:00
BlockChainDev
c7fb4c3bdf - Add Add OpCode
- Add Opcode Function map
2019-03-15 22:36:16 +00:00