Skip to content

Commit

Permalink
Merge pull request #154 from AntelopeIO/json_snapshot_warns
Browse files Browse the repository at this point in the history
[3.2] fix two signed/unsigned warnings in json snapshot reader
  • Loading branch information
spoonincode authored Sep 14, 2022
2 parents ad84c3a + 3220de9 commit ddfe2b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/chain/snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ void istream_json_snapshot_reader::validate() const {
// validate totem
auto expected_totem = ostream_json_snapshot_writer::magic_number;
EOS_ASSERT(impl->doc.HasMember("magic_number"), snapshot_exception, "magic_number section not found" );
auto actual_totem = impl->doc["magic_number"].GetInt();
auto actual_totem = impl->doc["magic_number"].GetUint();
EOS_ASSERT( actual_totem == expected_totem, snapshot_exception, "JSON snapshot has unexpected magic number" );

// validate version
auto expected_version = current_snapshot_version;
EOS_ASSERT(impl->doc.HasMember("version"), snapshot_exception, "version section not found" );
auto actual_version = impl->doc["version"].GetInt();
auto actual_version = impl->doc["version"].GetUint();
EOS_ASSERT( actual_version == expected_version, snapshot_exception,
"JSON snapshot is an unsupported version. Expected : ${expected}, Got: ${actual}",
("expected", expected_version)( "actual", actual_version ) );
Expand Down

0 comments on commit ddfe2b6

Please sign in to comment.