Skip to content

Commit

Permalink
Merge pull request #2045 from GrapeBaBa/comment_blockchain
Browse files Browse the repository at this point in the history
Fix typo when reading code
  • Loading branch information
srderson committed Jun 28, 2016
2 parents 501996e + 9699e98 commit f04b429
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions core/ledger/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (blockchain *blockchain) getTransactionsByBlockHash(blockHash []byte) ([]*p
return block.GetTransactions(), nil
}

// getTransaction get a transaction identified by blocknumber and index within the block
// getTransaction get a transaction identified by block number and index within the block
func (blockchain *blockchain) getTransaction(blockNumber uint64, txIndex uint64) (*protos.Transaction, error) {
block, err := blockchain.getBlock(blockNumber)
if err != nil {
Expand All @@ -174,7 +174,7 @@ func (blockchain *blockchain) getTransaction(blockNumber uint64, txIndex uint64)
return block.GetTransactions()[txIndex], nil
}

// getTransactionByBlockHash get a transaction identified by blockhash and index within the block
// getTransactionByBlockHash get a transaction identified by block hash and index within the block
func (blockchain *blockchain) getTransactionByBlockHash(blockHash []byte, txIndex uint64) (*protos.Transaction, error) {
block, err := blockchain.getBlockByHash(blockHash)
if err != nil {
Expand Down Expand Up @@ -265,8 +265,8 @@ func (blockchain *blockchain) persistRawBlock(block *protos.Block, blockNumber u
return err
}

// Need to check as we suport out of order blocks in cases such as block/state synchronization. This is
// really blockchain height, not size.
// Need to check as we support out of order blocks in cases such as block/state synchronization. This is
// real blockchain height, not size.
if blockchain.getSize() < blockNumber+1 {
sizeBytes := encodeUint64(blockNumber + 1)
writeBatch.PutCF(db.GetDBHandle().BlockchainCF, blockCountKey, sizeBytes)
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/blockchain_indexes_async.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (indexer *blockchainIndexerAsync) stop() {
// Since, we index blocks asynchronously, there may be a case when
// a client query arrives before a block has been indexed.
//
// Do we really need strict symantics such that an index query results
// Do we really need strict semantics such that an index query results
// should include up to block number (or higher) that may have been committed
// when user query arrives?
// If a delay of a couple of blocks are allowed, we can get rid of this synchronization stuff
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/blockchain_indexes_async_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestIndexesAsync_IndexingErrorScenario(t *testing.T) {

defer func() {
// first stop and then set the error to nil.
// Otherwise stop may hang (waiting for cathing up the index with the committing block)
// Otherwise stop may hang (waiting for catching up the index with the committing block)
testBlockchainWrapper.blockchain.indexer.stop()
asyncIndexer.indexerState.setError(nil)
}()
Expand Down
4 changes: 2 additions & 2 deletions core/ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,10 @@ func TestPreviewTXBatchBlock(t *testing.T) {
testutil.AssertNoError(t, err, "Error fetching preview block info.")

ledger.CommitTxBatch(0, []*protos.Transaction{transaction}, nil, []byte("proof"))
commitedBlockInfo, err := ledger.GetBlockchainInfo()
committedBlockInfo, err := ledger.GetBlockchainInfo()
testutil.AssertNoError(t, err, "Error fetching committed block hash.")

testutil.AssertEquals(t, previewBlockInfo, commitedBlockInfo)
testutil.AssertEquals(t, previewBlockInfo, committedBlockInfo)
}

func TestGetTransactionByUUID(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/perf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func BenchmarkLedgerSingleKeyTransaction(b *testing.B) {
}
b.StopTimer()

//varify value persisted
//verify value persisted
value, _ = ledger.GetState(chaincode, *key, true)
size := ledger.GetBlockchainSize()
b.Logf("Value size=%d, Blockchain height=%d", len(value), size)
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (testWrapper *blockchainTestWrapper) populateBlockChainWithSampleData() (bl
// -----------------------------</Block 2>------------------------------------

// -----------------------------<Block 3>-------------------------------------
// Create a transaction'
// Create a transaction
transaction3a, err := protos.NewTransaction(protos.ChaincodeID{Path: "MyContract"}, testutil.GenerateUUID(testWrapper.t), "setX", []string{"{x: \"hello\"}"})
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit f04b429

Please sign in to comment.