Skip to content

Commit

Permalink
fix additional test for TestStore
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Oct 3, 2024
1 parent 0bde93c commit 7322767
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,18 @@ func stateUpdateByHash(txn db.Transaction, hash *felt.Felt) (*core.StateUpdate,
}

func l1MsgHashes(txn db.Transaction, l1HandlerMsgHash *common.Hash) (*felt.Felt, error) {
var l1HandlerTxnHash *felt.Felt
var raw []byte
err := txn.Get(db.L1HandlerTxnHash.Key(l1HandlerMsgHash.Bytes()), func(val []byte) error {
return encoder.Unmarshal(val, l1HandlerTxnHash)
if len(val) == 0 {
return db.ErrKeyNotFound

Check warning on line 659 in blockchain/blockchain.go

View check run for this annotation

Codecov / codecov/patch

blockchain/blockchain.go#L659

Added line #L659 was not covered by tests
}
raw = val
return nil
})
return l1HandlerTxnHash, err
if err != nil {
return nil, err
}
return new(felt.Felt).SetBytes(raw), nil
}

// SanityCheckNewHeight checks integrity of a block and resulting state update
Expand Down

0 comments on commit 7322767

Please sign in to comment.