Skip to content

Commit

Permalink
Merge pull request #22 from yongchand/main
Browse files Browse the repository at this point in the history
Update blockscore to blockScore
  • Loading branch information
yongchand authored Jan 15, 2023
2 parents 72215cd + 87a6a55 commit 5a9f810
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion klaytnetl/mappers/block_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ def json_dict_to_block(self, json_dict) -> Union[KlaytnRawBlock, KlaytnBlock]:
)

# Klaytn additional properties
_block.block_score = hex_to_dec(json_dict.get("blockscore"))
# blockscore has been updated to blockScore. This will be updated when Cypress has changed its value too.
try:
block_score_value = json_dict["blockscore"]
except KeyError:
block_score_value = json_dict["blockScore"]

_block.block_score = hex_to_dec(block_score_value)

_block.total_block_score = hex_to_dec(json_dict.get("totalBlockScore"))

_block.governance_data = json_dict.get("governanceData")
Expand Down

0 comments on commit 5a9f810

Please sign in to comment.