Skip to content

Commit

Permalink
Merge pull request #127 from casper-ecosystem/dev/fix-in-get-block-info
Browse files Browse the repository at this point in the history
Casper-js-sdk 2.7.4
  • Loading branch information
hoffmannjan authored Dec 17, 2021
2 parents 3476324 + bf25885 commit d447349
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to casper-js-sdk.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.7.4

### Fixed

- Fixes problems with `getBlockInfo` and mixed case block hashes.

## 2.7.3

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casper-js-sdk",
"version": "2.7.3",
"version": "2.7.4",
"license": "Apache 2.0",
"description": "SDK to interact with the Casper blockchain",
"homepage": "https://github.com/casper-ecosystem/casper-js-sdk#README.md",
Expand Down
5 changes: 4 additions & 1 deletion src/services/CasperServiceByJsonRPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ export class CasperServiceByJsonRPC {
}
})
.then((res: GetBlockResult) => {
if (res.block !== null && res.block.hash !== blockHashBase16) {
if (
res.block !== null &&
res.block.hash.toLowerCase() !== blockHashBase16.toLowerCase()
) {
throw new Error('Returned block does not have a matching hash.');
}
return res;
Expand Down

0 comments on commit d447349

Please sign in to comment.