diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-13 18:45:11 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-13 18:45:11 +0800 |
commit | d078e9b8c92fb3bd5789a8e39c169b19864e0a04 (patch) | |
tree | 34ce9defddbd84364e681362eef072fa5e5dab97 /ethchain/asm.go | |
parent | b855e5f7df194c84651d7cc7ee32d307a2fa0a2e (diff) | |
download | dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.gz dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.bz2 dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.lz dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.xz dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.tar.zst dexon-d078e9b8c92fb3bd5789a8e39c169b19864e0a04.zip |
Refactoring state transitioning
Diffstat (limited to 'ethchain/asm.go')
-rw-r--r-- | ethchain/asm.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/ethchain/asm.go b/ethchain/asm.go index 430a89450..277326ff9 100644 --- a/ethchain/asm.go +++ b/ethchain/asm.go @@ -25,16 +25,10 @@ func Disassemble(script []byte) (asm []string) { pc.Add(pc, ethutil.Big1) a := int64(op) - int64(PUSH1) + 1 data := script[pc.Int64() : pc.Int64()+a] - val := ethutil.BigD(data) - - var b []byte - if val.Int64() == 0 { - b = []byte{0} - } else { - b = val.Bytes() + if len(data) == 0 { + data = []byte{0} } - - asm = append(asm, fmt.Sprintf("0x%x", b)) + asm = append(asm, fmt.Sprintf("0x%x", data)) pc.Add(pc, big.NewInt(a-1)) } |