diff --git a/benchmark_main.go b/benchmark_main.go index eb8ff2578..0f659e1aa 100644 --- a/benchmark_main.go +++ b/benchmark_main.go @@ -107,7 +107,7 @@ func main() { consensus.OnConsensusDone = node.PostConsensusProcessing // Temporary testing code, to be removed. - node.AddMoreFakeTransactions(10000) + node.AddTestingAddresses(10000) if consensus.IsLeader { // Let consensus run diff --git a/node/node.go b/node/node.go index 4f123e6cd..120a3098b 100644 --- a/node/node.go +++ b/node/node.go @@ -86,10 +86,10 @@ func (node *Node) String() string { return node.Consensus.String() } -// [Testing code] Should be deleted for production -// Create in genesis block numTxs transactions which assign 1000 token to each address in [1 - numTxs] -func (node *Node) AddMoreFakeTransactions(numTxs int) { - txs := make([]*blockchain.Transaction, numTxs) +// [Testing code] Should be deleted after production +// Creates in genesis block numAddress transactions which assign 1000 token to each address in [0 - numAddress) +func (node *Node) AddTestingAddresses(numAddress int) { + txs := make([]*blockchain.Transaction, numAddress) for i := range txs { txs[i] = blockchain.NewCoinbaseTX(strconv.Itoa(i), "", node.Consensus.ShardID) } diff --git a/node/node_test.go b/node/node_test.go index d24f7cd19..1e48d4d4f 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -39,7 +39,7 @@ func TestCountNumTransactionsInBlockchain(test *testing.T) { consensus := consensus.NewConsensus("1", "2", "0", []p2p.Peer{leader, validator}, leader) node := NewNode(&consensus) - node.AddMoreFakeTransactions(1000) + node.AddTestingAddresses(1000) if node.countNumTransactionsInBlockchain() != 1001 { test.Error("Count of transactions in the blockchain is incorrect") }