Skip to content

Commit

Permalink
Merge 3c926a6 into d630511
Browse files Browse the repository at this point in the history
  • Loading branch information
david-julien committed Jul 26, 2017
2 parents d630511 + 3c926a6 commit 5ccb924
Show file tree
Hide file tree
Showing 13 changed files with 973 additions and 1,083 deletions.
7 changes: 1 addition & 6 deletions blockchain/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func TestGenesis(t *testing.T) {
miner := NewWallet()
currentTarget := BigIntToHash(MaxTarget)
currentTarget := BigIntToHash(c.MaxTarget)
currentBlockReward := uint64(25)
gb := Genesis(miner.Public(), currentTarget, currentBlockReward, []byte{})

Expand All @@ -31,9 +31,4 @@ func TestGenesis(t *testing.T) {
if len(gb.Transactions) != 1 {
t.Fail()
}

// Check if the transaction is a valid cloud base transaction
if valid, _ := ValidCloudBase(gb.Transactions[0]); !valid {
t.Fail()
}
}
11 changes: 5 additions & 6 deletions blockchain/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/sha256"
"math/big"
mrand "math/rand"
"time"

c "github.com/ubclaunchpad/cumulus/common/constants"
"github.com/ubclaunchpad/cumulus/common/util"
Expand Down Expand Up @@ -205,12 +204,12 @@ func NewValidTestChainAndBlock() (*BlockChain, *Block) {
// NewValidTestTarget creates a new valid target that is a random value between the
// max and min difficulties
func NewValidTestTarget() Hash {
r := new(big.Int).Rand(
mrand.New(mrand.NewSource(time.Now().Unix())),
util.BigAdd(MaxTarget, c.Big1),
return BigIntToHash(
new(big.Int).Div(
c.MaxTarget,
c.MinTarget,
),
)
r.Add(r, c.Big1)
return BigIntToHash(r)
}

// NewValidCloudBaseTestTransaction returns a new valid CloudBase transaction and
Expand Down
307 changes: 0 additions & 307 deletions blockchain/validation.go

This file was deleted.

Loading

0 comments on commit 5ccb924

Please sign in to comment.