Base wallet implementation (#35)

* Initial draft of the neo-go wallet

* Cleanup + more test for util package

* integrated wallet into neo-cli partially

* base wallet implementation + smartcontract code.
This commit is contained in:
Anthony De Meulemeester 2018-03-02 16:24:09 +01:00 committed by GitHub
parent 942650dd8b
commit f3f6662fc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1754 additions and 87 deletions

25
pkg/util/array_test.go Normal file
View file

@ -0,0 +1,25 @@
package util
import (
"bytes"
"testing"
)
func TestArrayReverse(t *testing.T) {
arr := []byte{0x01, 0x02, 0x03, 0x04}
have := ArrayReverse(arr)
want := []byte{0x04, 0x03, 0x02, 0x01}
if bytes.Compare(have, want) != 0 {
t.Fatalf("expected %v got %v", want, have)
}
}
// This tests a bug that occured with arrays of size 1
func TestArrayReverseLen2(t *testing.T) {
arr := []byte{0x01}
have := ArrayReverse(arr)
want := []byte{0x01}
if bytes.Compare(have, want) != 0 {
t.Fatalf("expected %v got %v", want, have)
}
}