Test fixes and removed old code. Added VM gas fees

This commit is contained in:
obscuren
2014-03-24 13:20:34 +01:00
parent 6a86c517c4
commit e0b6091d7e
7 changed files with 103 additions and 111 deletions

View File

@ -36,6 +36,7 @@ func CurrencyToString(num *big.Int) string {
var (
Big1 = big.NewInt(1)
Big2 = big.NewInt(1)
Big0 = big.NewInt(0)
Big256 = big.NewInt(0xff)
)

View File

@ -131,7 +131,7 @@ func Instr(instr string) (int, []string, error) {
// Script compilation functions
// Compiles strings to machine code
func Compile(instructions ...interface{}) (script []string) {
func Assemble(instructions ...interface{}) (script []string) {
script = make([]string, len(instructions))
for i, val := range instructions {

View File

@ -2,6 +2,7 @@ package ethutil
import (
"bytes"
"fmt"
"math/big"
"reflect"
"testing"
@ -119,6 +120,11 @@ func TestEncodeDecodeBytes(t *testing.T) {
}
}
func TestEncodeZero(t *testing.T) {
b := NewValue(0).Encode()
fmt.Println(b)
}
func BenchmarkEncodeDecode(b *testing.B) {
for i := 0; i < b.N; i++ {
bytes := Encode([]interface{}{"dog", "god", "cat"})

View File

@ -1,7 +1,7 @@
package ethutil
import (
"fmt"
_ "fmt"
"reflect"
"testing"
)