Skip to content

Commit

Permalink
Remove unnecessary err != nil checks in the end of few functions (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan authored Apr 10, 2024
1 parent 1815864 commit 4d43a8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,7 @@ func StoreBlockHeader(txn db.Transaction, header *core.Header) error {
return err
}

if err = txn.Set(db.BlockHeadersByNumber.Key(numBytes), headerBytes); err != nil {
return err
}

return nil
return txn.Set(db.BlockHeadersByNumber.Key(numBytes), headerBytes)
}

// blockHeaderByNumber retrieves a block header from database by its number
Expand Down
6 changes: 1 addition & 5 deletions core/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ func (c *ContractUpdater) UpdateStorage(diff map[felt.Felt]*felt.Felt, cb OnValu
}
}

if err = cStorage.Commit(); err != nil {
return err
}

return nil
return cStorage.Commit()
}

func ContractStorage(addr, key *felt.Felt, txn db.Transaction) (*felt.Felt, error) {
Expand Down

0 comments on commit 4d43a8a

Please sign in to comment.