aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-24 20:20:34 +0800
committerobscuren <geffobscura@gmail.com>2014-03-24 20:20:34 +0800
commite0b6091d7ef709902f534c1a4b57151f0171e03c (patch)
tree290fa26d9da264a5e365816a80c42f325adb51ef /ethutil
parent6a86c517c4f4b372cad0ae1d92e926a482eac5ba (diff)
downloaddexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.gz
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.bz2
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.lz
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.xz
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.zst
dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.zip
Test fixes and removed old code. Added VM gas fees
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/common.go1
-rw-r--r--ethutil/parsing.go2
-rw-r--r--ethutil/rlp_test.go6
-rw-r--r--ethutil/trie_test.go2
4 files changed, 9 insertions, 2 deletions
diff --git a/ethutil/common.go b/ethutil/common.go
index f15b10e6d..c63af29a6 100644
--- a/ethutil/common.go
+++ b/ethutil/common.go
@@ -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)
)
diff --git a/ethutil/parsing.go b/ethutil/parsing.go
index 8929f0829..16ed2d06d 100644
--- a/ethutil/parsing.go
+++ b/ethutil/parsing.go
@@ -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 {
diff --git a/ethutil/rlp_test.go b/ethutil/rlp_test.go
index 2a58bfc0f..dc10db632 100644
--- a/ethutil/rlp_test.go
+++ b/ethutil/rlp_test.go
@@ -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"})
diff --git a/ethutil/trie_test.go b/ethutil/trie_test.go
index 79e5de921..0be512d9f 100644
--- a/ethutil/trie_test.go
+++ b/ethutil/trie_test.go
@@ -1,7 +1,7 @@
package ethutil
import (
- "fmt"
+ _ "fmt"
"reflect"
"testing"
)