Skip to content

Commit

Permalink
* Fixed after review
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianMarian committed Oct 4, 2019
1 parent f23b152 commit 140578d
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 99 deletions.
8 changes: 4 additions & 4 deletions core/computers.go
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package core

// MaxInt32 returns the maximum number between two given
// MaxInt32 returns the maximum of two given numbers
func MaxInt32(a int32, b int32) int32 {
if a > b {
return a
}
return b
}

// MinInt32 returns the minimum number between two given
// MinInt32 returns the minimum of two given numbers
func MinInt32(a int32, b int32) int32 {
if a < b {
return a
}
return b
}

// MaxUint32 returns the maximum number between two given
// MaxUint32 returns the maximum of two given numbers
func MaxUint32(a uint32, b uint32) uint32 {
if a > b {
return a
}
return b
}

// MinUint32 returns the minimum number between two given
// MinUint32 returns the minimum of two given numbers
func MinUint32(a uint32, b uint32) uint32 {
if a < b {
return a
Expand Down
20 changes: 14 additions & 6 deletions process/block/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func (sp *shardProcessor) CreateMiniBlocks(noShards uint32, maxItemsInBlock uint
return sp.createMiniBlocks(noShards, maxItemsInBlock, round, haveTime)
}

func (sp *shardProcessor) GetProcessedMetaBlocksFromHeader(header *block.Header) ([]data.HeaderHandler, error) {
return sp.getProcessedMetaBlocksFromHeader(header)
func (sp *shardProcessor) GetOrderedProcessedMetaBlocksFromHeader(header *block.Header) ([]data.HeaderHandler, error) {
return sp.getOrderedProcessedMetaBlocksFromHeader(header)
}

func (sp *shardProcessor) RemoveProcessedMetaBlocksFromPool(processedMetaHdrs []data.HeaderHandler) error {
Expand Down Expand Up @@ -245,8 +245,8 @@ func (sp *shardProcessor) GetHashAndHdrStruct(header data.HeaderHandler, hash []
return &hashAndHdr{header, hash}
}

func (sp *shardProcessor) RequestFinalMissingHeaders() uint32 {
return sp.requestFinalMissingHeaders()
func (sp *shardProcessor) RequestMissingFinalityAttestingHeaders() uint32 {
return sp.requestMissingFinalityAttestingHeaders()
}

func (sp *shardProcessor) CheckMetaHeadersValidityAndFinality() error {
Expand All @@ -270,8 +270,8 @@ func (bp *baseProcessor) SetBlockSizeThrottler(blockSizeThrottler process.BlockS
bp.blockSizeThrottler = blockSizeThrottler
}

func (sp *shardProcessor) SetCurrHighestMetaHdrNonce(value uint64) {
sp.currHighestMetaHdrNonce = value
func (sp *shardProcessor) SetHighestHdrNonceForCurrentBlock(value uint64) {
sp.hdrsForCurrBlock.highestHdrNonce = value
}

func (sp *shardProcessor) DisplayLogInfo(
Expand Down Expand Up @@ -324,3 +324,11 @@ func (sp *shardProcessor) CalculateRoundDuration(
) uint64 {
return sp.calculateRoundDuration(lastBlockTimestamp, currentBlockTimestamp, lastBlockRound, currentBlockRound)
}

func (sp *shardProcessor) CreateBlockStarted() {
sp.createBlockStarted()
}

func (sp *shardProcessor) AddProcessedCrossMiniBlocksFromHeader(header *block.Header) error {
return sp.addProcessedCrossMiniBlocksFromHeader(header)
}
Loading

0 comments on commit 140578d

Please sign in to comment.