Refactor of imports + lots of sweet stuff (#30)

* implemented global variables.

* refactored imports + lots and lots of other sweet stuff + fix #28.

* Implemented the VM interop runtime API (GetTrigger, CheckWitness, ...)
This commit is contained in:
Anthony De Meulemeester 2018-02-25 13:26:56 +01:00 committed by GitHub
parent 63bc244163
commit de3395fb51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 344 additions and 158 deletions

View file

@ -32,14 +32,11 @@ func TestAllCases(t *testing.T) {
testCases = append(testCases, structTestCases...)
testCases = append(testCases, ifStatementTestCases...)
testCases = append(testCases, customTypeTestCases...)
// TODO: issue #28
// These tests are passing locally, but circleci is failing to resolve the dependency.
// https://github.com/CityOfZion/neo-go/issues/28
// testCases = append(testCases, importTestCases...)
testCases = append(testCases, constantTestCases...)
testCases = append(testCases, importTestCases...)
// Blockchain specific
// testCases = append(testCases, storageTestCases...)
testCases = append(testCases, storageTestCases...)
for _, tc := range testCases {
b, err := compiler.Compile(strings.NewReader(tc.src), &compiler.Options{})
@ -54,8 +51,7 @@ func TestAllCases(t *testing.T) {
if bytes.Compare(b, expectedResult) != 0 {
t.Log(hex.EncodeToString(b))
want, _ := hex.DecodeString(tc.result)
dumpOpCodeSideBySide(b, want)
dumpOpCodeSideBySide(b, expectedResult)
t.Fatalf("compiling %s failed", tc.name)
}
}