aboutsummaryrefslogtreecommitdiffstats
path: root/block.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-11 04:18:56 +0800
committerobscuren <geffobscura@gmail.com>2014-01-11 04:18:56 +0800
commitf6fa4f88797030b8e83066cb262a68958953974e (patch)
treee8f8090d735defade1d7e8b313bf1d75f24c0663 /block.go
parentdbd28a52525581b59fb334f2aafa3b2b56fb6ba8 (diff)
downloadgo-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar.gz
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar.bz2
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar.lz
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar.xz
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.tar.zst
go-tangerine-f6fa4f88797030b8e83066cb262a68958953974e.zip
WIP Splitting ethereum up in submodules
Diffstat (limited to 'block.go')
-rw-r--r--block.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/block.go b/block.go
index 6ae3cc832..2287a9d55 100644
--- a/block.go
+++ b/block.go
@@ -51,7 +51,15 @@ func CreateTestBlock(/* TODO use raw data */transactions []*Transaction) *Block
return block
}
-func CreateBlock(root string, num int, prevHash string, base string, difficulty int, nonce int, extra string, txes []*Transaction) *Block {
+func CreateBlock(root string,
+ num int,
+ prevHash string,
+ base string,
+ difficulty int,
+ nonce int,
+ extra string,
+ txes []*Transaction) *Block {
+
block := &Block{
// Slice of transactions to include in this block
transactions: txes,
@@ -134,8 +142,11 @@ func (block *Block) MarshalRlp() []byte {
// Cast it to a string (safe)
encTx[i] = string(tx.MarshalRlp())
}
+ // TODO
+ uncles := []interface{}{}
- /* I made up the block. It should probably contain different data or types. It sole purpose now is testing */
+ // I made up the block. It should probably contain different data or types.
+ // It sole purpose now is testing
header := []interface{}{
block.number,
block.prevHash,
@@ -152,9 +163,8 @@ func (block *Block) MarshalRlp() []byte {
block.extra,
}
- // TODO
- uncles := []interface{}{}
- // Encode a slice interface which contains the header and the list of transactions.
+ // Encode a slice interface which contains the header and the list of
+ // transactions.
return Encode([]interface{}{header, encTx, uncles})
}