From 4d43a8a859a10be3dc0420ef4a0de9df4f059d82 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 10 Apr 2024 14:54:27 +0400 Subject: [PATCH] Remove unnecessary err != nil checks in the end of few functions (#1818) --- blockchain/blockchain.go | 6 +----- core/contract.go | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index e3ace76eb9..36d622991c 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -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 diff --git a/core/contract.go b/core/contract.go index 68eb4852dc..59130fbf4f 100644 --- a/core/contract.go +++ b/core/contract.go @@ -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) {