Commit d18edef7 authored by David Vorick's avatar David Vorick

update travis, fix memeory overflow issue

parent efeb3663
language: go
go:
- 1.3
- 1.4
install:
- make dependencies
......
......@@ -89,7 +89,7 @@ func testEmptyBlock(t *testing.T, s *State) {
// and checks that it actually gets rejected.
func testLargeBlock(t *testing.T, s *State) {
txns := make([]Transaction, 1)
bigData := string(make([]byte, BlockSizeLimit)) // TODO: test all the way down to one byte over the limit.
bigData := string(make([]byte, BlockSizeLimit-BlockHeaderSize+1))
txns[0] = Transaction{
ArbitraryData: []string{bigData},
}
......@@ -100,7 +100,7 @@ func testLargeBlock(t *testing.T, s *State) {
err = s.AcceptBlock(b)
if err != LargeBlockErr {
t.Fatal(err)
t.Error(err)
}
}
......@@ -152,6 +152,9 @@ func TestEmptyBlock(t *testing.T) {
// TestLargeBlock creates a new state and uses it to call testLargeBlock.
func TestLargeBlock(t *testing.T) {
if testing.Short() {
t.Skip()
}
s := CreateGenesisState()
testLargeBlock(t, s)
}
......
......@@ -15,7 +15,7 @@ import (
const (
DEBUG = true
BlockSizeLimit = 1024 * 1024 * 1024 // Blocks cannot be more than 1MB.
BlockSizeLimit = 1024 * 1024 // Blocks cannot be more than 1MB.
BlockFrequency = Timestamp(10) // In seconds.
TargetWindow = BlockHeight(80) // Number of blocks to use when calculating the target.
MedianTimestampWindow = 11 // Number of blocks that get considered when determining if a timestamp is valid.
......
......@@ -11,7 +11,7 @@ import (
const (
DEBUG = true // This is a temporary setting, will stay during beta.
BlockSizeLimit = 1024 * 1024 * 1024 // Blocks cannot be more than 1MB.
BlockSizeLimit = 1024 * 1024 // Blocks cannot be more than 1MB.
BlockFrequency = Timestamp(600) // In seconds.
TargetWindow = BlockHeight(2000) // Number of blocks to use when calculating the target.
MedianTimestampWindow = 11 // Number of blocks that get considered when determining if a timestamp is valid.
......
......@@ -9,7 +9,7 @@ import (
const (
DEBUG = true
BlockSizeLimit = 1024 * 1024 * 1024 // Blocks cannot be more than 1MB.
BlockSizeLimit = 1024 * 1024 // Blocks cannot be more than 1MB.
BlockFrequency = Timestamp(1) // In seconds.
TargetWindow = BlockHeight(1000) // Number of blocks to use when calculating the target.
MedianTimestampWindow = 11 // Number of blocks that get considered when determining if a timestamp is valid.
......
......@@ -8,6 +8,10 @@ import (
"github.com/NebulousLabs/Sia/hash"
)
const (
BlockHeaderSize = 32 + 8 + 8 + 32 + 32
)
type (
Timestamp int64
BlockHeight uint64
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment