Fixed minor issue with gas and added state object init
This commit is contained in:
@@ -1,32 +1,31 @@
|
||||
package ethutil
|
||||
|
||||
/*
|
||||
import (
|
||||
"math"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCompile(t *testing.T) {
|
||||
instr, err := CompileInstr("PUSH")
|
||||
|
||||
if err != nil {
|
||||
t.Error("Failed compiling instruction")
|
||||
func TestPreProcess(t *testing.T) {
|
||||
main, init := PreProcess(`
|
||||
init {
|
||||
// init
|
||||
if a > b {
|
||||
if {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
calc := (48 + 0*256 + 0*int64(math.Pow(256, 2)))
|
||||
if BigD(instr).Int64() != calc {
|
||||
t.Error("Expected", calc, ", got:", instr)
|
||||
main {
|
||||
// main
|
||||
if a > b {
|
||||
if c > d {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidInstr(t *testing.T) {
|
||||
op, args, err := Instr("68163")
|
||||
if err != nil {
|
||||
t.Error("Error decoding instruction")
|
||||
}
|
||||
`)
|
||||
|
||||
fmt.Println("main")
|
||||
fmt.Println(main)
|
||||
fmt.Println("init")
|
||||
fmt.Println(init)
|
||||
}
|
||||
|
||||
func TestInvalidInstr(t *testing.T) {
|
||||
}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user