Update tests for error propagation

This commit is contained in:
Edvard
2019-02-14 16:04:12 +01:00
parent 6cd4e5ea95
commit 13eacf2081
15 changed files with 54 additions and 62 deletions
+2 -1
View File
@@ -85,9 +85,10 @@ func (repository *MockBlockRepository) MissingBlockNumbers(startingBlockNumber i
return repository.missingBlockNumbersReturnArray
}
func (repository *MockBlockRepository) SetBlocksStatus(chainHead int64) {
func (repository *MockBlockRepository) SetBlocksStatus(chainHead int64) error {
repository.setBlockStatusCalled = true
repository.setBlockStatusPassedChainHead = chainHead
return nil
}
func (repository *MockBlockRepository) AssertCreateOrUpdateBlockCallCountEquals(times int) {
+2 -2
View File
@@ -108,8 +108,8 @@ func (chain *MockBlockChain) CallContract(contractHash string, input []byte, blo
return []byte{}, nil
}
func (chain *MockBlockChain) LastBlock() *big.Int {
return chain.lastBlock
func (chain *MockBlockChain) LastBlock() (*big.Int, error) {
return chain.lastBlock, nil
}
func (chain *MockBlockChain) Node() core.Node {
-8
View File
@@ -65,14 +65,6 @@ func (repository *MockHeaderRepository) MissingBlockNumbers(startingBlockNumber,
return repository.missingBlockNumbers, nil
}
func (repository *MockHeaderRepository) HeaderExists(blockNumber int64) (bool, error) {
return repository.headerExists, nil
}
func (repository *MockHeaderRepository) SetHeaderExists(headerExists bool) {
repository.headerExists = headerExists
}
func (repository *MockHeaderRepository) SetGetHeaderError(err error) {
repository.getHeaderError = err
}