diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-11 04:18:56 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-11 04:18:56 +0800 |
commit | f6fa4f88797030b8e83066cb262a68958953974e (patch) | |
tree | e8f8090d735defade1d7e8b313bf1d75f24c0663 /block.go | |
parent | dbd28a52525581b59fb334f2aafa3b2b56fb6ba8 (diff) | |
download | go-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.go | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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}) } |