Test fixes and removed old code. Added VM gas fees
This commit is contained in:
@ -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)
|
||||
)
|
||||
|
@ -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 {
|
||||
|
@ -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"})
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ethutil
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
_ "fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
Reference in New Issue
Block a user