mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-22 09:21:32 +00:00
draft of blocks package
This commit is contained in:
29
blocks/data_test.go
Normal file
29
blocks/data_test.go
Normal file
@ -0,0 +1,29 @@
|
||||
package blocks
|
||||
|
||||
import (
|
||||
. "github.com/tendermint/tendermint/binary"
|
||||
"testing"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func TestBlockData(t *testing.T) {
|
||||
var bd = NewBlockData()
|
||||
var tx Tx
|
||||
|
||||
tx = &SendTx{
|
||||
Signature: Signature{AccountNumber(0), ByteSlice([]byte{7})},
|
||||
Fee: 1,
|
||||
To: AccountNumber(2),
|
||||
Amount: 3,
|
||||
}
|
||||
|
||||
bd.AddTx(tx)
|
||||
|
||||
|
||||
buf := bytes.NewBuffer(nil)
|
||||
bd.WriteTo(buf)
|
||||
|
||||
fmt.Println(len(buf.Bytes()))
|
||||
|
||||
}
|
Reference in New Issue
Block a user