aboutsummaryrefslogtreecommitdiffstats
path: root/block.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-28 09:24:16 +0800
committerobscuren <obscuren@obscura.com>2013-12-28 09:24:16 +0800
commitbb8afba20a56552cef71681f72fb192bcda88c1d (patch)
tree4e309fadf96cc09f54e433c0af9dfe02e1932490 /block.go
parent5a7eae705b83d75cb780279e386f183c4b6e19c6 (diff)
downloadgo-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar.gz
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar.bz2
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar.lz
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar.xz
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.tar.zst
go-tangerine-bb8afba20a56552cef71681f72fb192bcda88c1d.zip
Updated tests
Diffstat (limited to 'block.go')
-rw-r--r--block.go27
1 files changed, 17 insertions, 10 deletions
diff --git a/block.go b/block.go
index f8bf2ce3b..f666b09db 100644
--- a/block.go
+++ b/block.go
@@ -1,7 +1,7 @@
package main
import (
- _"fmt"
+ "fmt"
"time"
)
@@ -44,21 +44,28 @@ func (block *Block) MarshalRlp() []byte {
encTx[i] = string(tx.MarshalRlp())
}
- enc := RlpEncode([]interface{}{
+ header := []interface{}{
block.number,
- block.prevHash,
+ //block.prevHash,
// Sha of uncles
- block.coinbase,
+ //block.coinbase,
// root state
- Sha256Bin([]byte(RlpEncode(encTx))),
- block.difficulty,
- block.time,
- block.nonce,
+ //Sha256Bin([]byte(RlpEncode(encTx))),
+ //block.difficulty,
+ //block.time,
+ //block.nonce,
// extra?
- })
+ }
- return []byte(enc)
+ return Encode([]interface{}{header, encTx})
}
func (block *Block) UnmarshalRlp(data []byte) {
+ fmt.Printf("%q\n", data)
+ t, _ := Decode(data,0)
+ if slice, ok := t.([]interface{}); ok {
+ if txes, ok := slice[1].([]interface{}); ok {
+ fmt.Println(txes[0])
+ }
+ }
}