def _get_reward_for_key_hash(key_hash: str, rec: list) -> int:
    """Get reward value for key hash in ledger state snapshot record."""
    for r in rec:
        if r[0]["key hash"] != key_hash:
            continue
        rew_amount = 0
        for sr in r[1]:
            rew_amount += sr["rewardAmount"]
        return rew_amount
    return 0