Skip to content

Commit

Permalink
[Nimiq]: Fix invalid integer type cast
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Nov 18, 2024
1 parent ff61ad3 commit 6598836
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Nimiq/Transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ bool Transaction::isAlbatross() const {
return false;
}

uint32_t Transaction::consensusNetworkId() const {
uint8_t Transaction::consensusNetworkId() const {
switch (networkId) {
case Proto::NetworkId::UseDefault:
case Proto::NetworkId::Mainnet:
return static_cast<uint32_t>(Proto::NetworkId::Mainnet);
return static_cast<uint8_t>(Proto::NetworkId::Mainnet);
case Proto::NetworkId::MainnetAlbatross:
return static_cast<uint32_t>(Proto::NetworkId::MainnetAlbatross);
return static_cast<uint8_t>(Proto::NetworkId::MainnetAlbatross);
default:
throw std::invalid_argument("Invalid network ID");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Nimiq/Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Transaction {

private:
bool isAlbatross() const;
uint32_t consensusNetworkId() const;
uint8_t consensusNetworkId() const;
};

} // namespace TW::Nimiq

0 comments on commit 6598836

Please sign in to comment.