Skip to content

Commit

Permalink
Merge pull request #2359 from div72/fix-contract-type-parse
Browse files Browse the repository at this point in the history
contract: parse strings for claim and message types
  • Loading branch information
jamescowens authored Oct 11, 2021
2 parents 32e7dce + 11aa3a5 commit 45d4159
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gridcoin/contract/contract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,14 @@ Contract::Type::Type(ContractType type) : EnumByte(type)
Contract::Type Contract::Type::Parse(std::string input)
{
// Ordered by frequency:
if (input == "claim") return ContractType::CLAIM;
if (input == "beacon") return ContractType::BEACON;
if (input == "vote") return ContractType::VOTE;
if (input == "poll") return ContractType::POLL;
if (input == "project") return ContractType::PROJECT;
if (input == "scraper") return ContractType::SCRAPER;
if (input == "protocol") return ContractType::PROTOCOL;
if (input == "message") return ContractType::MESSAGE;

return ContractType::UNKNOWN;
}
Expand Down

0 comments on commit 45d4159

Please sign in to comment.