diff options
author | obscuren <geffobscura@gmail.com> | 2014-03-24 20:20:34 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-03-24 20:20:34 +0800 |
commit | e0b6091d7ef709902f534c1a4b57151f0171e03c (patch) | |
tree | 290fa26d9da264a5e365816a80c42f325adb51ef /ethutil | |
parent | 6a86c517c4f4b372cad0ae1d92e926a482eac5ba (diff) | |
download | dexon-e0b6091d7ef709902f534c1a4b57151f0171e03c.tar.gz 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.go | 1 | ||||
-rw-r--r-- | ethutil/parsing.go | 2 | ||||
-rw-r--r-- | ethutil/rlp_test.go | 6 | ||||
-rw-r--r-- | ethutil/trie_test.go | 2 |
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" ) |